@OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.REFRESH)
private Category parentCategory;
+ /**
+ * Default constructor
+ */
+ public ProductCategory () {
+ }
+
/**
* Constructor with all required fields
* <p>
// Call other constructor
this();
+ // Validate parameter
+ if (null == categoryI18nKey) {
+ // Throw NPE
+ throw new NullPointerException("categoryI18nKey is null"); //NOI18N
+ } else if (categoryI18nKey.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("categoryI18nKey is empty"); //NOI18N
+ } else if (null == categoryShownInStatistics) {
+ // Throw NPE
+ throw new NullPointerException("categoryShownInStatistics is null"); //NOI18N
+ }
+
// Set all here
this.categoryI18nKey = categoryI18nKey;
this.categoryShownInStatistics = categoryShownInStatistics;
}
- /**
- * Default constructor
- */
- public ProductCategory () {
- }
-
@Override
public int compareTo (final Category category) {
// Check parameter on null-reference and equality to this
if (!Objects.equals(this.getCategoryI18nKey(), category.getCategoryI18nKey())) {
return false;
+ } else if (!Objects.equals(this.getCategoryShownInStatistics(), category.getCategoryShownInStatistics())) {
+ return false;
+ } else if (!Objects.equals(this.getParentCategory(), category.getParentCategory())) {
+ return false;
} else if (!Objects.equals(this.getCategoryId(), category.getCategoryId())) {
return false;
}
public int hashCode () {
int hash = 7;
- hash = 13 * hash + Objects.hashCode(this.getCategoryId());
hash = 13 * hash + Objects.hashCode(this.getCategoryI18nKey());
+ hash = 13 * hash + Objects.hashCode(this.getCategoryId());
+ hash = 13 * hash + Objects.hashCode(this.getCategoryShownInStatistics());
+ hash = 13 * hash + Objects.hashCode(this.getParentCategory());
return hash;
}
final Product product = (Product) object;
- if (!Objects.equals(this.getProductGrossPrice(), product.getProductGrossPrice())) {
+ if (!Objects.equals(this.getProductAgeGroup(), product.getProductAgeGroup())) {
return false;
- } else if (!Objects.equals(this.getProductId(), product.getProductId())) {
+ } else if (!Objects.equals(this.getProductAvailability(), product.getProductAvailability())) {
+ return false;
+ } else if (!Objects.equals(this.getProductBarCodeNumber(), product.getProductBarCodeNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getProductCategory(), product.getProductCategory())) {
+ return false;
+ } else if (!Objects.equals(this.getProductCurrencyCode(), product.getProductCurrencyCode())) {
+ return false;
+ } else if (!Objects.equals(this.getProductFscNumber(), product.getProductFscNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getProductGrossPrice(), product.getProductGrossPrice())) {
return false;
} else if (!Objects.equals(this.getProductI18nKey(), product.getProductI18nKey())) {
return false;
- } else if (!Objects.equals(this.getProductAgeGroup(), product.getProductAgeGroup())) {
+ } else if (!Objects.equals(this.getProductId(), product.getProductId())) {
+ return false;
+ } else if (!Objects.equals(this.getProductManufacturer(), product.getProductManufacturer())) {
+ return false;
+ } else if (!Objects.equals(this.getProductNetPrice(), product.getProductNetPrice())) {
+ return false;
+ } else if (!Objects.equals(this.getProductNumber(), product.getProductNumber())) {
return false;
} else if (!Objects.equals(this.getProductSize(), product.getProductSize())) {
return false;
- } else if (!Objects.equals(this.getProductBarCodeNumber(), product.getProductBarCodeNumber())) {
+ } else if (!Objects.equals(this.getProductTaxRate(), product.getProductTaxRate())) {
+ return false;
+ } else if (!Objects.equals(this.getProductUnitAmount(), product.getProductUnitAmount())) {
+ return false;
+ } else if (!Objects.equals(this.getProductUnitI18nKey(), product.getProductUnitI18nKey())) {
return false;
}
public int hashCode () {
int hash = 7;
+ hash = 23 * hash + Objects.hashCode(this.getProductAgeGroup());
+ hash = 23 * hash + Objects.hashCode(this.getProductBarCodeNumber());
+ hash = 23 * hash + Objects.hashCode(this.getProductCategory());
+ hash = 23 * hash + Objects.hashCode(this.getProductCurrencyCode());
+ hash = 23 * hash + Objects.hashCode(this.getProductFscNumber());
hash = 23 * hash + Objects.hashCode(this.getProductGrossPrice());
- hash = 23 * hash + Objects.hashCode(this.getProductId());
hash = 23 * hash + Objects.hashCode(this.getProductI18nKey());
- hash = 23 * hash + Objects.hashCode(this.getProductAgeGroup());
+ hash = 23 * hash + Objects.hashCode(this.getProductId());
+ hash = 23 * hash + Objects.hashCode(this.getProductManufacturer());
+ hash = 23 * hash + Objects.hashCode(this.getProductNetPrice());
+ hash = 23 * hash + Objects.hashCode(this.getProductNumber());
hash = 23 * hash + Objects.hashCode(this.getProductSize());
- hash = 23 * hash + Objects.hashCode(this.getProductBarCodeNumber());
+ hash = 23 * hash + Objects.hashCode(this.getProductTaxRate());
+ hash = 23 * hash + Objects.hashCode(this.getProductUnitAmount());
+ hash = 23 * hash + Objects.hashCode(this.getProductUnitI18nKey());
return hash;
}