Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.example.login.model;
- import org.hibernate.annotations.GenericGenerator;
- import org.hibernate.validator.constraints.NotEmpty;
- import javax.persistence.*;
- import javax.validation.constraints.NotNull;
- @Entity
- @Table(name = "user")
- public class User {
- @Id
- @GeneratedValue(generator = "uuid")
- @GenericGenerator(name = "uuid", strategy = "uuid2")
- private String id;
- @NotNull
- @NotEmpty
- private String name;
- @NotNull @NotEmpty
- private String username;
- @NotNull @NotEmpty
- private String password;
- @NotNull @NotEmpty
- private byte active;
- @NotEmpty
- @ManyToOne
- @JoinColumn(name = "company_id", nullable = false)
- private Company company;
- User() {
- }
- public User(String id, String name, String username, String password, byte active) {
- this.id = id;
- this.name = name;
- this.username = username;
- this.password = password;
- this.active = active;
- }
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getUsername() {
- return username;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- public int getActive() {
- return active;
- }
- public void setActive(byte active) {
- this.active = active;
- }
- public Company getCompany() {
- return company;
- }
- public void setCompany(Company company) {
- this.company = company;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement