- items may have own manufacturer, mostly then the product itself is an abstract
product and does not have a direct manufacturer. Example: Milk can be made by
many producers ("manufacturer", I known it isn't the same but here
productProducer sounds a bit strange ...)
- bar code numbers might be very long, resulting an overflow of Long (!), so
let's take String for now
- brand name of products happens very often in for example supermarkets
- manufacturer is now optional
Signed-off-by: Roland Häder <roland@mxchange.org>
* <p>
* @return Receipt bar-code number
*/
- Long getReceiptBarCodeNumber ();
+ String getReceiptBarCodeNumber ();
/**
* Setter for receipt bar-code number
* <p>
* @param receiptBarCodeNumber Receipt bar-code number
*/
- void setReceiptBarCodeNumber (final Long receiptBarCodeNumber);
+ void setReceiptBarCodeNumber (final String receiptBarCodeNumber);
/**
* Getter for when this receipt has been created in database
* Receipt bar-code number
*/
@Column (name = "receipt_barcode_number")
- private Long receiptBarCodeNumber;
+ private String receiptBarCodeNumber;
/**
* Seller instance
}
@Override
- public Long getReceiptBarCodeNumber () {
+ public String getReceiptBarCodeNumber () {
return this.receiptBarCodeNumber;
}
@Override
- public void setReceiptBarCodeNumber (final Long receiptBarCodeNumber) {
+ public void setReceiptBarCodeNumber (final String receiptBarCodeNumber) {
this.receiptBarCodeNumber = receiptBarCodeNumber;
}
import java.io.Serializable;
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;
*/
void setItemGrossPrice (final Float itemGrossPrice);
+ /**
+ * Getter for manufacturer/producer of this item
+ * <p>
+ * @return Manufacturer/producer of this item
+ */
+ BasicData getItemManufacturer ();
+
+ /**
+ * Setter for manufacturer/producer of this item
+ * <p>
+ * @param itemManufacturer Manufacturer/producer of this item
+ */
+ void setItemManufacturer (final BasicData itemManufacturer);
+
+ /**
+ * Getter for item brand name
+ * <p>
+ * @return Item brand name
+ */
+ String getItemBrandName ();
+
+ /**
+ * Setter for item brand name
+ * <p>
+ * @param itemBrandName Item brand name
+ */
+ void setItemBrandName (final String itemBrandName);
+
@Override
boolean equals (final Object object);
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
import org.mxchange.jfinancials.model.receipt.BillableReceipt;
import org.mxchange.jfinancials.model.receipt.FinancialReceipt;
import org.mxchange.jproduct.model.category.Category;
@Transient
private static final long serialVersionUID = 126_498_698_378_571L;
+ /**
+ * Item branding
+ */
+ @Column(name = "item_brand_name")
+ private String itemBrandName;
+
/**
* Category being assigned to item's product
*/
@Column (name = "item_id", nullable = false, updatable = false)
private Long itemId;
+ /**
+ * Manufacturer/producer of this item
+ */
+ @JoinColumn (name = "item_manufacturer_id", referencedColumnName = "company_data_id")
+ @OneToOne (targetEntity = BusinessBasicData.class, cascade = CascadeType.REFRESH)
+ private BasicData itemManufacturer;
+
/**
* Net price of item
*/
return true;
}
+ @Override
+ public String getItemBrandName () {
+ return this.itemBrandName;
+ }
+
+ @Override
+ public void setItemBrandName (final String itemBrandName) {
+ this.itemBrandName = itemBrandName;
+ }
+
@Override
public Category getItemCategory () {
return this.itemCategory;
this.itemId = itemId;
}
+ @Override
+ public BasicData getItemManufacturer () {
+ return this.itemManufacturer;
+ }
+
+ @Override
+ public void setItemManufacturer (final BasicData itemManufacturer) {
+ this.itemManufacturer = itemManufacturer;
+ }
+
@Override
public Float getItemNetPrice () {
return this.itemNetPrice;