summaryrefslogtreecommitdiff
path: root/spring-framework/07-user-jdbc-ds-transaction/src/main/java/com/example/fp/User.java
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-04-25 21:53:33 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-04-25 21:53:33 +0530
commit4afcff940551079617e8f4116e52bb0ef9df7fcc (patch)
treecbaed6a2a53c7d032bfafaa38b94e4fc607f3e76 /spring-framework/07-user-jdbc-ds-transaction/src/main/java/com/example/fp/User.java
parent7b08f1155e1cb8bf263c3570eeb119970407a037 (diff)
Added Spring Framework sample code
Diffstat (limited to 'spring-framework/07-user-jdbc-ds-transaction/src/main/java/com/example/fp/User.java')
-rw-r--r--spring-framework/07-user-jdbc-ds-transaction/src/main/java/com/example/fp/User.java115
1 files changed, 115 insertions, 0 deletions
diff --git a/spring-framework/07-user-jdbc-ds-transaction/src/main/java/com/example/fp/User.java b/spring-framework/07-user-jdbc-ds-transaction/src/main/java/com/example/fp/User.java
new file mode 100644
index 0000000..d940b63
--- /dev/null
+++ b/spring-framework/07-user-jdbc-ds-transaction/src/main/java/com/example/fp/User.java
@@ -0,0 +1,115 @@
+package com.example.fp;
+
+public class User {
+ private Integer uid;
+ private String username;
+ private String fullName;
+ private String password;
+ private boolean active;
+
+ public User() {
+ super();
+ }
+
+ public User(String username, String fullName, String password, boolean active) {
+ super();
+ this.username = username;
+ this.fullName = fullName;
+ this.password = password;
+ this.active = active;
+ }
+
+
+ public User(Integer uid, String username, String fullName, String password, boolean active) {
+ super();
+ this.uid = uid;
+ this.username = username;
+ this.fullName = fullName;
+ this.password = password;
+ this.active = active;
+ }
+
+ public Integer getUid() {
+ return uid;
+ }
+ public void setUid(Integer uid) {
+ this.uid = uid;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+ public void setUsername(String username) {
+ this.username = username;
+ }
+ public String getFullName() {
+ return fullName;
+ }
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+ public String getPassword() {
+ return password;
+ }
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ public boolean isActive() {
+ return active;
+ }
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+ @Override
+ public String toString() {
+ return "User [uid=" + uid + ", username=" + username + ", fullName=" + fullName + ", active=" + active + "]";
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (active ? 1231 : 1237);
+ result = prime * result + ((fullName == null) ? 0 : fullName.hashCode());
+ result = prime * result + ((password == null) ? 0 : password.hashCode());
+ result = prime * result + uid;
+ result = prime * result + ((username == null) ? 0 : username.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ User other = (User) obj;
+ if (active != other.active)
+ return false;
+ if (fullName == null) {
+ if (other.fullName != null)
+ return false;
+ } else if (!fullName.equals(other.fullName))
+ return false;
+ if (password == null) {
+ if (other.password != null)
+ return false;
+ } else if (!password.equals(other.password))
+ return false;
+ if (uid != other.uid)
+ return false;
+ if (username == null) {
+ if (other.username != null)
+ return false;
+ } else if (!username.equals(other.username))
+ return false;
+ return true;
+ }
+
+
+
+
+}