-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDdipEventEntity.java
More file actions
79 lines (62 loc) · 2.16 KB
/
DdipEventEntity.java
File metadata and controls
79 lines (62 loc) · 2.16 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package com.knu.ddip.ddipevent.infrastructure.entity;
import com.knu.ddip.ddipevent.domain.DdipStatus;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.annotations.UuidGenerator;
import org.hibernate.type.SqlTypes;
import org.locationtech.jts.geom.Point;
import java.time.Instant;
import java.util.List;
import java.util.UUID;
@Entity
@Table(name = "ddip_event")
@Getter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DdipEventEntity {
@Id
@UuidGenerator
@Column(columnDefinition = "char(36)", updatable = false, nullable = false)
@JdbcTypeCode(SqlTypes.CHAR)
private UUID id;
@Column(nullable = false)
private String title;
@Lob
@Column(nullable = false)
private String content;
@Column(columnDefinition = "char(36)", updatable = false, nullable = false)
@JdbcTypeCode(SqlTypes.CHAR)
private UUID requesterId;
@Column(nullable = false)
private Integer reward;
@Column(nullable = false)
private Double latitude;
@Column(nullable = false)
private Double longitude;
@Column(name = "local_point", columnDefinition = "POINT SRID 4326", nullable = false)
@Setter
private Point localPoint;
@Column(nullable = false)
private Instant createdAt;
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private DdipStatus status;
@Column(columnDefinition = "char(36)")
@JdbcTypeCode(SqlTypes.CHAR)
private UUID selectedResponderId;
@ElementCollection(fetch = FetchType.LAZY)
@CollectionTable(name = "ddip_applicant", joinColumns = @JoinColumn(name = "ddip_event_id"))
@Column(name = "applicant_id", columnDefinition = "char(36)")
@JdbcTypeCode(SqlTypes.CHAR)
private List<UUID> applicants;
@Setter
@OneToMany(mappedBy = "ddipEvent", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private List<PhotoEntity> photos;
@Setter
@OneToMany(mappedBy = "ddipEvent", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
private List<InteractionEntity> interactions;
@Column(nullable = false)
private Integer difficulty;
}