- compareTo()/Comparable<T> was used back in the TDGP times and is no longer needed
- value first, then variable on comparison to avoid accidently assignments
- updated jar(s)
*/
@Entity (name = "company_contacts")
@Table (name = "company_contacts")
-public class CompanyContact implements BusinessContact, Comparable<BusinessContact> {
+public class CompanyContact implements BusinessContact {
/**
* Serial number
@OneToOne (targetEntity = CompanyHeadQuartersData.class, cascade = CascadeType.ALL, optional = false)
private HeadQuartersData headQuartersData;
- @Override
- public int compareTo (final BusinessContact businessContact) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
*/
@Entity (name = "company_basic_data")
@Table (name = "company_basic_data")
-public class CompanyBasicData implements BusinessBasicData, Comparable<BusinessBasicData> {
+public class CompanyBasicData implements BusinessBasicData {
/**
* Serial number
@Column (name = "company_website_url")
private String companyWebsiteUrl;
- @Override
- public int compareTo (final BusinessBasicData businessData) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
*/
@Entity (name = "company_branch_offices")
@Table (name = "company_branch_offices")
-public class CompanyBranchOffice implements BranchOffice, Comparable<BranchOffice> {
+public class CompanyBranchOffice implements BranchOffice {
/**
* Serial number
@Column (name = "branch_zip_code", length = 6, nullable = false)
private Integer branchZipCode;
- @Override
- public int compareTo (final BranchOffice branchOffice) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
*/
@Entity (name = "company_departments")
@Table (name = "company_departments")
-public class CompanyDepartment implements Department, Comparable<Department> {
+public class CompanyDepartment implements Department {
/**
* Serial number
@OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
private User departmentUserOwner;
- @Override
- public int compareTo (final Department department) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
*/
@Entity (name = "company_employees")
@Table (name = "company_employees")
-public class CompanyEmployee implements Employee, Comparable<Employee> {
+public class CompanyEmployee implements Employee {
/**
* Serial number
@OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
private User 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
*/
@Entity (name = "company_headquarters")
@Table (name = "company_headquarters")
-public class CompanyHeadQuartersData implements HeadQuartersData, Comparable<HeadQuartersData> {
+public class CompanyHeadQuartersData implements HeadQuartersData {
/**
* Serial number
@Column (name = "headquarters_zip_code", length = 6, nullable = false)
private Integer headquartersZipCode;
- @Override
- public int compareTo (final HeadQuartersData headQuartersData) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
+import javax.persistence.Index;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
* @author Roland Haeder<roland@mxchange.org>
*/
@Entity (name = "company_job_positions")
-@Table (name = "company_job_positions")
-public class EmployeePosition implements JobPosition, Comparable<JobPosition> {
+@Table (
+ name = "company_job_positions",
+ indexes = {
+ @Index (name = "job_position", columnList = "job_position_name", unique = true)
+ }
+)
+public class EmployeePosition implements JobPosition {
/**
* Serial number
* Name/description of the job position (example: CEO)
*/
@Basic (optional = false)
- @Column (name = "job_position_name", length = 10, nullable = false, unique = true)
+ @Column (name = "job_position_name", length = 20, nullable = false, unique = true)
private String jobPositionName;
- @Override
- public int compareTo (final JobPosition jobPosition) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;
*/
@Entity (name = "company_logos")
@Table (name = "company_logos")
-public class CompanyLogo implements BusinessLogo, Comparable<BusinessLogo> {
+public class CompanyLogo implements BusinessLogo {
/**
* Serial number
@OneToOne (targetEntity = LoginUser.class, cascade = CascadeType.REFRESH, optional = false)
private User logoUploader;
- @Override
- public int compareTo (final BusinessLogo businessLogo) {
- 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) {
+ if (null == object) {
return false;
} else if (this.getClass() != object.getClass()) {
return false;