import java.util.Date;
import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
import org.mxchange.jfinancials.model.receipt.BillableReceipt;
-import org.mxchange.jproduct.model.category.Category;
import org.mxchange.jproduct.model.product.Product;
/**
*/
public interface BillableReceiptItem extends Comparable<BillableReceiptItem>, Serializable {
- /**
- * Getter for item's product category
- * <p>
- * @return Item's product category
- */
- Category getItemCategory ();
-
- /**
- * Setter for item's product category
- * <p>
- * @param itemCategory Item's product category
- */
- void setItemCategory (final Category itemCategory);
-
/**
* Getter when this receipt item has been created in database
* <p>
import org.mxchange.jfinancials.model.receipt.BillableReceipt;
import org.mxchange.jfinancials.model.receipt.FinancialReceipt;
import org.mxchange.jfinancials.model.receipt.Receipts;
-import org.mxchange.jproduct.model.category.Categories;
-import org.mxchange.jproduct.model.category.Category;
-import org.mxchange.jproduct.model.category.ProductCategory;
import org.mxchange.jproduct.model.product.GenericProduct;
import org.mxchange.jproduct.model.product.Product;
import org.mxchange.jproduct.model.product.Products;
@Column (name = "item_brand_name")
private String itemBrandName;
- /**
- * Category being assigned to item's product
- */
- @JoinColumn (name = "item_category_id", referencedColumnName = "category_id", updatable = false)
- @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.REFRESH, optional = false)
- private Category itemCategory;
-
/**
* Item 's coupon number
*/
this();
// Set all values
- this.itemCategory = itemProduct.getProductCategory();
this.itemProduct = itemProduct;
this.itemProductQuantity = itemProductQuantity;
this.itemReceipt = itemReceipt;
this.getItemProductQuantity().compareTo(billableReceiptItem.getItemProductQuantity()),
// ... product instance
Products.compare(this.getItemProduct(), billableReceiptItem.getItemProduct()),
- // ... category instance
- Categories.compare(this.getItemCategory(), billableReceiptItem.getItemCategory()),
// and finally receipt instance
Receipts.compare(this.getItemReceipt(), billableReceiptItem.getItemReceipt())
};
this.itemBrandName = itemBrandName;
}
- @Override
- public Category getItemCategory () {
- return this.itemCategory;
- }
-
- @Override
- public void setItemCategory (final Category itemCategory) {
- this.itemCategory = itemCategory;
- }
-
@Override
public String getItemCouponNumber () {
return this.itemCouponNumber;