Commit e8666a2e by Patryk Czarnik

zapiszProdukt jako void

parent 46a2a214
......@@ -10,10 +10,13 @@ public class Product {
@XmlAttribute(name="id")
private Integer productId;
@XmlElement(name="name")
@XmlElement(name="name", required=true)
private String productName;
@XmlElement(required=true)
private BigDecimal price;
private BigDecimal vat;
private BigDecimal vat;
private String description;
public Product() {
......
......@@ -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")
public Customer jedenKlient(@WebParam(name="email") String email) throws DBException, RecordNotFound {
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