From 8930e56d5517b6f6a1ff52287274375222b52207 Mon Sep 17 00:00:00 2001 From: Denis Halitsky Date: Sat, 28 Sep 2024 12:28:52 +0300 Subject: [PATCH] updated versions --- model/lineage-domain.plantuml | 92 +++++++++++++++++++ .../com/koldyr/genealogy/model/EventPrefix.kt | 2 +- .../com/koldyr/genealogy/model/EventType.kt | 4 +- .../com/koldyr/genealogy/model/Person.kt | 3 +- model/src/main/resources/sql/schema.sql | 4 + pom.xml | 14 +-- webapp/pom.xml | 4 +- 7 files changed, 109 insertions(+), 14 deletions(-) create mode 100644 model/lineage-domain.plantuml diff --git a/model/lineage-domain.plantuml b/model/lineage-domain.plantuml new file mode 100644 index 0000000..bb61c25 --- /dev/null +++ b/model/lineage-domain.plantuml @@ -0,0 +1,92 @@ +@startuml + +'top to bottom direction +'skinparam linetype ortho +hide methods + +class Lineage { + id: Long + name: String + families: List + note: String +} + +class Family { + id: Long + wife: Person + husband: Person + children: List + events: List + note: String +} + +class Person { + id: Long + gender: Gender + occupation: String + place: String + photo: byte[] + events: List + note: String +} +class PersonNames { + first: String + last: String + maiden: String + middle: String +} + +class LifeEvent { + id: Long + date: LocalDate + place: String + prefix: EventPrefix + type: EventType + note: String +} +class FamilyEvent +class PersonEvent + +enum EventType { + Birth + Death + Engagement + Marriage + Divorce + Adoption + Christening + Relocation + Education + Emigration + GetJob + Graduation + Retirement + Immigration +} + +class User { + id: Long + email: String + name: String + password: String + surName: String + roles: List +} +class Role { + id: Integer + name: String +} + +Lineage::families "0..1" ---> "0..*" Family +Lineage "0..*" --> "0..1" User +Family::events "1" <---> "0..*" FamilyEvent +Family "0..1" --> "0..*" Person +Family "0..*" --> "0..1" User +FamilyEvent --^ LifeEvent +Person "0..*" --> "0..1" User +PersonNames -* Person +PersonEvent --^ LifeEvent +Person::events "1" <--> "0..*" PersonEvent +Role "0..*" -> "1" User::roles +LifeEvent::type -> EventType +@enduml diff --git a/model/src/main/kotlin/com/koldyr/genealogy/model/EventPrefix.kt b/model/src/main/kotlin/com/koldyr/genealogy/model/EventPrefix.kt index 4975cde..a5519ea 100644 --- a/model/src/main/kotlin/com/koldyr/genealogy/model/EventPrefix.kt +++ b/model/src/main/kotlin/com/koldyr/genealogy/model/EventPrefix.kt @@ -14,7 +14,7 @@ enum class EventPrefix( companion object { fun parse(value: String?): EventPrefix? { if (value == null) return null - for (prefix in values()) { + for (prefix in entries) { if (value.contains(prefix.code)) { return prefix } diff --git a/model/src/main/kotlin/com/koldyr/genealogy/model/EventType.kt b/model/src/main/kotlin/com/koldyr/genealogy/model/EventType.kt index 812e46f..7fe50ec 100644 --- a/model/src/main/kotlin/com/koldyr/genealogy/model/EventType.kt +++ b/model/src/main/kotlin/com/koldyr/genealogy/model/EventType.kt @@ -17,14 +17,14 @@ enum class EventType( companion object { fun isEvent(value: String): Boolean { - for (type in values()) { + for (type in entries) { if (value.endsWith(type.code) || (value.endsWith(type.name))) return true } return false } fun parse(value: String): EventType { - for (type in values()) { + for (type in entries) { if (value.endsWith(type.code) || (value.endsWith(type.name))) return type } return Birth diff --git a/model/src/main/kotlin/com/koldyr/genealogy/model/Person.kt b/model/src/main/kotlin/com/koldyr/genealogy/model/Person.kt index 1823825..230eed5 100644 --- a/model/src/main/kotlin/com/koldyr/genealogy/model/Person.kt +++ b/model/src/main/kotlin/com/koldyr/genealogy/model/Person.kt @@ -83,8 +83,7 @@ class Person() : Cloneable { @ManyToOne @JoinColumn(name = "USER_ID", nullable = false) @JsonIgnore var user: User? = null - @Column(name = "LINEAGE_ID") - @JsonIgnore + @Column(name = "LINEAGE_ID") @JsonIgnore var lineageId: Long? = null constructor(id: Long) : this() { diff --git a/model/src/main/resources/sql/schema.sql b/model/src/main/resources/sql/schema.sql index 89ca181..616e642 100644 --- a/model/src/main/resources/sql/schema.sql +++ b/model/src/main/resources/sql/schema.sql @@ -108,6 +108,8 @@ create sequence SEQ_USER start with 1; alter table T_LINEAGE add constraint FK_LINEAGE_USER FOREIGN KEY (USER_ID) REFERENCES T_USER (USER_ID); +alter table T_PERSON + add constraint FK_PERSON_LINEAGE FOREIGN KEY (LINEAGE_ID) REFERENCES T_LINEAGE (LINEAGE_ID); alter table T_PERSON add constraint FK_PERSON_PARENT_FAMILY FOREIGN KEY (PARENT_FAMILY_ID) REFERENCES T_FAMILY (FAMILY_ID); alter table T_PERSON @@ -115,6 +117,8 @@ alter table T_PERSON alter table T_PERSON add constraint FK_PERSON_USER FOREIGN KEY (USER_ID) REFERENCES T_USER (USER_ID); +alter table T_FAMILY + add constraint FK_FAMILY_LINEAGE FOREIGN KEY (LINEAGE_ID) REFERENCES T_LINEAGE (LINEAGE_ID); alter table T_FAMILY add constraint FK_FAMILY_HUSBAND FOREIGN KEY (HUSBAND_ID) REFERENCES T_PERSON (PERSON_ID); alter table T_FAMILY diff --git a/pom.xml b/pom.xml index 9e229ba..dbbd9bf 100644 --- a/pom.xml +++ b/pom.xml @@ -17,12 +17,12 @@ 21 2.0.0 - 3.3.0 - 6.1.8 - 6.3.0 - 2.17.1 + 3.3.4 + 6.1.13 + 6.3.3 + 2.18.0 4.1.0 - 2.3.0 + 2.6.0 @@ -73,13 +73,13 @@ org.slf4j slf4j-api - 2.0.12 + 2.0.16 org.junit.jupiter junit-jupiter-engine - 5.10.2 + 5.11.1 test diff --git a/webapp/pom.xml b/webapp/pom.xml index 863f5dd..5d376b8 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -59,7 +59,7 @@ jakarta.servlet jakarta.servlet-api - 6.0.0 + 6.1.0 @@ -94,7 +94,7 @@ org.junit.vintage junit-vintage-engine - 5.10.2 + 5.11.1 test