From 5ca0b3f7fa7c863a87c63a2be552fc5ce62fb80b Mon Sep 17 00:00:00 2001 From: Jottyfan Date: Fri, 17 Nov 2023 21:28:52 +0100 Subject: [PATCH] extended calendar view --- build.gradle | 16 +- .../de/jottyfan/bico/db/tables/VCalendar.java | 38 ++- .../bico/db/tables/pojos/TLesson.java | 47 ++++ .../bico/db/tables/pojos/TLessonSubject.java | 40 +++ .../bico/db/tables/pojos/TPerson.java | 47 ++++ .../bico/db/tables/pojos/TProfile.java | 40 +++ .../jottyfan/bico/db/tables/pojos/TSlot.java | 40 +++ .../bico/db/tables/pojos/TSource.java | 33 +++ .../bico/db/tables/pojos/TSubject.java | 82 ++++++ .../bico/db/tables/pojos/VCalendar.java | 219 ++++++++++++++- .../bico/db/tables/pojos/VLesson.java | 54 ++++ .../bico/db/tables/pojos/VLessonMissing.java | 47 ++++ .../bico/db/tables/pojos/VVersion.java | 26 ++ .../db/tables/records/VCalendarRecord.java | 254 +++++++++++++++++- src/main/resources/v3.sql | 30 +++ 15 files changed, 990 insertions(+), 23 deletions(-) create mode 100644 src/main/resources/v3.sql diff --git a/build.gradle b/build.gradle index 4d9d16a..291aee9 100644 --- a/build.gradle +++ b/build.gradle @@ -7,10 +7,10 @@ buildscript { jcenter() } dependencies { - classpath 'org.jooq:jooq-codegen:3.16.4' - classpath 'org.postgresql:postgresql:42.3.2' + classpath 'org.jooq:jooq-codegen:latest.release' + classpath 'org.postgresql:postgresql:latest.release' classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:latest.release' - classpath 'nu.studer.jooq:nu.studer.jooq.gradle.plugin:7.1.1' + classpath 'nu.studer.jooq:nu.studer.jooq.gradle.plugin:latest.release' } } @@ -22,7 +22,7 @@ apply plugin: 'java' apply plugin: 'maven-publish' group = 'de.jottyfan' -version = '2' +version = '3' description = """bicolib""" @@ -36,12 +36,12 @@ repositories { } dependencies { - implementation 'org.jooq:jooq:3.16.4' - implementation 'org.jooq:jooq-codegen:3.16.4' + implementation 'org.jooq:jooq:latest.release' + implementation 'org.jooq:jooq-codegen:latest.release' - implementation 'org.postgresql:postgresql:42.3.2' + implementation 'org.postgresql:postgresql:latest.release' - jooqGenerator 'org.postgresql:postgresql:42.3.2' + jooqGenerator 'org.postgresql:postgresql:latest.release' } import org.jooq.meta.jaxb.Logging diff --git a/src/main/java/de/jottyfan/bico/db/tables/VCalendar.java b/src/main/java/de/jottyfan/bico/db/tables/VCalendar.java index f3a8b1f..06acad4 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/VCalendar.java +++ b/src/main/java/de/jottyfan/bico/db/tables/VCalendar.java @@ -13,7 +13,7 @@ import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row12; +import org.jooq.Row18; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -104,6 +104,36 @@ public class VCalendar extends TableImpl { */ public final TableField SLOT_NOTES = createField(DSL.name("slot_notes"), SQLDataType.CLOB, this, ""); + /** + * The column public.v_calendar.pk_slot. + */ + public final TableField PK_SLOT = createField(DSL.name("pk_slot"), SQLDataType.INTEGER, this, ""); + + /** + * The column public.v_calendar.pk_lesson. + */ + public final TableField PK_LESSON = createField(DSL.name("pk_lesson"), SQLDataType.INTEGER, this, ""); + + /** + * The column public.v_calendar.pk_lesson_subject. + */ + public final TableField PK_LESSON_SUBJECT = createField(DSL.name("pk_lesson_subject"), SQLDataType.INTEGER, this, ""); + + /** + * The column public.v_calendar.pk_person. + */ + public final TableField PK_PERSON = createField(DSL.name("pk_person"), SQLDataType.INTEGER, this, ""); + + /** + * The column public.v_calendar.pk_subject. + */ + public final TableField PK_SUBJECT = createField(DSL.name("pk_subject"), SQLDataType.INTEGER, this, ""); + + /** + * The column public.v_calendar.pk_source. + */ + public final TableField PK_SOURCE = createField(DSL.name("pk_source"), SQLDataType.INTEGER, this, ""); + private VCalendar(Name alias, Table aliased) { this(alias, aliased, null); } @@ -169,11 +199,11 @@ public class VCalendar extends TableImpl { } // ------------------------------------------------------------------------- - // Row12 type methods + // Row18 type methods // ------------------------------------------------------------------------- @Override - public Row12 fieldsRow() { - return (Row12) super.fieldsRow(); + public Row18 fieldsRow() { + return (Row18) super.fieldsRow(); } } diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/TLesson.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/TLesson.java index 8c49d6d..ad15161 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/TLesson.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/TLesson.java @@ -67,6 +67,53 @@ public class TLesson implements Serializable { return this.notes; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TLesson other = (TLesson) obj; + if (pkLesson == null) { + if (other.pkLesson != null) + return false; + } + else if (!pkLesson.equals(other.pkLesson)) + return false; + if (fkSlot == null) { + if (other.fkSlot != null) + return false; + } + else if (!fkSlot.equals(other.fkSlot)) + return false; + if (fkPerson == null) { + if (other.fkPerson != null) + return false; + } + else if (!fkPerson.equals(other.fkPerson)) + return false; + if (notes == null) { + if (other.notes != null) + return false; + } + else if (!notes.equals(other.notes)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.pkLesson == null) ? 0 : this.pkLesson.hashCode()); + result = prime * result + ((this.fkSlot == null) ? 0 : this.fkSlot.hashCode()); + result = prime * result + ((this.fkPerson == null) ? 0 : this.fkPerson.hashCode()); + result = prime * result + ((this.notes == null) ? 0 : this.notes.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("TLesson ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/TLessonSubject.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/TLessonSubject.java index e5c0418..928a352 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/TLessonSubject.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/TLessonSubject.java @@ -56,6 +56,46 @@ public class TLessonSubject implements Serializable { return this.fkSubject; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TLessonSubject other = (TLessonSubject) obj; + if (pkLessonSubject == null) { + if (other.pkLessonSubject != null) + return false; + } + else if (!pkLessonSubject.equals(other.pkLessonSubject)) + return false; + if (fkLesson == null) { + if (other.fkLesson != null) + return false; + } + else if (!fkLesson.equals(other.fkLesson)) + return false; + if (fkSubject == null) { + if (other.fkSubject != null) + return false; + } + else if (!fkSubject.equals(other.fkSubject)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.pkLessonSubject == null) ? 0 : this.pkLessonSubject.hashCode()); + result = prime * result + ((this.fkLesson == null) ? 0 : this.fkLesson.hashCode()); + result = prime * result + ((this.fkSubject == null) ? 0 : this.fkSubject.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("TLessonSubject ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/TPerson.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/TPerson.java index 78f74b0..db6acdc 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/TPerson.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/TPerson.java @@ -67,6 +67,53 @@ public class TPerson implements Serializable { return this.abbreviation; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TPerson other = (TPerson) obj; + if (pkPerson == null) { + if (other.pkPerson != null) + return false; + } + else if (!pkPerson.equals(other.pkPerson)) + return false; + if (forename == null) { + if (other.forename != null) + return false; + } + else if (!forename.equals(other.forename)) + return false; + if (surname == null) { + if (other.surname != null) + return false; + } + else if (!surname.equals(other.surname)) + return false; + if (abbreviation == null) { + if (other.abbreviation != null) + return false; + } + else if (!abbreviation.equals(other.abbreviation)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.pkPerson == null) ? 0 : this.pkPerson.hashCode()); + result = prime * result + ((this.forename == null) ? 0 : this.forename.hashCode()); + result = prime * result + ((this.surname == null) ? 0 : this.surname.hashCode()); + result = prime * result + ((this.abbreviation == null) ? 0 : this.abbreviation.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("TPerson ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/TProfile.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/TProfile.java index fda53b2..62fa67d 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/TProfile.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/TProfile.java @@ -56,6 +56,46 @@ public class TProfile implements Serializable { return this.theme; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TProfile other = (TProfile) obj; + if (id == null) { + if (other.id != null) + return false; + } + else if (!id.equals(other.id)) + return false; + if (username == null) { + if (other.username != null) + return false; + } + else if (!username.equals(other.username)) + return false; + if (theme == null) { + if (other.theme != null) + return false; + } + else if (!theme.equals(other.theme)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.id == null) ? 0 : this.id.hashCode()); + result = prime * result + ((this.username == null) ? 0 : this.username.hashCode()); + result = prime * result + ((this.theme == null) ? 0 : this.theme.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("TProfile ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/TSlot.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/TSlot.java index a0bae64..3797ad7 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/TSlot.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/TSlot.java @@ -57,6 +57,46 @@ public class TSlot implements Serializable { return this.note; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TSlot other = (TSlot) obj; + if (pkSlot == null) { + if (other.pkSlot != null) + return false; + } + else if (!pkSlot.equals(other.pkSlot)) + return false; + if (slotDay == null) { + if (other.slotDay != null) + return false; + } + else if (!slotDay.equals(other.slotDay)) + return false; + if (note == null) { + if (other.note != null) + return false; + } + else if (!note.equals(other.note)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.pkSlot == null) ? 0 : this.pkSlot.hashCode()); + result = prime * result + ((this.slotDay == null) ? 0 : this.slotDay.hashCode()); + result = prime * result + ((this.note == null) ? 0 : this.note.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("TSlot ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/TSource.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/TSource.java index c3be220..8ba21e4 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/TSource.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/TSource.java @@ -45,6 +45,39 @@ public class TSource implements Serializable { return this.name; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TSource other = (TSource) obj; + if (pkSource == null) { + if (other.pkSource != null) + return false; + } + else if (!pkSource.equals(other.pkSource)) + return false; + if (name == null) { + if (other.name != null) + return false; + } + else if (!name.equals(other.name)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.pkSource == null) ? 0 : this.pkSource.hashCode()); + result = prime * result + ((this.name == null) ? 0 : this.name.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("TSource ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/TSubject.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/TSubject.java index d62e527..fec6763 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/TSubject.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/TSubject.java @@ -122,6 +122,88 @@ public class TSubject implements Serializable { return this.orderNr; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final TSubject other = (TSubject) obj; + if (pkSubject == null) { + if (other.pkSubject != null) + return false; + } + else if (!pkSubject.equals(other.pkSubject)) + return false; + if (fkSource == null) { + if (other.fkSource != null) + return false; + } + else if (!fkSource.equals(other.fkSource)) + return false; + if (theme == null) { + if (other.theme != null) + return false; + } + else if (!theme.equals(other.theme)) + return false; + if (subtheme == null) { + if (other.subtheme != null) + return false; + } + else if (!subtheme.equals(other.subtheme)) + return false; + if (bookPages == null) { + if (other.bookPages != null) + return false; + } + else if (!bookPages.equals(other.bookPages)) + return false; + if (worksheets == null) { + if (other.worksheets != null) + return false; + } + else if (!worksheets.equals(other.worksheets)) + return false; + if (bibleverse == null) { + if (other.bibleverse != null) + return false; + } + else if (!bibleverse.equals(other.bibleverse)) + return false; + if (notes == null) { + if (other.notes != null) + return false; + } + else if (!notes.equals(other.notes)) + return false; + if (orderNr == null) { + if (other.orderNr != null) + return false; + } + else if (!orderNr.equals(other.orderNr)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.pkSubject == null) ? 0 : this.pkSubject.hashCode()); + result = prime * result + ((this.fkSource == null) ? 0 : this.fkSource.hashCode()); + result = prime * result + ((this.theme == null) ? 0 : this.theme.hashCode()); + result = prime * result + ((this.subtheme == null) ? 0 : this.subtheme.hashCode()); + result = prime * result + ((this.bookPages == null) ? 0 : this.bookPages.hashCode()); + result = prime * result + ((this.worksheets == null) ? 0 : this.worksheets.hashCode()); + result = prime * result + ((this.bibleverse == null) ? 0 : this.bibleverse.hashCode()); + result = prime * result + ((this.notes == null) ? 0 : this.notes.hashCode()); + result = prime * result + ((this.orderNr == null) ? 0 : this.orderNr.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("TSubject ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/VCalendar.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/VCalendar.java index 7b25357..66e4c37 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/VCalendar.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/VCalendar.java @@ -28,6 +28,12 @@ public class VCalendar implements Serializable { private final String subjectNotes; private final String lessonNotes; private final String slotNotes; + private final Integer pkSlot; + private final Integer pkLesson; + private final Integer pkLessonSubject; + private final Integer pkPerson; + private final Integer pkSubject; + private final Integer pkSource; public VCalendar(VCalendar value) { this.slotDay = value.slotDay; @@ -42,6 +48,12 @@ public class VCalendar implements Serializable { this.subjectNotes = value.subjectNotes; this.lessonNotes = value.lessonNotes; this.slotNotes = value.slotNotes; + this.pkSlot = value.pkSlot; + this.pkLesson = value.pkLesson; + this.pkLessonSubject = value.pkLessonSubject; + this.pkPerson = value.pkPerson; + this.pkSubject = value.pkSubject; + this.pkSource = value.pkSource; } public VCalendar( @@ -56,7 +68,13 @@ public class VCalendar implements Serializable { String bibleverse, String subjectNotes, String lessonNotes, - String slotNotes + String slotNotes, + Integer pkSlot, + Integer pkLesson, + Integer pkLessonSubject, + Integer pkPerson, + Integer pkSubject, + Integer pkSource ) { this.slotDay = slotDay; this.fullname = fullname; @@ -70,6 +88,12 @@ public class VCalendar implements Serializable { this.subjectNotes = subjectNotes; this.lessonNotes = lessonNotes; this.slotNotes = slotNotes; + this.pkSlot = pkSlot; + this.pkLesson = pkLesson; + this.pkLessonSubject = pkLessonSubject; + this.pkPerson = pkPerson; + this.pkSubject = pkSubject; + this.pkSource = pkSource; } /** @@ -156,6 +180,193 @@ public class VCalendar implements Serializable { return this.slotNotes; } + /** + * Getter for public.v_calendar.pk_slot. + */ + public Integer getPkSlot() { + return this.pkSlot; + } + + /** + * Getter for public.v_calendar.pk_lesson. + */ + public Integer getPkLesson() { + return this.pkLesson; + } + + /** + * Getter for public.v_calendar.pk_lesson_subject. + */ + public Integer getPkLessonSubject() { + return this.pkLessonSubject; + } + + /** + * Getter for public.v_calendar.pk_person. + */ + public Integer getPkPerson() { + return this.pkPerson; + } + + /** + * Getter for public.v_calendar.pk_subject. + */ + public Integer getPkSubject() { + return this.pkSubject; + } + + /** + * Getter for public.v_calendar.pk_source. + */ + public Integer getPkSource() { + return this.pkSource; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final VCalendar other = (VCalendar) obj; + if (slotDay == null) { + if (other.slotDay != null) + return false; + } + else if (!slotDay.equals(other.slotDay)) + return false; + if (fullname == null) { + if (other.fullname != null) + return false; + } + else if (!fullname.equals(other.fullname)) + return false; + if (abbreviation == null) { + if (other.abbreviation != null) + return false; + } + else if (!abbreviation.equals(other.abbreviation)) + return false; + if (sourceName == null) { + if (other.sourceName != null) + return false; + } + else if (!sourceName.equals(other.sourceName)) + return false; + if (theme == null) { + if (other.theme != null) + return false; + } + else if (!theme.equals(other.theme)) + return false; + if (subtheme == null) { + if (other.subtheme != null) + return false; + } + else if (!subtheme.equals(other.subtheme)) + return false; + if (bookPages == null) { + if (other.bookPages != null) + return false; + } + else if (!bookPages.equals(other.bookPages)) + return false; + if (worksheets == null) { + if (other.worksheets != null) + return false; + } + else if (!worksheets.equals(other.worksheets)) + return false; + if (bibleverse == null) { + if (other.bibleverse != null) + return false; + } + else if (!bibleverse.equals(other.bibleverse)) + return false; + if (subjectNotes == null) { + if (other.subjectNotes != null) + return false; + } + else if (!subjectNotes.equals(other.subjectNotes)) + return false; + if (lessonNotes == null) { + if (other.lessonNotes != null) + return false; + } + else if (!lessonNotes.equals(other.lessonNotes)) + return false; + if (slotNotes == null) { + if (other.slotNotes != null) + return false; + } + else if (!slotNotes.equals(other.slotNotes)) + return false; + if (pkSlot == null) { + if (other.pkSlot != null) + return false; + } + else if (!pkSlot.equals(other.pkSlot)) + return false; + if (pkLesson == null) { + if (other.pkLesson != null) + return false; + } + else if (!pkLesson.equals(other.pkLesson)) + return false; + if (pkLessonSubject == null) { + if (other.pkLessonSubject != null) + return false; + } + else if (!pkLessonSubject.equals(other.pkLessonSubject)) + return false; + if (pkPerson == null) { + if (other.pkPerson != null) + return false; + } + else if (!pkPerson.equals(other.pkPerson)) + return false; + if (pkSubject == null) { + if (other.pkSubject != null) + return false; + } + else if (!pkSubject.equals(other.pkSubject)) + return false; + if (pkSource == null) { + if (other.pkSource != null) + return false; + } + else if (!pkSource.equals(other.pkSource)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.slotDay == null) ? 0 : this.slotDay.hashCode()); + result = prime * result + ((this.fullname == null) ? 0 : this.fullname.hashCode()); + result = prime * result + ((this.abbreviation == null) ? 0 : this.abbreviation.hashCode()); + result = prime * result + ((this.sourceName == null) ? 0 : this.sourceName.hashCode()); + result = prime * result + ((this.theme == null) ? 0 : this.theme.hashCode()); + result = prime * result + ((this.subtheme == null) ? 0 : this.subtheme.hashCode()); + result = prime * result + ((this.bookPages == null) ? 0 : this.bookPages.hashCode()); + result = prime * result + ((this.worksheets == null) ? 0 : this.worksheets.hashCode()); + result = prime * result + ((this.bibleverse == null) ? 0 : this.bibleverse.hashCode()); + result = prime * result + ((this.subjectNotes == null) ? 0 : this.subjectNotes.hashCode()); + result = prime * result + ((this.lessonNotes == null) ? 0 : this.lessonNotes.hashCode()); + result = prime * result + ((this.slotNotes == null) ? 0 : this.slotNotes.hashCode()); + result = prime * result + ((this.pkSlot == null) ? 0 : this.pkSlot.hashCode()); + result = prime * result + ((this.pkLesson == null) ? 0 : this.pkLesson.hashCode()); + result = prime * result + ((this.pkLessonSubject == null) ? 0 : this.pkLessonSubject.hashCode()); + result = prime * result + ((this.pkPerson == null) ? 0 : this.pkPerson.hashCode()); + result = prime * result + ((this.pkSubject == null) ? 0 : this.pkSubject.hashCode()); + result = prime * result + ((this.pkSource == null) ? 0 : this.pkSource.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("VCalendar ("); @@ -172,6 +383,12 @@ public class VCalendar implements Serializable { sb.append(", ").append(subjectNotes); sb.append(", ").append(lessonNotes); sb.append(", ").append(slotNotes); + sb.append(", ").append(pkSlot); + sb.append(", ").append(pkLesson); + sb.append(", ").append(pkLessonSubject); + sb.append(", ").append(pkPerson); + sb.append(", ").append(pkSubject); + sb.append(", ").append(pkSource); sb.append(")"); return sb.toString(); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/VLesson.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/VLesson.java index c98cb7f..1dfcfd7 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/VLesson.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/VLesson.java @@ -80,6 +80,60 @@ public class VLesson implements Serializable { return this.orderNr; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final VLesson other = (VLesson) obj; + if (sourceName == null) { + if (other.sourceName != null) + return false; + } + else if (!sourceName.equals(other.sourceName)) + return false; + if (theme == null) { + if (other.theme != null) + return false; + } + else if (!theme.equals(other.theme)) + return false; + if (subtheme == null) { + if (other.subtheme != null) + return false; + } + else if (!subtheme.equals(other.subtheme)) + return false; + if (slots == null) { + if (other.slots != null) + return false; + } + else if (!Arrays.equals(slots, other.slots)) + return false; + if (orderNr == null) { + if (other.orderNr != null) + return false; + } + else if (!orderNr.equals(other.orderNr)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.sourceName == null) ? 0 : this.sourceName.hashCode()); + result = prime * result + ((this.theme == null) ? 0 : this.theme.hashCode()); + result = prime * result + ((this.subtheme == null) ? 0 : this.subtheme.hashCode()); + result = prime * result + ((this.slots == null) ? 0 : Arrays.hashCode(this.slots)); + result = prime * result + ((this.orderNr == null) ? 0 : this.orderNr.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("VLesson ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/VLessonMissing.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/VLessonMissing.java index 73b3f16..8f93462 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/VLessonMissing.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/VLessonMissing.java @@ -67,6 +67,53 @@ public class VLessonMissing implements Serializable { return this.orderNr; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final VLessonMissing other = (VLessonMissing) obj; + if (sourceName == null) { + if (other.sourceName != null) + return false; + } + else if (!sourceName.equals(other.sourceName)) + return false; + if (theme == null) { + if (other.theme != null) + return false; + } + else if (!theme.equals(other.theme)) + return false; + if (subtheme == null) { + if (other.subtheme != null) + return false; + } + else if (!subtheme.equals(other.subtheme)) + return false; + if (orderNr == null) { + if (other.orderNr != null) + return false; + } + else if (!orderNr.equals(other.orderNr)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.sourceName == null) ? 0 : this.sourceName.hashCode()); + result = prime * result + ((this.theme == null) ? 0 : this.theme.hashCode()); + result = prime * result + ((this.subtheme == null) ? 0 : this.subtheme.hashCode()); + result = prime * result + ((this.orderNr == null) ? 0 : this.orderNr.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("VLessonMissing ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/pojos/VVersion.java b/src/main/java/de/jottyfan/bico/db/tables/pojos/VVersion.java index 4416198..ed2cd5a 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/pojos/VVersion.java +++ b/src/main/java/de/jottyfan/bico/db/tables/pojos/VVersion.java @@ -34,6 +34,32 @@ public class VVersion implements Serializable { return this.version; } + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + final VVersion other = (VVersion) obj; + if (version == null) { + if (other.version != null) + return false; + } + else if (!version.equals(other.version)) + return false; + return true; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((this.version == null) ? 0 : this.version.hashCode()); + return result; + } + @Override public String toString() { StringBuilder sb = new StringBuilder("VVersion ("); diff --git a/src/main/java/de/jottyfan/bico/db/tables/records/VCalendarRecord.java b/src/main/java/de/jottyfan/bico/db/tables/records/VCalendarRecord.java index 6d197c1..6a0534d 100644 --- a/src/main/java/de/jottyfan/bico/db/tables/records/VCalendarRecord.java +++ b/src/main/java/de/jottyfan/bico/db/tables/records/VCalendarRecord.java @@ -9,8 +9,8 @@ import de.jottyfan.bico.db.tables.VCalendar; import java.time.LocalDate; import org.jooq.Field; -import org.jooq.Record12; -import org.jooq.Row12; +import org.jooq.Record18; +import org.jooq.Row18; import org.jooq.impl.TableRecordImpl; @@ -18,7 +18,7 @@ import org.jooq.impl.TableRecordImpl; * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class VCalendarRecord extends TableRecordImpl implements Record12 { +public class VCalendarRecord extends TableRecordImpl implements Record18 { private static final long serialVersionUID = 1L; @@ -202,18 +202,108 @@ public class VCalendarRecord extends TableRecordImpl implements return (String) get(11); } + /** + * Setter for public.v_calendar.pk_slot. + */ + public VCalendarRecord setPkSlot(Integer value) { + set(12, value); + return this; + } + + /** + * Getter for public.v_calendar.pk_slot. + */ + public Integer getPkSlot() { + return (Integer) get(12); + } + + /** + * Setter for public.v_calendar.pk_lesson. + */ + public VCalendarRecord setPkLesson(Integer value) { + set(13, value); + return this; + } + + /** + * Getter for public.v_calendar.pk_lesson. + */ + public Integer getPkLesson() { + return (Integer) get(13); + } + + /** + * Setter for public.v_calendar.pk_lesson_subject. + */ + public VCalendarRecord setPkLessonSubject(Integer value) { + set(14, value); + return this; + } + + /** + * Getter for public.v_calendar.pk_lesson_subject. + */ + public Integer getPkLessonSubject() { + return (Integer) get(14); + } + + /** + * Setter for public.v_calendar.pk_person. + */ + public VCalendarRecord setPkPerson(Integer value) { + set(15, value); + return this; + } + + /** + * Getter for public.v_calendar.pk_person. + */ + public Integer getPkPerson() { + return (Integer) get(15); + } + + /** + * Setter for public.v_calendar.pk_subject. + */ + public VCalendarRecord setPkSubject(Integer value) { + set(16, value); + return this; + } + + /** + * Getter for public.v_calendar.pk_subject. + */ + public Integer getPkSubject() { + return (Integer) get(16); + } + + /** + * Setter for public.v_calendar.pk_source. + */ + public VCalendarRecord setPkSource(Integer value) { + set(17, value); + return this; + } + + /** + * Getter for public.v_calendar.pk_source. + */ + public Integer getPkSource() { + return (Integer) get(17); + } + // ------------------------------------------------------------------------- - // Record12 type implementation + // Record18 type implementation // ------------------------------------------------------------------------- @Override - public Row12 fieldsRow() { - return (Row12) super.fieldsRow(); + public Row18 fieldsRow() { + return (Row18) super.fieldsRow(); } @Override - public Row12 valuesRow() { - return (Row12) super.valuesRow(); + public Row18 valuesRow() { + return (Row18) super.valuesRow(); } @Override @@ -276,6 +366,36 @@ public class VCalendarRecord extends TableRecordImpl implements return VCalendar.V_CALENDAR.SLOT_NOTES; } + @Override + public Field field13() { + return VCalendar.V_CALENDAR.PK_SLOT; + } + + @Override + public Field field14() { + return VCalendar.V_CALENDAR.PK_LESSON; + } + + @Override + public Field field15() { + return VCalendar.V_CALENDAR.PK_LESSON_SUBJECT; + } + + @Override + public Field field16() { + return VCalendar.V_CALENDAR.PK_PERSON; + } + + @Override + public Field field17() { + return VCalendar.V_CALENDAR.PK_SUBJECT; + } + + @Override + public Field field18() { + return VCalendar.V_CALENDAR.PK_SOURCE; + } + @Override public LocalDate component1() { return getSlotDay(); @@ -336,6 +456,36 @@ public class VCalendarRecord extends TableRecordImpl implements return getSlotNotes(); } + @Override + public Integer component13() { + return getPkSlot(); + } + + @Override + public Integer component14() { + return getPkLesson(); + } + + @Override + public Integer component15() { + return getPkLessonSubject(); + } + + @Override + public Integer component16() { + return getPkPerson(); + } + + @Override + public Integer component17() { + return getPkSubject(); + } + + @Override + public Integer component18() { + return getPkSource(); + } + @Override public LocalDate value1() { return getSlotDay(); @@ -396,6 +546,36 @@ public class VCalendarRecord extends TableRecordImpl implements return getSlotNotes(); } + @Override + public Integer value13() { + return getPkSlot(); + } + + @Override + public Integer value14() { + return getPkLesson(); + } + + @Override + public Integer value15() { + return getPkLessonSubject(); + } + + @Override + public Integer value16() { + return getPkPerson(); + } + + @Override + public Integer value17() { + return getPkSubject(); + } + + @Override + public Integer value18() { + return getPkSource(); + } + @Override public VCalendarRecord value1(LocalDate value) { setSlotDay(value); @@ -469,7 +649,43 @@ public class VCalendarRecord extends TableRecordImpl implements } @Override - public VCalendarRecord values(LocalDate value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9, String value10, String value11, String value12) { + public VCalendarRecord value13(Integer value) { + setPkSlot(value); + return this; + } + + @Override + public VCalendarRecord value14(Integer value) { + setPkLesson(value); + return this; + } + + @Override + public VCalendarRecord value15(Integer value) { + setPkLessonSubject(value); + return this; + } + + @Override + public VCalendarRecord value16(Integer value) { + setPkPerson(value); + return this; + } + + @Override + public VCalendarRecord value17(Integer value) { + setPkSubject(value); + return this; + } + + @Override + public VCalendarRecord value18(Integer value) { + setPkSource(value); + return this; + } + + @Override + public VCalendarRecord values(LocalDate value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9, String value10, String value11, String value12, Integer value13, Integer value14, Integer value15, Integer value16, Integer value17, Integer value18) { value1(value1); value2(value2); value3(value3); @@ -482,6 +698,12 @@ public class VCalendarRecord extends TableRecordImpl implements value10(value10); value11(value11); value12(value12); + value13(value13); + value14(value14); + value15(value15); + value16(value16); + value17(value17); + value18(value18); return this; } @@ -499,7 +721,7 @@ public class VCalendarRecord extends TableRecordImpl implements /** * Create a detached, initialised VCalendarRecord */ - public VCalendarRecord(LocalDate slotDay, String fullname, String abbreviation, String sourceName, String theme, String subtheme, String bookPages, String worksheets, String bibleverse, String subjectNotes, String lessonNotes, String slotNotes) { + public VCalendarRecord(LocalDate slotDay, String fullname, String abbreviation, String sourceName, String theme, String subtheme, String bookPages, String worksheets, String bibleverse, String subjectNotes, String lessonNotes, String slotNotes, Integer pkSlot, Integer pkLesson, Integer pkLessonSubject, Integer pkPerson, Integer pkSubject, Integer pkSource) { super(VCalendar.V_CALENDAR); setSlotDay(slotDay); @@ -514,6 +736,12 @@ public class VCalendarRecord extends TableRecordImpl implements setSubjectNotes(subjectNotes); setLessonNotes(lessonNotes); setSlotNotes(slotNotes); + setPkSlot(pkSlot); + setPkLesson(pkLesson); + setPkLessonSubject(pkLessonSubject); + setPkPerson(pkPerson); + setPkSubject(pkSubject); + setPkSource(pkSource); } /** @@ -535,6 +763,12 @@ public class VCalendarRecord extends TableRecordImpl implements setSubjectNotes(value.getSubjectNotes()); setLessonNotes(value.getLessonNotes()); setSlotNotes(value.getSlotNotes()); + setPkSlot(value.getPkSlot()); + setPkLesson(value.getPkLesson()); + setPkLessonSubject(value.getPkLessonSubject()); + setPkPerson(value.getPkPerson()); + setPkSubject(value.getPkSubject()); + setPkSource(value.getPkSource()); } } } diff --git a/src/main/resources/v3.sql b/src/main/resources/v3.sql new file mode 100644 index 0000000..7d0a356 --- /dev/null +++ b/src/main/resources/v3.sql @@ -0,0 +1,30 @@ +drop view v_calendar; + +create view v_calendar as +SELECT d.slot_day, + p.forename || ' ' || p.surname AS fullname, + p.abbreviation, + o.name AS source_name, + s.theme, + s.subtheme, + s.book_pages, + s.worksheets, + s.bibleverse, + s.notes AS subject_notes, + l.notes AS lesson_notes, + d.note AS slot_notes, + d.pk_slot, + l.pk_lesson, + ls.pk_lesson_subject, + p.pk_person, + s.pk_subject, + o.pk_source +FROM public.t_slot d +LEFT JOIN public.t_lesson l ON l.fk_slot = d.pk_slot +LEFT JOIN public.t_lesson_subject ls ON ls.fk_lesson = l.pk_lesson +LEFT JOIN public.t_person p ON p.pk_person = l.fk_person +LEFT JOIN public.t_subject s ON s.pk_subject = ls.fk_subject +LEFT JOIN public.t_source o ON o.pk_source = s.fk_source; + +create or replace view v_version as +select 3 as version;