Create Service, Entity and Repository for Client and Location. Client add test to BDD done
This commit is contained in:
33
src/main/java/fr/eni/demo/bo/Client.java
Normal file
33
src/main/java/fr/eni/demo/bo/Client.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package fr.eni.demo.bo;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Builder
|
||||
|
||||
@Entity
|
||||
@Table(name="CLIENTS")
|
||||
public class Client {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "CLIENT_ID")
|
||||
private Integer id;
|
||||
|
||||
@Column(name= "LAST_NAME", nullable = false, length = 90)
|
||||
private String nom;
|
||||
|
||||
@Column(name= "FIRST_NAME", nullable = false, length = 150)
|
||||
private String prenom;
|
||||
|
||||
@Column(nullable = false, unique = true)
|
||||
private String email;
|
||||
|
||||
@OneToOne
|
||||
@JoinColumn(name = "LOCATION_ID")
|
||||
private Location location;
|
||||
}
|
||||
Reference in New Issue
Block a user