@Temporal (TemporalType.TIMESTAMP)
private Date categoryCreated;
+ /**
+ * I18n key of category
+ */
+ @Basic (optional = false)
+ @Column (name = "category_i18n_key", nullable = false, unique = true)
+ private String categoryI18nKey;
+
/**
* Id number of category
*/
@Column (name = "category_in_statistics", nullable = false)
private Boolean categoryShownInStatistics;
- /**
- * Title of category
- */
- @Basic (optional = false)
- @Column (name = "category_title", length = 100, nullable = false, unique = true)
- private String categoryTitle;
-
/**
* Parent category
*/
private Category parentCategory;
/**
- * Constructor which accepts all database fields
+ * Constructor with all required fields
* <p>
- * @param categoryTitle Category categoryTitle
+ * @param categoryI18nKey Category i18n key
* @param parentCategory Parent category
* @param categoryShownInStatistics Whether this category is shown in any
* statistics
*/
- public ProductCategory (final String categoryTitle, final Category parentCategory, final Boolean categoryShownInStatistics) {
+ public ProductCategory (final String categoryI18nKey, final Category parentCategory, final Boolean categoryShownInStatistics) {
// Call other constructor
this();
// Set all here
- this.categoryTitle = categoryTitle;
+ this.categoryI18nKey = categoryI18nKey;
this.parentCategory = parentCategory;
this.categoryShownInStatistics = categoryShownInStatistics;
}
final Category category = (Category) object;
- if (!Objects.equals(this.getCategoryTitle(), category.getCategoryTitle())) {
+ if (!Objects.equals(this.getCategoryI18nKey(), category.getCategoryI18nKey())) {
return false;
} else if (!Objects.equals(this.getCategoryId(), category.getCategoryId())) {
return false;
this.categoryCreated = categoryCreated;
}
+ @Override
+ public String getCategoryI18nKey () {
+ return this.categoryI18nKey;
+ }
+
+ @Override
+ public void setCategoryI18nKey (final String categoryI18nKey) {
+ this.categoryI18nKey = categoryI18nKey;
+ }
+
@Override
public Long getCategoryId () {
return this.categoryId;
this.categoryShownInStatistics = categoryShownInStatistics;
}
- @Override
- public String getCategoryTitle () {
- return this.categoryTitle;
- }
-
- @Override
- public void setCategoryTitle (final String categoryTitle) {
- this.categoryTitle = categoryTitle;
- }
-
@Override
public Category getParentCategory () {
return this.parentCategory;
int hash = 7;
hash = 13 * hash + Objects.hashCode(this.getCategoryId());
- hash = 13 * hash + Objects.hashCode(this.getCategoryTitle());
+ hash = 13 * hash + Objects.hashCode(this.getCategoryI18nKey());
return hash;
}