-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProject.java
More file actions
52 lines (41 loc) · 1.34 KB
/
Project.java
File metadata and controls
52 lines (41 loc) · 1.34 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.blockcloud.domain.project;
import com.blockcloud.domain.global.BaseTimeEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.persistence.*;
import lombok.*;
import com.blockcloud.domain.deployment.Deployment;
import java.util.ArrayList;
import java.util.List;
@Getter
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Project extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, length = 255)
private String name;
@Column(columnDefinition = "TEXT")
private String description;
@Column(name = "block_info", columnDefinition = "LONGTEXT")
private String blockInfo;
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonIgnore
@Builder.Default
private List<ProjectUser> members = new ArrayList<>();
@OneToOne(mappedBy = "project", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonIgnore
private ProjectShareToken shareToken;
@OneToMany(mappedBy = "project", cascade = CascadeType.ALL, orphanRemoval = true)
@JsonIgnore
private List<Deployment> deployments = new ArrayList<>();
public void updateInfo(String name, String description) {
this.name = name;
this.description = description;
}
public void updateArchitecture(String blockInfo) {
this.blockInfo = blockInfo;
}
}