@Column (name = "category_id", nullable = false)
private Long categoryId;
+ /**
+ * Whether this category is shown in any statistics
+ */
+ @Basic (optional = false)
+ @Column (name = "category_in_statistics", nullable = false)
+ private Boolean categoryShownInStatistics;
+
/**
* Title of category
*/
/**
* Constructor which accepts all database fields
* <p>
- * @param categoryId Id number of database record
- * @param categoryTitle Category categoryTitle
- * @param parentCategory Parent category
+ * @param categoryId Id number of database record
+ * @param categoryTitle Category categoryTitle
+ * @param parentCategory Parent category
+ * @param categoryShownInStatistics Whether this category is shown in any
+ * statistics
*/
- public ProductCategory (final Long categoryId, final String categoryTitle, final Category parentCategory) {
+ public ProductCategory (final Long categoryId, final String categoryTitle, final Category parentCategory, final Boolean categoryShownInStatistics) {
// Set all here
this.categoryId = categoryId;
this.categoryTitle = categoryTitle;
this.parentCategory = parentCategory;
+ this.categoryShownInStatistics = categoryShownInStatistics;
}
/**
// Copy all data
this.setParentCategory(category.getParentCategory());
this.setCategoryTitle(category.getCategoryTitle());
+ this.setCategoryShownInStatistics(category.getCategoryShownInStatistics());
}
@Override
return false;
} else if (!Objects.equals(this.getCategoryId(), other.getCategoryId())) {
return false;
+ } else if (!Objects.equals(this.getCategoryShownInStatistics(), other.getCategoryShownInStatistics())) {
+ return false;
}
return true;
}
- @Override
- public int hashCode () {
- int hash = 7;
- hash = 13 * hash + Objects.hashCode(this.getCategoryId());
- hash = 13 * hash + Objects.hashCode(this.getCategoryTitle());
- return hash;
- }
-
@Override
public Long getCategoryId () {
return this.categoryId;
this.categoryId = categoryId;
}
+ @Override
+ public Boolean getCategoryShownInStatistics () {
+ return this.categoryShownInStatistics;
+ }
+
+ @Override
+ public void setCategoryShownInStatistics (final Boolean categoryShownInStatistics) {
+ this.categoryShownInStatistics = categoryShownInStatistics;
+ }
+
@Override
public String getCategoryTitle () {
return this.categoryTitle;
this.parentCategory = parentCategory;
}
+ @Override
+ public int hashCode () {
+ int hash = 7;
+ hash = 13 * hash + Objects.hashCode(this.getCategoryId());
+ hash = 13 * hash + Objects.hashCode(this.getCategoryTitle());
+ return hash;
+ }
+
}