Skip to content

Commit

Permalink
Changes with CompositeEmployeeKey
Browse files Browse the repository at this point in the history
  • Loading branch information
trivesc committed May 16, 2019
1 parent 0a61b62 commit 54054c9
Show file tree
Hide file tree
Showing 33 changed files with 584 additions and 240 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.devonfw.application.pocwithidentificationcounter.employeemanagement.common.api;


public class CompositeEmployeeKey{

private String companyId;
private String employeeId;


public CompositeEmployeeKey() {
}

public CompositeEmployeeKey(String mixed) {
super();
String[] stringVar = mixed.split(",");
this.companyId = stringVar[0];
this.employeeId = stringVar[1];
}

public CompositeEmployeeKey(String companyId, String employeeId) {
super();
this.companyId = companyId;
this.employeeId = employeeId;
}

public String getCompanyId() {
return companyId;
}

public void setCompanyId(String companyId) {
this.companyId = companyId;
}

public String getEmployeeId() {
return employeeId;
}

public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,37 @@

import com.devonfw.application.pocwithidentificationcounter.general.common.api.ApplicationEntity;

public interface Employee extends ApplicationEntity {
public interface Employee<T extends CompositeEmployeeKey> extends ApplicationEntity<T> {

/**
* @return companyIdId
* @return idId
*/

public String getCompanyId();

/**
* @param companyId setter for companyId attribute
*/

public void setCompanyId(String companyId);
public T getId();

/**
* @return employeeIdId
* @param id setter for id attribute
*/

public String getEmployeeId();

/**
* @param employeeId setter for employeeId attribute
*/

public void setEmployeeId(String employeeId);
public void setId(T id);

/**
* @return nameId
*/

public String getName();

/**
* @param name setter for name attribute
*/

public void setName(String name);

/**
* @return lastNameId
*/

public String getLastName();

/**
* @param lastName setter for lastName attribute
*/

public void setLastName(String lastName);


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.devonfw.application.pocwithidentificationcounter.employeemanagement.logic.api.to;

import java.util.List;

import com.devonfw.application.pocwithidentificationcounter.phonemanagement.logic.api.to.PhoneEto;
import com.devonfw.module.basic.common.api.to.AbstractCto;

/**
* Composite transport object of Employee
*/
public class EmployeeCto extends AbstractCto {

private static final long serialVersionUID = 1L;

private EmployeeEto employee;

private List<PhoneEto> phones;

public EmployeeEto getEmployee() {
return employee;
}

public void setEmployee(EmployeeEto employee) {
this.employee = employee;
}

public List<PhoneEto> getPhones() {
return phones;
}

public void setPhones(List<PhoneEto> phones) {
this.phones = phones;
}

}
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
package com.devonfw.application.pocwithidentificationcounter.employeemanagement.logic.api.to;

import com.devonfw.application.pocwithidentificationcounter.employeemanagement.common.api.CompositeEmployeeKey;
import com.devonfw.application.pocwithidentificationcounter.employeemanagement.common.api.Employee;
import com.devonfw.module.basic.common.api.to.AbstractEto;
import com.devonfw.application.pocwithidentificationcounter.general.common.api.to.AbstractGenericEto;

/**
* Entity transport object of Employee
*/
public class EmployeeEto extends AbstractEto implements Employee {
public class EmployeeEto extends AbstractGenericEto<CompositeEmployeeKey> implements Employee<CompositeEmployeeKey> {

private static final long serialVersionUID = 1L;

private String companyId;
private String employeeId;
private String name;
private String lastName;

@Override
public String getCompanyId() {
return companyId;
}

@Override
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
private CompositeEmployeeKey id;

@Override
public String getEmployeeId() {
return employeeId;
}
private String name;

@Override
public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
private String lastName;

@Override
public String getName() {
Expand All @@ -55,12 +37,19 @@ public void setLastName(String lastName) {
this.lastName = lastName;
}

public CompositeEmployeeKey getId() {
return id;
}

public void setId(CompositeEmployeeKey id) {
this.id = id;
}

@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((this.companyId == null) ? 0 : this.companyId.hashCode());
result = prime * result + ((this.employeeId == null) ? 0 : this.employeeId.hashCode());
result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
result = prime * result + ((this.lastName == null) ? 0 : this.lastName.hashCode());
return result;
Expand All @@ -80,18 +69,11 @@ public boolean equals(Object obj) {
return false;
}
EmployeeEto other = (EmployeeEto) obj;
if (this.companyId == null) {
if (other.companyId != null) {
if (this.id == null) {
if (other.id != null) {
return false;
}
} else if (!this.companyId.equals(other.companyId)) {
return false;
}
if (this.employeeId == null) {
if (other.employeeId != null) {
return false;
}
} else if (!this.employeeId.equals(other.employeeId)) {
} else if (!this.id.equals(other.id)) {
return false;
}
if (this.name == null) {
Expand All @@ -110,4 +92,5 @@ public boolean equals(Object obj) {
}
return true;
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.devonfw.application.pocwithidentificationcounter.employeemanagement.logic.api.to;

import com.devonfw.application.pocwithidentificationcounter.employeemanagement.common.api.CompositeEmployeeKey;
import com.devonfw.application.pocwithidentificationcounter.general.common.api.to.AbstractSearchCriteriaTo;
import com.devonfw.module.basic.common.api.query.StringSearchConfigTo;

Expand All @@ -11,113 +12,44 @@ public class EmployeeSearchCriteriaTo extends AbstractSearchCriteriaTo {

private static final long serialVersionUID = 1L;

private String companyId;
private String employeeId;
private String name;
private String lastName;
private StringSearchConfigTo companyIdOption;
private StringSearchConfigTo employeeIdOption;
private StringSearchConfigTo nameOption;
private StringSearchConfigTo lastNameOption;

/**
* @return companyIdId
*/

public String getCompanyId() {
return companyId;
}

/**
* @param companyId setter for companyId attribute
*/

public void setCompanyId(String companyId) {
this.companyId = companyId;
}

/**
* @return employeeIdId
*/
private String lastName;

public String getEmployeeId() {
return employeeId;
}
private StringSearchConfigTo nameOption;

/**
* @param employeeId setter for employeeId attribute
*/
private StringSearchConfigTo lastNameOption;

public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
private CompositeEmployeeKey id;

/**
* @return nameId
*/

public String getName() {
return name;
}

/**
* @param name setter for name attribute
*/

public void setName(String name) {
this.name = name;
}

/**
* @return lastNameId
*/

public String getLastName() {
return lastName;
}

/**
* @param lastName setter for lastName attribute
*/

public void setLastName(String lastName) {
this.lastName = lastName;
}

/**
* @return the {@link StringSearchConfigTo} used to search for
* {@link #getCompanyId() companyId}.
*/
public StringSearchConfigTo getCompanyIdOption() {

return this.companyIdOption;
}

/**
* @param companyIdOption new value of {@link #getCompanyIdOption()}.
*/
public void setCompanyIdOption(StringSearchConfigTo companyIdOption) {

this.companyIdOption = companyIdOption;
}

/**
* @return the {@link StringSearchConfigTo} used to search for
* {@link #getEmployeeId() employeeId}.
*/
public StringSearchConfigTo getEmployeeIdOption() {

return this.employeeIdOption;
}

/**
* @param employeeIdOption new value of {@link #getEmployeeIdOption()}.
*/
public void setEmployeeIdOption(StringSearchConfigTo employeeIdOption) {

this.employeeIdOption = employeeIdOption;
}

/**
* @return the {@link StringSearchConfigTo} used to search for {@link #getName()
* name}.
Expand Down Expand Up @@ -152,4 +84,18 @@ public void setLastNameOption(StringSearchConfigTo lastNameOption) {
this.lastNameOption = lastNameOption;
}

/**
* @return idId
*/
public CompositeEmployeeKey getId() {
return id;
}

/**
* @param id setter for id attribute
*/
public void setId(CompositeEmployeeKey id) {
this.id = id;
}

}
Loading

0 comments on commit 54054c9

Please sign in to comment.