*/
package org.mxchange.jshopcore.model.category;
-import java.util.Objects;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
*/
@Entity (name = "category")
@Table (name = "category")
-public class ProductCategory implements Category, Comparable<Category> {
+public class ProductCategory implements Category {
/**
* Serial number
public ProductCategory () {
}
- @Override
- public int compareTo (final Category category) {
- // category should not be null
- if (null == category) {
- throw new NullPointerException("category is null"); //NOI18N
- }
-
- // Is the categoryId the same?
- if (Objects.equals(this.getCategoryId(), category.getCategoryId())) {
- // Same categoryId, means same category
- return 0;
- } else if (this.getCategoryId() > category.getCategoryId()) {
- // This categoryId is larger than compared to
- return -1;
- }
-
- // The other categoryId is larger
- return 1;
- }
-
@Override
public void copyAll (final Category category) {
// Copy all data