Blame view

PFE06/src/main/java/com/PFE/ServerManager/Customer.java 952 Bytes
e1305e8c   sfeutrie   projet Spring boo...
1
2
  package com.PFE.ServerManager;
  
d0a03db7   sfeutrie   restructuration d...
3
4
5
6
  import javax.persistence.*;
  
  @Entity
  @Table(name = "customer") // NE PAS utiliser "User" car c'est un mot clef réservé pour PostgreSQL
e1305e8c   sfeutrie   projet Spring boo...
7
  public class Customer{
e743b1b9   Antoine Duquenoy   Ajout d'un utilis...
8
  
e1305e8c   sfeutrie   projet Spring boo...
9
10
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
d0a03db7   sfeutrie   restructuration d...
11
      private Integer customer_id;
e1305e8c   sfeutrie   projet Spring boo...
12
13
14
15
16
17
18
  
      @Column(name = "pseudo")
      private String pseudo;
  
      @Column(name = "password")
      private String password;
  
d0a03db7   sfeutrie   restructuration d...
19
20
21
22
      @ManyToOne(cascade = CascadeType.ALL)
      @JoinTable(name = "customer_role", joinColumns = @JoinColumn(name = "customer_id"), inverseJoinColumns = @JoinColumn(name = "role_id"))
      //private Set<Role> roles;
      private Role role;
e1305e8c   sfeutrie   projet Spring boo...
23
  
d0a03db7   sfeutrie   restructuration d...
24
25
      public void setRole(Role role) {
          this.role = role;
e1305e8c   sfeutrie   projet Spring boo...
26
27
28
      }
  
      public void setId(Integer id) {
d0a03db7   sfeutrie   restructuration d...
29
          this.customer_id = id;
e1305e8c   sfeutrie   projet Spring boo...
30
31
32
33
34
35
36
37
38
      }
  
      public void setPseudo(String pseudo) {
          this.pseudo = pseudo;
      }
  
      public void setPassword(String password) {
          this.password = password;
      }
e1305e8c   sfeutrie   projet Spring boo...
39
  }