File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
java/com/capturecat/core/domain/user Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .capturecat .core .domain .user ;
2+
3+ import jakarta .persistence .Entity ;
4+ import jakarta .persistence .FetchType ;
5+ import jakarta .persistence .GeneratedValue ;
6+ import jakarta .persistence .GenerationType ;
7+ import jakarta .persistence .Id ;
8+ import jakarta .persistence .ManyToOne ;
9+
10+ import lombok .AccessLevel ;
11+ import lombok .NoArgsConstructor ;
12+
13+ import com .capturecat .core .domain .BaseTimeEntity ;
14+ import com .capturecat .core .domain .tag .Tag ;
15+
16+ @ Entity
17+ @ NoArgsConstructor (access = AccessLevel .PROTECTED )
18+ public class UserTag extends BaseTimeEntity {
19+
20+ @ Id
21+ @ GeneratedValue (strategy = GenerationType .IDENTITY )
22+ private Long id ;
23+
24+ @ ManyToOne (fetch = FetchType .LAZY )
25+ private User user ;
26+
27+ @ ManyToOne (fetch = FetchType .LAZY )
28+ private Tag tag ;
29+ }
Original file line number Diff line number Diff line change 1+ create table if not exists user_tag
2+ (
3+ id bigint generated by default as identity primary key ,
4+ user_id bigint constraint fk_user_tag_user references users
5+ tag_id bigint constraint fk_user_tag_tag references tag,
6+ created_date timestamp (6 ) not null ,
7+ last_modified_date timestamp (6 ) not null ,
8+ );
You can’t perform that action at this time.
0 commit comments