Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVC-882 fixed issues related to the services #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion poc-with-identification-counter/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@
<groupId>com.devonfw.java.modules</groupId>
<artifactId>devon4j-security</artifactId>
</dependency>
<!-- Required for secrutiy REST service -->
<!-- Required for security REST service -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Tests -->
<dependency>
<groupId>com.devonfw.java.modules</groupId>
<artifactId>devon4j-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,77 @@

import java.io.Serializable;

public class CompositeEmployeeKey implements Serializable{
public class CompositeEmployeeKey implements Serializable {

private static final long serialVersionUID = 1L;
private String companyId;
private String employeeId;
private static final long serialVersionUID = 1L;

private String companyId;

public CompositeEmployeeKey() {
}
private String employeeId;

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

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

public String getCompanyId() {
return companyId;
}
public CompositeEmployeeKey(String mixed) {

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

public String getEmployeeId() {
return employeeId;
}
public CompositeEmployeeKey(String companyId, String employeeId) {

public void setEmployeeId(String employeeId) {
this.employeeId = employeeId;
}
super();
this.companyId = companyId;
this.employeeId = employeeId;
}

@Override
public boolean equals(Object other) {
if (this == other) return true;
if ( !(other instanceof CompositeEmployeeKey) ) return false;
public String getCompanyId() {

final CompositeEmployeeKey compositeEmployeeKey = (CompositeEmployeeKey) other;
return this.companyId;
}

if ( !compositeEmployeeKey.getCompanyId().equals( getCompanyId() ) ) return false;
if ( !compositeEmployeeKey.getEmployeeId().equals( getEmployeeId() ) ) return false;
public void setCompanyId(String companyId) {

return true;
}
this.companyId = companyId;
}

@Override
public int hashCode() {
int result;
result = getCompanyId().hashCode();
result = 29 * result + getEmployeeId().hashCode();
return result;
}
public String getEmployeeId() {

return this.employeeId;
}

public void setEmployeeId(String employeeId) {

this.employeeId = employeeId;
}

@Override
public boolean equals(Object other) {

if (this == other)
return true;
if (!(other instanceof CompositeEmployeeKey))
return false;

final CompositeEmployeeKey compositeEmployeeKey = (CompositeEmployeeKey) other;

if (!compositeEmployeeKey.getCompanyId().equals(getCompanyId()))
return false;
if (!compositeEmployeeKey.getEmployeeId().equals(getEmployeeId()))
return false;

return true;
}

@Override
public int hashCode() {

int result;
result = getCompanyId().hashCode();
result = 29 * result + getEmployeeId().hashCode();
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,88 +9,83 @@
*/
public class EmployeeEto extends AbstractComposedKeyEto<CompositeEmployeeKey> implements Employee {

private static final long serialVersionUID = 1L;

private CompositeEmployeeKey id;

private String name;

private String lastName;

@Override
public String getName() {
return name;
}

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

@Override
public String getLastName() {
return lastName;
}

@Override
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.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;
}

@Override
public boolean equals(Object obj) {

if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
// class check will be done by super type EntityTo!
if (!super.equals(obj)) {
return false;
}
EmployeeEto other = (EmployeeEto) obj;
if (this.id == null) {
if (other.id != null) {
return false;
}
} else if (!this.id.equals(other.id)) {
return false;
}
if (this.name == null) {
if (other.name != null) {
return false;
}
} else if (!this.name.equals(other.name)) {
return false;
}
if (this.lastName == null) {
if (other.lastName != null) {
return false;
}
} else if (!this.lastName.equals(other.lastName)) {
return false;
}
return true;
}
private static final long serialVersionUID = 1L;

private String name;

private String lastName;

@Override
public String getName() {

return this.name;
}

@Override
public void setName(String name) {

this.name = name;
}

@Override
public String getLastName() {

return this.lastName;
}

@Override
public void setLastName(String lastName) {

this.lastName = lastName;
}

@Override
public int hashCode() {

final int prime = 31;
int result = super.hashCode();
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
result = prime * result + ((this.lastName == null) ? 0 : this.lastName.hashCode());
return result;
}

@Override
public boolean equals(Object obj) {

if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
// class check will be done by super type EntityTo!
if (!super.equals(obj)) {
return false;
}
EmployeeEto other = (EmployeeEto) obj;
if (getId() == null) {
if (other.getId() != null) {
return false;
}
} else if (!getId().equals(other.getId())) {
return false;
}
if (this.name == null) {
if (other.name != null) {
return false;
}
} else if (!this.name.equals(other.name)) {
return false;
}
if (this.lastName == null) {
if (other.lastName != null) {
return false;
}
} else if (!this.lastName.equals(other.lastName)) {
return false;
}
return true;
}

}
Loading