Last active
January 22, 2021 05:34
-
-
Save HabeebCycle/8cdf48dc5895ac11c499711ce7dc9819 to your computer and use it in GitHub Desktop.
User entity object
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
package com.habeebcycle.demo.api.model; | |
import org.springframework.data.annotation.Id; | |
import org.springframework.data.annotation.Version; | |
import java.io.Serializable; | |
public class User implements Serializable { | |
@Id | |
private String id; // We will implement this using UUID as aprimary key | |
@Version | |
private int version; // Used for data optimistic lock | |
private String username; // We will make this to be unique | |
private String email; // We will make this to be unique | |
private String name; | |
public User() { | |
} | |
public User(String username, String email, String name) { | |
this.username = username; | |
this.email = email; | |
this.name = name; | |
} | |
public String getId() { | |
return id; | |
} | |
public void setId(String id) { | |
this.id = id; | |
} | |
public int getVersion() { | |
return version; | |
} | |
public void setVersion(int version) { | |
this.version = version; | |
} | |
public String getUsername() { | |
return username; | |
} | |
public void setUsername(String username) { | |
this.username = username; | |
} | |
public String getEmail() { | |
return email; | |
} | |
public void setEmail(String email) { | |
this.email = email; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment