Advertisement
Guest User

Untitled

a guest
Jan 15th, 2017
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.19 KB | None | 0 0
  1. package com.eccomerce.models;
  2.  
  3. import javax.persistence.*;
  4. import java.io.Serializable;
  5.  
  6. /**
  7.  * Created by Michał on 31.12.2016.
  8.  */
  9. @Entity
  10. @Table(name = "users")
  11. public class User {
  12.  
  13.     @Id
  14.     @GeneratedValue(strategy = GenerationType.AUTO)
  15.     @Column(name = "id")
  16.     private Long id;
  17.     @Column(name = "username")
  18.     private String username;
  19.     @Column(name = "password")
  20.     private String password;
  21.     @Column(name = "email")
  22.     private String email;
  23.     @Column(name = "name")
  24.     private String fullName;
  25.     @Column(name = "street")
  26.     private String street;
  27.     @Column(name = "postcode")
  28.     private String postCode;
  29.     @Column(name = "city")
  30.     private String city;
  31.     @Column(name="role")
  32.     private int role;
  33.  
  34.     public User() {
  35.     }
  36.  
  37.     public User(Long id, String username, String password, String email, String fullName, String street, String postCode, String city, int role) {
  38.         this.id = id;
  39.         this.username = username;
  40.         this.password = password;
  41.         this.email = email;
  42.         this.fullName = fullName;
  43.         this.street = street;
  44.         this.postCode = postCode;
  45.         this.city = city;
  46.         this.role=role;
  47.     }
  48.  
  49. //    public User(String username, String password, int role){
  50. //        this.setUsername(username);
  51. //        this.setpassword(password);
  52. //        this.setRole(role);
  53. //    }
  54.  
  55.     public int getRole() {
  56.         return role;
  57.     }
  58.  
  59.     public void setRole(int role) {
  60.         this.role = role;
  61.     }
  62.  
  63.     public Long getId() {
  64.         return id;
  65.     }
  66.  
  67.     public void setId(Long id) {
  68.         this.id = id;
  69.     }
  70.  
  71.     public String getUsername() {
  72.         return username;
  73.     }
  74.  
  75.     public void setUsername(String username) {
  76.         this.username = username;
  77.     }
  78.  
  79.     public String getpassword() {
  80.         return password;
  81.     }
  82.  
  83.     public void setpassword(String password) {
  84.         this.password = password;
  85.     }
  86.  
  87.     public String getFullName() {
  88.         return fullName;
  89.     }
  90.  
  91.     public void setFullName(String fullName) {
  92.         this.fullName = fullName;
  93.     }
  94.  
  95.     public String getStreet() {
  96.         return street;
  97.     }
  98.  
  99.     public void setStreet(String street) {
  100.         this.street = street;
  101.     }
  102.  
  103.     public String getPostCode() {
  104.         return postCode;
  105.     }
  106.  
  107.     public void setPostCode(String postCode) {
  108.         this.postCode = postCode;
  109.     }
  110.  
  111.     public String getCity() {
  112.         return city;
  113.     }
  114.  
  115.     public void setCity(String city) {
  116.         this.city = city;
  117.     }
  118.  
  119.     public String getEmail() {
  120.         return email;
  121.     }
  122.  
  123.     public void setEmail(String email) {
  124.         this.email = email;
  125.     }
  126.  
  127.     @Override
  128.     public String toString() {
  129.         return "User{" +
  130.                 "id=" + id +
  131.                 ", username='" + username + '\'' +
  132.                 ", password='" + password + '\'' +
  133.                 ", email='" + email + '\'' +
  134.                 ", fullName='" + fullName + '\'' +
  135.                 ", street='" + street + '\'' +
  136.                 ", postCode='" + postCode + '\'' +
  137.                 ", city='" + city + '\'' +
  138.                 ", role=" + role +
  139.                 '}';
  140.     }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement