-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4bd51f
commit 022dfd3
Showing
15 changed files
with
1,407 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/main/java/com/example/demo/persistence/entity/UserEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.example.demo.persistence.entity; | ||
|
||
import java.io.Serializable; | ||
|
||
public class UserEntity implements Serializable { | ||
private Integer id; | ||
|
||
private String username; | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username == null ? null : username.trim(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object that) { | ||
if (this == that) { | ||
return true; | ||
} | ||
if (that == null) { | ||
return false; | ||
} | ||
if (getClass() != that.getClass()) { | ||
return false; | ||
} | ||
UserEntity other = (UserEntity) that; | ||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) | ||
&& (this.getUsername() == null ? other.getUsername() == null : this.getUsername().equals(other.getUsername())); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); | ||
result = prime * result + ((getUsername() == null) ? 0 : getUsername().hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append(getClass().getSimpleName()); | ||
sb.append(" ["); | ||
sb.append("Hash = ").append(hashCode()); | ||
sb.append(", id=").append(id); | ||
sb.append(", username=").append(username); | ||
sb.append(", serialVersionUID=").append(serialVersionUID); | ||
sb.append("]"); | ||
return sb.toString(); | ||
} | ||
} |
Oops, something went wrong.