private static final long serialVersionUID = 52_749_158_492_581_578L;
/**
- * Item amount
+ * Item orderedAmount
*/
@Basic (optional = false)
- @Column (name = "amount", nullable = false, length = 20)
- private Long amount;
+ @Column (name = "ordered_amount", nullable = false, length = 20)
+ private Long orderedAmount;
/**
* Entry itemId (from database backend)
*/
@JoinColumn (name = "product_id", updatable = false)
@OneToOne (targetEntity = GenericProduct.class)
- private Product product;
+ private Product itemProduct;
/**
* Default constructor
// Call default constructor
this();
- // product must not be null
+ // itemProduct must not be null
if (null == product) {
// Abort here
throw new NullPointerException("product is null"); //NOI18N
this.itemType = "product"; //NOI18N
// Copy instance
- this.product = product;
+ this.itemProduct = product;
}
/**
- * Constructor for an item from given Product instance and amount.
+ * Constructor for an item from given Product instance and orderedAmount.
*
* @param product Product instance
- * @param amount Ordered amount
+ * @param amount Ordered orderedAmount
*/
public BasketItem (final Product product, final Long amount) {
// Other constructor
this(product);
- // amount must not be null
+ // orderedAmount must not be null
if (null == amount) {
// Abort here
throw new NullPointerException("amount is null"); //NOI18N
}
- // Set amount
- this.amount = amount;
+ // Set orderedAmount
+ this.orderedAmount = amount;
}
@Override
- public Long getAmount () {
- return this.amount;
+ public Long getOrderedAmount () {
+ return this.orderedAmount;
}
@Override
- public void setAmount (final Long amount) {
- this.amount = amount;
+ public void setOrderedAmount (final Long orderedAmount) {
+ this.orderedAmount = orderedAmount;
}
@Override
}
@Override
- public Product getProduct () {
- return this.product;
+ public Product getItemProduct () {
+ return this.itemProduct;
}
@Override
- public void setProduct (final Product product) {
- this.product = product;
+ public void setItemProduct (final Product itemProduct) {
+ this.itemProduct = itemProduct;
}
}