From 214c0401ac7123d20df311fa76523a0726723885 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Mon, 26 Aug 2024 18:01:23 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D1=85=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=BA=20=D1=83=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitlab/context/domain/entity/MergeRequest.java | 11 +++++++++++ gitlab-app/src/main/resources/application.yml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java index 318a7bf..4f8d43a 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java @@ -117,6 +117,17 @@ public class MergeRequest { @Column(name = "is_reviewer") private boolean userReviewer; + @OneToMany( + fetch = FetchType.LAZY, + cascade = {CascadeType.PERSIST, CascadeType.MERGE} + ) + @JoinTable( + name = "merge_request_approvals", + joinColumns = @JoinColumn(name = "merge_request_id", referencedColumnName = "id"), + inverseJoinColumns = @JoinColumn(name = "person_id", referencedColumnName = "id") + ) + private List approvals = new ArrayList<>(); + @ElementCollection @CollectionTable(name = "merge_request_label", joinColumns = @JoinColumn(name = "merge_request_id")) @Column(name = "label") diff --git a/gitlab-app/src/main/resources/application.yml b/gitlab-app/src/main/resources/application.yml index 94cd7ef..4543a0b 100644 --- a/gitlab-app/src/main/resources/application.yml +++ b/gitlab-app/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: change-log: classpath:liquibase/changelog.xml jpa: show-sql: false - open-in-view: false +# open-in-view: false hibernate: ddl-auto: none properties: