@OneToOne (targetEntity = CompanyBranchOffice.class, cascade = CascadeType.ALL)
private BranchOffice employeeBranchOffice;
- /**
- * Head quarters id number (if the employee works there)
- */
- @JoinColumn (name = "employee_headquarters_id")
- @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL)
- private HeadQuartersData employeeHeadquarter;
-
/**
* Company the employee is working at
*/
@OneToOne (targetEntity = CompanyContact.class, cascade = CascadeType.ALL, optional = false)
private BusinessContact employeeCompany;
+ /**
+ * Timestamp when this entry has been created
+ */
+ @Basic (optional = false)
+ @Temporal (TemporalType.TIMESTAMP)
+ @Column (name = "employee_entry_created", nullable = false, updatable = false)
+ private Calendar employeeCreated;
+
/**
* Department the employee works at
*/
@Column (name = "employee_email_address", length = 30)
private String employeeEmailAddress;
+ /**
+ * Head quarters id number (if the employee works there)
+ */
+ @JoinColumn (name = "employee_headquarters_id")
+ @OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL)
+ private HeadQuartersData employeeHeadquarter;
+
/**
* Id number
*/
@OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.MERGE, optional = false)
private User employeeUserOwner;
- /**
- * Timestamp when this entry has been created
- */
- @Basic (optional = false)
- @Temporal (TemporalType.TIMESTAMP)
- @Column (name = "employee_entry_created", nullable = false, updatable = false)
- private Calendar employeeCreated;
+ @Override
+ public int compareTo (final Employee employee) {
+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+ }
+
+ @Override
+ public boolean equals (final Object object) {
+ if (object == null) {
+ return false;
+ } else if (this.getClass() != object.getClass()) {
+ return false;
+ }
+
+ final Employee other = (Employee) object;
+
+ if (!Objects.equals(this.getEmployeeCompany(), other.getEmployeeCompany())) {
+ return false;
+ } else if (!Objects.equals(this.getEmployeeNumber(), other.getEmployeeNumber())) {
+ return false;
+ } else if (!Objects.equals(this.getEmployeePersonalData(), other.getEmployeePersonalData())) {
+ return false;
+ }
+
+ return true;
+ }
@Override
public BranchOffice getEmployeeBranchOffice () {
this.employeeCompany = employeeCompany;
}
+ @Override
+ public Calendar getEmployeeCreated () {
+ return this.employeeCreated;
+ }
+
+ @Override
+ public void setEmployeeCreated (final Calendar employeeCreated) {
+ this.employeeCreated = employeeCreated;
+ }
+
@Override
public Department getEmployeeDepartment () {
return this.employeeDepartment;
this.employeePosition = employeePosition;
}
- @Override
- public Calendar getEmployeeCreated () {
- return this.employeeCreated;
- }
-
- @Override
- public void setEmployeeCreated (final Calendar employeeCreated) {
- this.employeeCreated = employeeCreated;
- }
-
@Override
public User getEmployeeUserOwner () {
return this.employeeUserOwner;
this.employeeUserOwner = employeeUserOwner;
}
- @Override
- public int compareTo (final Employee employee) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public boolean equals (final Object object) {
- if (object == null) {
- return false;
- } else if (getClass() != object.getClass()) {
- return false;
- }
-
- final Employee other = (Employee) object;
-
- if (!Objects.equals(this.getEmployeeCompany(), other.getEmployeeCompany())) {
- return false;
- } else if (!Objects.equals(this.getEmployeeNumber(), other.getEmployeeNumber())) {
- return false;
- } else if (!Objects.equals(this.getEmployeePersonalData(), other.getEmployeePersonalData())) {
- return false;
- }
-
- return true;
- }
-
@Override
public int hashCode () {
int hash = 3;