@OneToOne (targetEntity = CompanyHeadquartersData.class, cascade = CascadeType.ALL)
private HeadquartersData departmentHeadquarters;
+ /**
+ * Department i18n key
+ */
+ @Basic (optional = false)
+ @Column (name = "department_i18n_key", length = 100, nullable = false)
+ private String departmentI18nKey;
+
/**
* Id number
*/
@OneToOne (targetEntity = CompanyEmployee.class, cascade = CascadeType.ALL)
private Employee departmentLead;
- /**
- * Department name
- */
- @Basic (optional = false)
- @Column (name = "department_name", length = 100, nullable = false)
- private String departmentName;
-
/**
* User owner instance
*/
// Set all fields
this.departmentCompany = departmentCompany;
- this.departmentName = departmentName;
+ this.departmentI18nKey = departmentName;
}
@Override
return false;
} else if (!Objects.equals(this.getDepartmentCompany(), other.getDepartmentCompany())) {
return false;
- } else if (!Objects.equals(this.getDepartmentName(), other.getDepartmentName())) {
+ } else if (!Objects.equals(this.getDepartmentI18nKey(), other.getDepartmentI18nKey())) {
return false;
}
this.departmentHeadquarters = departmentHeadquarters;
}
+ @Override
+ public String getDepartmentI18nKey () {
+ return this.departmentI18nKey;
+ }
+
+ @Override
+ public void setDepartmentI18nKey (final String departmentI18nKey) {
+ this.departmentI18nKey = departmentI18nKey;
+ }
+
@Override
public Long getDepartmentId () {
return this.departmentId;
this.departmentLead = departmentLead;
}
- @Override
- public String getDepartmentName () {
- return this.departmentName;
- }
-
- @Override
- public void setDepartmentName (final String departmentName) {
- this.departmentName = departmentName;
- }
-
@Override
public User getDepartmentUserOwner () {
return this.departmentUserOwner;
hash = 53 * hash + Objects.hashCode(this.getDepartmentId());
hash = 53 * hash + Objects.hashCode(this.getDepartmentCompany());
- hash = 53 * hash + Objects.hashCode(this.getDepartmentName());
+ hash = 53 * hash + Objects.hashCode(this.getDepartmentI18nKey());
return hash;
}
void setDepartmentLead (final Employee departmentLead);
/**
- * Getter for department name
+ * Getter for department i18n key
* <p>
- * @return Department name
+ * @return Department i18n key
*/
- String getDepartmentName ();
+ String getDepartmentI18nKey ();
/**
- * Setter for department name
+ * Setter for department i18n key
* <p>
- * @param departmentName Department name
+ * @param departmentI18nKey Department i18n key
*/
- void setDepartmentName (final String departmentName);
+ void setDepartmentI18nKey (final String departmentI18nKey);
/**
* Getter for user owner instance
} else if (department1.getDepartmentCompany() == null) {
// Throw NPE again
throw new NullPointerException("department1.departmentCompany is null"); //NOI18N
- } else if (department1.getDepartmentName() == null) {
+ } else if (department1.getDepartmentI18nKey() == null) {
// Throw it again
throw new NullPointerException("department1.departmentName is null"); //NOI18N
- } else if (department1.getDepartmentName().isEmpty()) {
+ } else if (department1.getDepartmentI18nKey().isEmpty()) {
// Throw IAE
throw new IllegalArgumentException("department1.departmentName is empty"); //NOI18N
} else if (department2.getDepartmentCompany() == null) {
// Throw NPE again
throw new NullPointerException("department2.departmentCompany is null"); //NOI18N
- } else if (department2.getDepartmentName() == null) {
+ } else if (department2.getDepartmentI18nKey() == null) {
// Throw it again
throw new NullPointerException("department2.departmentName is null"); //NOI18N
- } else if (department2.getDepartmentName().isEmpty()) {
+ } else if (department2.getDepartmentI18nKey().isEmpty()) {
// Throw IAE
throw new IllegalArgumentException("department2.departmentName is empty"); //NOI18N
}
// Same company and same name?
boolean isSame = ((Objects.equals(department1.getDepartmentCompany(), department2.getDepartmentCompany())) &&
- (Objects.equals(department1.getDepartmentName(), department2.getDepartmentName())));
+ (Objects.equals(department1.getDepartmentI18nKey(), department2.getDepartmentI18nKey())));
// Return it
return isSame;