@Override public Order build(GenericFactory<Order> factory) { if (model == null) model = new Order(); model.setId(id); model.setCode(code); model.setName(name); model.setDescription(description); model.setPrice(price); model.setDeliveryValue(deliveryValue); model.setDiscount(discount); // model.setProducts(products); model.setSeller(seller); return model; }
@Override public GenericBean<Order> load(Order model) { if (model == null) throw new IllegalStateException(); this.id = model.getId(); this.code = model.getCode(); this.name = model.getName(); this.description = model.getDescription(); this.price = model.getPrice(); this.deliveryValue = model.getDeliveryValue(); this.discount = model.getDiscount(); // this.products = model.getProducts(); this.seller = model.getSeller(); return this; }