-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathProject.java
More file actions
34 lines (29 loc) · 801 Bytes
/
Project.java
File metadata and controls
34 lines (29 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.accenture.codingtest.springbootcodingtest.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "project")
public class Project {
@Id
@GeneratedValue(generator = "uuid2")
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Type(type = "uuid-char")
private UUID id;
@Column(nullable = false, unique = true)
private String name;
@OneToMany
private Set<User> User = new HashSet<>();
public Project(String name) {
this.name = name;
}
}