/**
* Currency code for both prices, like EUR or USD
*/
- @Basic(optional = false)
- @Column(name = "product_currency_code", nullable = false, length = 3)
+ @Basic (optional = false)
+ @Column (name = "product_currency_code", nullable = false, length = 3)
private String productCurrencyCode;
/**
@Column (name = "product_gross_price", nullable = false)
private Float productGrossPrice;
+ /**
+ * I18n key of product
+ */
+ @Basic (optional = false)
+ @Column (name = "product_i18n_key", length = 100, nullable = false, unique = true)
+ private String productI18nKey;
+
/**
* Id number of product
*/
/**
* The company that has manufactured/produced this product
*/
- @JoinColumn(name = "product_manufacturer_id", referencedColumnName = "company_data_id")
- @OneToOne(targetEntity = BusinessBasicData.class, cascade = CascadeType.REFRESH)
+ @JoinColumn (name = "product_manufacturer_id", referencedColumnName = "company_data_id")
+ @OneToOne (targetEntity = BusinessBasicData.class, cascade = CascadeType.REFRESH)
private BasicData productManfacturer;
/**
@Column (name = "product_tax_rate")
private Float productTaxRate;
- /**
- * Title of product
- */
- @Basic (optional = false)
- @Column (name = "product_title", length = 100, nullable = false, unique = true)
- private String productTitle;
-
/**
* Amount of this product (for example 1 for 1 liter)
*/
/**
* Constructor will all required data
* <p>
- * @param productTitle Name of product
+ * @param productI18nKey I18n key of product
* @param productGrossPrice Product's gross price
* @param productCurrencyCode code for both prices
* @param productCategory Category instance
* @param productAvailability Availability (selectable by customer)
*/
- public GenericProduct (final String productTitle, final Float productGrossPrice, final String productCurrencyCode, final Category productCategory, final Boolean productAvailability) {
+ public GenericProduct (final String productI18nKey, final Float productGrossPrice, final String productCurrencyCode, final Category productCategory, final Boolean productAvailability) {
// Set all here
- this.productTitle = productTitle;
+ this.productI18nKey = productI18nKey;
this.productGrossPrice = productGrossPrice;
this.productCurrencyCode = productCurrencyCode;
this.productCategory = productCategory;
if (!Objects.equals(this.getProductId(), product.getProductId())) {
return false;
- } else if (!Objects.equals(this.getProductTitle(), product.getProductTitle())) {
+ } else if (!Objects.equals(this.getProductI18nKey(), product.getProductI18nKey())) {
return false;
}
this.productGrossPrice = productGrossPrice;
}
+ @Override
+ public String getProductI18nKey () {
+ return this.productI18nKey;
+ }
+
+ @Override
+ public void setProductI18nKey (final String productI18nKey) {
+ this.productI18nKey = productI18nKey;
+ }
+
@Override
public Long getProductId () {
return this.productId;
this.productTaxRate = productTaxRate;
}
- @Override
- public String getProductTitle () {
- return this.productTitle;
- }
-
- @Override
- public void setProductTitle (final String productTitle) {
- this.productTitle = productTitle;
- }
-
@Override
public Float getProductUnitAmount () {
return this.productUnitAmount;
int hash = 7;
hash = 23 * hash + Objects.hashCode(this.getProductId());
- hash = 23 * hash + Objects.hashCode(this.getProductTitle());
+ hash = 23 * hash + Objects.hashCode(this.getProductI18nKey());
return hash;
}