Advertisement
jeruktutut

User

May 9th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.87 KB | None | 0 0
  1. package com.example.login.model;
  2.  
  3. import org.hibernate.annotations.GenericGenerator;
  4. import org.hibernate.validator.constraints.NotEmpty;
  5.  
  6. import javax.persistence.*;
  7. import javax.validation.constraints.NotNull;
  8.  
  9. @Entity
  10. @Table(name = "user")
  11. public class User {
  12.  
  13.     @Id
  14.     @GeneratedValue(generator = "uuid")
  15.     @GenericGenerator(name = "uuid", strategy = "uuid2")
  16.     private String id;
  17.  
  18.     @NotNull
  19.     @NotEmpty
  20.     private String name;
  21.  
  22.     @NotNull @NotEmpty
  23.     private String username;
  24.  
  25.     @NotNull @NotEmpty
  26.     private String password;
  27.  
  28.     @NotNull @NotEmpty
  29.     private byte active;
  30.  
  31.     @NotEmpty
  32.     @ManyToOne
  33.     @JoinColumn(name = "company_id", nullable = false)
  34.     private Company company;
  35.  
  36.     User() {
  37.     }
  38.  
  39.     public User(String id, String name, String username, String password, byte active) {
  40.         this.id = id;
  41.         this.name = name;
  42.         this.username = username;
  43.         this.password = password;
  44.         this.active = active;
  45.     }
  46.  
  47.     public String getId() {
  48.         return id;
  49.     }
  50.  
  51.     public void setId(String id) {
  52.         this.id = id;
  53.     }
  54.  
  55.     public String getName() {
  56.         return name;
  57.     }
  58.  
  59.     public void setName(String name) {
  60.         this.name = name;
  61.     }
  62.  
  63.     public String getUsername() {
  64.         return username;
  65.     }
  66.  
  67.     public void setUsername(String username) {
  68.         this.username = username;
  69.     }
  70.  
  71.     public String getPassword() {
  72.         return password;
  73.     }
  74.  
  75.     public void setPassword(String password) {
  76.         this.password = password;
  77.     }
  78.  
  79.     public int getActive() {
  80.         return active;
  81.     }
  82.  
  83.     public void setActive(byte active) {
  84.         this.active = active;
  85.     }
  86.  
  87.     public Company getCompany() {
  88.         return company;
  89.     }
  90.  
  91.     public void setCompany(Company company) {
  92.         this.company = company;
  93.     }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement