From f9fd839a14f13fbc20e97593277ac624f4f6ceaf Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Tue, 7 Feb 2023 22:30:47 +0400 Subject: [PATCH] #81 -- Add branch indexing status --- .../ru/ulstu/extractor/branch/model/Branch.java | 15 +++++++++++++++ .../extractor/branch/model/IndexingStatus.java | 5 +++++ .../db/changelog-20221012_170000-schema.xml | 8 ++++++++ 3 files changed, 28 insertions(+) create mode 100644 src/main/java/ru/ulstu/extractor/branch/model/IndexingStatus.java diff --git a/src/main/java/ru/ulstu/extractor/branch/model/Branch.java b/src/main/java/ru/ulstu/extractor/branch/model/Branch.java index 046b8c4..97c03df 100644 --- a/src/main/java/ru/ulstu/extractor/branch/model/Branch.java +++ b/src/main/java/ru/ulstu/extractor/branch/model/Branch.java @@ -13,6 +13,8 @@ import ru.ulstu.extractor.gitrepository.model.GitRepository; import javax.persistence.CascadeType; import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; @@ -20,6 +22,8 @@ import javax.persistence.OneToMany; import java.util.ArrayList; import java.util.List; +import static ru.ulstu.extractor.branch.model.IndexingStatus.EMPTY; + @Entity public class Branch extends BaseEntity { private String name; @@ -32,6 +36,9 @@ public class Branch extends BaseEntity { @Fetch(FetchMode.SUBSELECT) private List commits = new ArrayList<>(); + @Enumerated(EnumType.STRING) + private IndexingStatus indexingStatus = EMPTY; + public Branch() { } @@ -67,4 +74,12 @@ public class Branch extends BaseEntity { public void setCommits(List commits) { this.commits = commits; } + + public IndexingStatus getIndexingStatus() { + return indexingStatus; + } + + public void setIndexingStatus(IndexingStatus indexingStatus) { + this.indexingStatus = indexingStatus; + } } diff --git a/src/main/java/ru/ulstu/extractor/branch/model/IndexingStatus.java b/src/main/java/ru/ulstu/extractor/branch/model/IndexingStatus.java new file mode 100644 index 0000000..3683817 --- /dev/null +++ b/src/main/java/ru/ulstu/extractor/branch/model/IndexingStatus.java @@ -0,0 +1,5 @@ +package ru.ulstu.extractor.branch.model; + +public enum IndexingStatus { + EMPTY, INDEXING, FINISHED +} diff --git a/src/main/resources/db/changelog-20221012_170000-schema.xml b/src/main/resources/db/changelog-20221012_170000-schema.xml index 3e4dc33..6ee4e83 100644 --- a/src/main/resources/db/changelog-20221012_170000-schema.xml +++ b/src/main/resources/db/changelog-20221012_170000-schema.xml @@ -99,4 +99,12 @@ OR branch_id is null; + + + + + + + + \ No newline at end of file