Commit e8666a2e by Patryk Czarnik

zapiszProdukt jako void

parent 46a2a214
...@@ -10,9 +10,12 @@ public class Product { ...@@ -10,9 +10,12 @@ public class Product {
@XmlAttribute(name="id") @XmlAttribute(name="id")
private Integer productId; private Integer productId;
@XmlElement(name="name") @XmlElement(name="name", required=true)
private String productName; private String productName;
@XmlElement(required=true)
private BigDecimal price; private BigDecimal price;
private BigDecimal vat; private BigDecimal vat;
private String description; private String description;
......
...@@ -71,6 +71,14 @@ public class Sklep { ...@@ -71,6 +71,14 @@ public class Sklep {
} }
} }
public void zapiszProdukt(@WebParam(name="product") Product product) throws DBException {
try(DBConnection db = DBConnection.open()) {
ProductDAO productDAO = db.productDAO();
productDAO.save(product);
db.commit();
}
}
@WebResult(name="customer") @WebResult(name="customer")
public Customer jedenKlient(@WebParam(name="email") String email) throws DBException, RecordNotFound { public Customer jedenKlient(@WebParam(name="email") String email) throws DBException, RecordNotFound {
try(DBConnection db = DBConnection.open()) { try(DBConnection db = DBConnection.open()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment