From 8c7e16e8d017230ea1a363069220944ec690548d Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 15:22:30 +0100 Subject: [PATCH 1/8] Upgrade Testcontainers --- gradle.properties | 2 +- .../com/kuvaszuptime/kuvasz/testutils/TestDbContainer.kt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index f4e7f73..9727c03 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ micronautPluginVersion=1.0.5 micronautVersion=2.1.2 mockkVersion=1.10.2 palantirGitVersion=0.12.3 -postgresTestContainersVersion=1.14.3 +postgresTestContainersVersion=1.15.0 postgresVersion=42.2.18 shadowVersion=6.1.0 simpleJavaMailVersion=6.4.3 diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/testutils/TestDbContainer.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/testutils/TestDbContainer.kt index ef2b560..f127587 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/testutils/TestDbContainer.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/testutils/TestDbContainer.kt @@ -2,7 +2,7 @@ package com.kuvaszuptime.kuvasz.testutils import org.testcontainers.containers.PostgreSQLContainer -class TestDbContainer : PostgreSQLContainer() { +class TestDbContainer : PostgreSQLContainer("postgres:12") { companion object { lateinit var instance: TestDbContainer @@ -10,7 +10,6 @@ class TestDbContainer : PostgreSQLContainer() { if (!Companion::instance.isInitialized) { instance = TestDbContainer() - instance.dockerImageName = "postgres:12" instance.start() System.setProperty("datasources.default.url", instance.jdbcUrl) From c8fa6a9a3115606f4ef241d39bcdd23a7fbd9f7a Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 15:22:54 +0100 Subject: [PATCH 2/8] Upgrade Gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bb105ce..9216860 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ #Sat Jul 18 09:10:10 CEST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists From 71c4a872176c1a82fcf9800f357f0bea1e417d0b Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 15:25:24 +0100 Subject: [PATCH 3/8] Upgrade jOOQ and fix transaction bug #50 --- build.gradle | 9 +- gradle.properties | 2 +- .../kuvaszuptime/kuvasz/DefaultCatalog.java | 2 +- .../kuvaszuptime/kuvasz/DefaultSchema.java | 2 +- .../java/com/kuvaszuptime/kuvasz/Indexes.java | 28 ++----- .../java/com/kuvaszuptime/kuvasz/Keys.java | 62 +++----------- .../com/kuvaszuptime/kuvasz/Sequences.java | 11 +-- .../java/com/kuvaszuptime/kuvasz/Tables.java | 2 +- .../kuvaszuptime/kuvasz/enums/SslStatus.java | 2 +- .../kuvasz/enums/UptimeStatus.java | 2 +- .../kuvasz/tables/LatencyLog.java | 35 ++++---- .../kuvaszuptime/kuvasz/tables/Monitor.java | 45 +++++----- .../kuvaszuptime/kuvasz/tables/SslEvent.java | 41 +++++----- .../kuvasz/tables/UptimeEvent.java | 41 +++++----- .../kuvasz/tables/pojos/LatencyLogPojo.java | 44 ++++++++-- .../kuvasz/tables/pojos/MonitorPojo.java | 71 ++++++++++++++-- .../kuvasz/tables/pojos/SslEventPojo.java | 68 ++++++++++++--- .../kuvasz/tables/pojos/UptimeEventPojo.java | 68 ++++++++++++--- .../tables/records/LatencyLogRecord.java | 28 ++++--- .../kuvasz/tables/records/MonitorRecord.java | 35 ++++---- .../kuvasz/tables/records/SslEventRecord.java | 40 +++++---- .../tables/records/UptimeEventRecord.java | 40 +++++---- .../kuvasz/handlers/DatabaseEventHandler.kt | 18 ++-- .../kuvasz/repositories/MonitorRepository.kt | 8 +- .../kuvasz/repositories/SSLEventRepository.kt | 15 ++-- .../repositories/UptimeEventRepository.kt | 15 ++-- .../com/kuvaszuptime/kuvasz/util/Jooq+.kt | 15 ++-- .../controllers/MonitorControllerTest.kt | 2 +- .../handlers/DatabaseEventHandlerTest.kt | 82 ++++++++++--------- .../handlers/PagerdutyEventHandlerTest.kt | 12 ++- .../kuvasz/handlers/SMTPEventHandlerTest.kt | 13 ++- .../kuvasz/handlers/SlackEventHandlerTest.kt | 12 ++- .../handlers/TelegramEventHandlerTest.kt | 12 ++- 33 files changed, 547 insertions(+), 335 deletions(-) diff --git a/build.gradle b/build.gradle index a7edc26..8d7b5f4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,11 @@ +buildscript { + configurations['classpath'].resolutionStrategy.eachDependency { + if (requested.group == 'org.jooq') { + useVersion jooqVersion + } + } +} + plugins { id "org.jetbrains.kotlin.jvm" version "${kotlinVersion}" id "org.jetbrains.kotlin.kapt" version "${kotlinVersion}" @@ -210,7 +218,6 @@ jooq { driver = "org.postgresql.Driver" } generator { - name = "org.jooq.codegen.DefaultGenerator" target { directory = "src/jooq/java" packageName = "com.kuvaszuptime.kuvasz" diff --git a/gradle.properties b/gradle.properties index 9727c03..e68984f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ checkUpdatesVersion=1.1.0 detektVersion=1.14.2 jibVersion=2.6.0 jooqPluginVersion=5.2 -jooqVersion=3.13.1 +jooqVersion=3.14.3 kotlinCoroutinesVersion=1.3.9 kotlinVersion=1.4.10 logbookVersion=2.3.0 diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java index e282655..76ba603 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java @@ -17,7 +17,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultCatalog extends CatalogImpl { - private static final long serialVersionUID = 1946704898; + private static final long serialVersionUID = 1L; /** * The reference instance of DEFAULT_CATALOG diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java index 585310f..3ef84a6 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java @@ -24,7 +24,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultSchema extends SchemaImpl { - private static final long serialVersionUID = -839450692; + private static final long serialVersionUID = 1L; /** * The reference instance of DEFAULT_SCHEMA diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java index ddc13fb..0452808 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java @@ -10,11 +10,12 @@ import org.jooq.Index; import org.jooq.OrderField; +import org.jooq.impl.DSL; import org.jooq.impl.Internal; /** - * A class modelling indexes of tables of the schema. + * A class modelling indexes of tables in the default schema. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Indexes { @@ -23,23 +24,10 @@ public class Indexes { // INDEX definitions // ------------------------------------------------------------------------- - public static final Index LATENCY_LOG_LATENCY_IDX = Indexes0.LATENCY_LOG_LATENCY_IDX; - public static final Index LATENCY_LOG_MONITOR_IDX = Indexes0.LATENCY_LOG_MONITOR_IDX; - public static final Index SSL_EVENT_ENDED_AT_IDX = Indexes0.SSL_EVENT_ENDED_AT_IDX; - public static final Index SSL_EVENT_MONITOR_IDX = Indexes0.SSL_EVENT_MONITOR_IDX; - public static final Index UPTIME_EVENT_ENDED_AT_IDX = Indexes0.UPTIME_EVENT_ENDED_AT_IDX; - public static final Index UPTIME_EVENT_MONITOR_IDX = Indexes0.UPTIME_EVENT_MONITOR_IDX; - - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- - - private static class Indexes0 { - public static Index LATENCY_LOG_LATENCY_IDX = Internal.createIndex("latency_log_latency_idx", LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.LATENCY }, false); - public static Index LATENCY_LOG_MONITOR_IDX = Internal.createIndex("latency_log_monitor_idx", LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, false); - public static Index SSL_EVENT_ENDED_AT_IDX = Internal.createIndex("ssl_event_ended_at_idx", SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.ENDED_AT }, false); - public static Index SSL_EVENT_MONITOR_IDX = Internal.createIndex("ssl_event_monitor_idx", SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.MONITOR_ID }, false); - public static Index UPTIME_EVENT_ENDED_AT_IDX = Internal.createIndex("uptime_event_ended_at_idx", UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.ENDED_AT }, false); - public static Index UPTIME_EVENT_MONITOR_IDX = Internal.createIndex("uptime_event_monitor_idx", UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, false); - } + public static final Index LATENCY_LOG_LATENCY_IDX = Internal.createIndex(DSL.name("latency_log_latency_idx"), LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.LATENCY }, false); + public static final Index LATENCY_LOG_MONITOR_IDX = Internal.createIndex(DSL.name("latency_log_monitor_idx"), LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, false); + public static final Index SSL_EVENT_ENDED_AT_IDX = Internal.createIndex(DSL.name("ssl_event_ended_at_idx"), SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.ENDED_AT }, false); + public static final Index SSL_EVENT_MONITOR_IDX = Internal.createIndex(DSL.name("ssl_event_monitor_idx"), SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.MONITOR_ID }, false); + public static final Index UPTIME_EVENT_ENDED_AT_IDX = Internal.createIndex(DSL.name("uptime_event_ended_at_idx"), UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.ENDED_AT }, false); + public static final Index UPTIME_EVENT_MONITOR_IDX = Internal.createIndex(DSL.name("uptime_event_monitor_idx"), UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, false); } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java index 3893437..1c54833 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java @@ -14,72 +14,36 @@ import com.kuvaszuptime.kuvasz.tables.records.UptimeEventRecord; import org.jooq.ForeignKey; -import org.jooq.Identity; import org.jooq.TableField; import org.jooq.UniqueKey; +import org.jooq.impl.DSL; import org.jooq.impl.Internal; /** - * A class modelling foreign key relationships and constraints of tables of - * the schema. + * A class modelling foreign key relationships and constraints of tables in + * the default schema. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Keys { - // ------------------------------------------------------------------------- - // IDENTITY definitions - // ------------------------------------------------------------------------- - - public static final Identity IDENTITY_LATENCY_LOG = Identities0.IDENTITY_LATENCY_LOG; - public static final Identity IDENTITY_MONITOR = Identities0.IDENTITY_MONITOR; - public static final Identity IDENTITY_SSL_EVENT = Identities0.IDENTITY_SSL_EVENT; - public static final Identity IDENTITY_UPTIME_EVENT = Identities0.IDENTITY_UPTIME_EVENT; - // ------------------------------------------------------------------------- // UNIQUE and PRIMARY KEY definitions // ------------------------------------------------------------------------- - public static final UniqueKey LATENCY_LOG_PKEY = UniqueKeys0.LATENCY_LOG_PKEY; - public static final UniqueKey MONITOR_PKEY = UniqueKeys0.MONITOR_PKEY; - public static final UniqueKey UNIQUE_MONITOR_NAME = UniqueKeys0.UNIQUE_MONITOR_NAME; - public static final UniqueKey SSL_EVENT_PKEY = UniqueKeys0.SSL_EVENT_PKEY; - public static final UniqueKey SSL_EVENT_KEY = UniqueKeys0.SSL_EVENT_KEY; - public static final UniqueKey UPTIME_EVENT_PKEY = UniqueKeys0.UPTIME_EVENT_PKEY; - public static final UniqueKey UPTIME_EVENT_KEY = UniqueKeys0.UPTIME_EVENT_KEY; + public static final UniqueKey LATENCY_LOG_PKEY = Internal.createUniqueKey(LatencyLog.LATENCY_LOG, DSL.name("latency_log_pkey"), new TableField[] { LatencyLog.LATENCY_LOG.ID }, true); + public static final UniqueKey MONITOR_PKEY = Internal.createUniqueKey(Monitor.MONITOR, DSL.name("monitor_pkey"), new TableField[] { Monitor.MONITOR.ID }, true); + public static final UniqueKey UNIQUE_MONITOR_NAME = Internal.createUniqueKey(Monitor.MONITOR, DSL.name("unique_monitor_name"), new TableField[] { Monitor.MONITOR.NAME }, true); + public static final UniqueKey SSL_EVENT_KEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, DSL.name("ssl_event_key"), new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID, SslEvent.SSL_EVENT.STATUS, SslEvent.SSL_EVENT.ENDED_AT }, true); + public static final UniqueKey SSL_EVENT_PKEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, DSL.name("ssl_event_pkey"), new TableField[] { SslEvent.SSL_EVENT.ID }, true); + public static final UniqueKey UPTIME_EVENT_KEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, DSL.name("uptime_event_key"), new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID, UptimeEvent.UPTIME_EVENT.STATUS, UptimeEvent.UPTIME_EVENT.ENDED_AT }, true); + public static final UniqueKey UPTIME_EVENT_PKEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, DSL.name("uptime_event_pkey"), new TableField[] { UptimeEvent.UPTIME_EVENT.ID }, true); // ------------------------------------------------------------------------- // FOREIGN KEY definitions // ------------------------------------------------------------------------- - public static final ForeignKey LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY = ForeignKeys0.LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY; - public static final ForeignKey SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY = ForeignKeys0.SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY; - public static final ForeignKey UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY = ForeignKeys0.UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY; - - // ------------------------------------------------------------------------- - // [#1459] distribute members to avoid static initialisers > 64kb - // ------------------------------------------------------------------------- - - private static class Identities0 { - public static Identity IDENTITY_LATENCY_LOG = Internal.createIdentity(LatencyLog.LATENCY_LOG, LatencyLog.LATENCY_LOG.ID); - public static Identity IDENTITY_MONITOR = Internal.createIdentity(Monitor.MONITOR, Monitor.MONITOR.ID); - public static Identity IDENTITY_SSL_EVENT = Internal.createIdentity(SslEvent.SSL_EVENT, SslEvent.SSL_EVENT.ID); - public static Identity IDENTITY_UPTIME_EVENT = Internal.createIdentity(UptimeEvent.UPTIME_EVENT, UptimeEvent.UPTIME_EVENT.ID); - } - - private static class UniqueKeys0 { - public static final UniqueKey LATENCY_LOG_PKEY = Internal.createUniqueKey(LatencyLog.LATENCY_LOG, "latency_log_pkey", new TableField[] { LatencyLog.LATENCY_LOG.ID }, true); - public static final UniqueKey MONITOR_PKEY = Internal.createUniqueKey(Monitor.MONITOR, "monitor_pkey", new TableField[] { Monitor.MONITOR.ID }, true); - public static final UniqueKey UNIQUE_MONITOR_NAME = Internal.createUniqueKey(Monitor.MONITOR, "unique_monitor_name", new TableField[] { Monitor.MONITOR.NAME }, true); - public static final UniqueKey SSL_EVENT_PKEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, "ssl_event_pkey", new TableField[] { SslEvent.SSL_EVENT.ID }, true); - public static final UniqueKey SSL_EVENT_KEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, "ssl_event_key", new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID, SslEvent.SSL_EVENT.STATUS, SslEvent.SSL_EVENT.ENDED_AT }, true); - public static final UniqueKey UPTIME_EVENT_PKEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, "uptime_event_pkey", new TableField[] { UptimeEvent.UPTIME_EVENT.ID }, true); - public static final UniqueKey UPTIME_EVENT_KEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, "uptime_event_key", new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID, UptimeEvent.UPTIME_EVENT.STATUS, UptimeEvent.UPTIME_EVENT.ENDED_AT }, true); - } - - private static class ForeignKeys0 { - public static final ForeignKey LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY = Internal.createForeignKey(Keys.MONITOR_PKEY, LatencyLog.LATENCY_LOG, "latency_log_monitor_id_fkey", new TableField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, true); - public static final ForeignKey SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(Keys.MONITOR_PKEY, SslEvent.SSL_EVENT, "ssl_event_monitor_id_fkey", new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID }, true); - public static final ForeignKey UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(Keys.MONITOR_PKEY, UptimeEvent.UPTIME_EVENT, "uptime_event_monitor_id_fkey", new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, true); - } + public static final ForeignKey LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY = Internal.createForeignKey(LatencyLog.LATENCY_LOG, DSL.name("latency_log_monitor_id_fkey"), new TableField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, Keys.MONITOR_PKEY, new TableField[] { Monitor.MONITOR.ID }, true); + public static final ForeignKey SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(SslEvent.SSL_EVENT, DSL.name("ssl_event_monitor_id_fkey"), new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID }, Keys.MONITOR_PKEY, new TableField[] { Monitor.MONITOR.ID }, true); + public static final ForeignKey UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(UptimeEvent.UPTIME_EVENT, DSL.name("uptime_event_monitor_id_fkey"), new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, Keys.MONITOR_PKEY, new TableField[] { Monitor.MONITOR.ID }, true); } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java index df920b2..aab809d 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java @@ -6,10 +6,11 @@ import org.jooq.Sequence; import org.jooq.impl.Internal; +import org.jooq.impl.SQLDataType; /** - * Convenience access to all sequences in + * Convenience access to all sequences in the default schema. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Sequences { @@ -17,20 +18,20 @@ public class Sequences { /** * The sequence latency_log_id_seq */ - public static final Sequence LATENCY_LOG_ID_SEQ = Internal.createSequence("latency_log_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence LATENCY_LOG_ID_SEQ = Internal.createSequence("latency_log_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); /** * The sequence monitor_id_seq */ - public static final Sequence MONITOR_ID_SEQ = Internal.createSequence("monitor_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence MONITOR_ID_SEQ = Internal.createSequence("monitor_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); /** * The sequence ssl_event_id_seq */ - public static final Sequence SSL_EVENT_ID_SEQ = Internal.createSequence("ssl_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence SSL_EVENT_ID_SEQ = Internal.createSequence("ssl_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); /** * The sequence uptime_event_id_seq */ - public static final Sequence UPTIME_EVENT_ID_SEQ = Internal.createSequence("uptime_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence UPTIME_EVENT_ID_SEQ = Internal.createSequence("uptime_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java index 086ba4a..46525ad 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java @@ -11,7 +11,7 @@ /** - * Convenience access to all tables in + * Convenience access to all tables in the default schema. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Tables { diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java index aee39d5..689c5b6 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java @@ -31,7 +31,7 @@ private SslStatus(String literal) { @Override public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); + return getSchema().getCatalog(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java index 9c95501..1eeb57a 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java @@ -29,7 +29,7 @@ private UptimeStatus(String literal) { @Override public Catalog getCatalog() { - return getSchema() == null ? null : getSchema().getCatalog(); + return getSchema().getCatalog(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java index 616e72d..a066649 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java @@ -26,6 +26,7 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -35,7 +36,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class LatencyLog extends TableImpl { - private static final long serialVersionUID = -466401116; + private static final long serialVersionUID = 1L; /** * The reference instance of latency_log @@ -53,28 +54,29 @@ public Class getRecordType() { /** * The column latency_log.id. */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.latency_log_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); /** * The column latency_log.monitor_id. */ - public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), SQLDataType.INTEGER.nullable(false), this, ""); /** * The column latency_log.latency. Lateny in ms */ - public final TableField LATENCY = createField(DSL.name("latency"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "Lateny in ms"); + public final TableField LATENCY = createField(DSL.name("latency"), SQLDataType.INTEGER.nullable(false), this, "Lateny in ms"); /** * The column latency_log.created_at. */ - public final TableField CREATED_AT = createField(DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); - /** - * Create a latency_log table reference - */ - public LatencyLog() { - this(DSL.name("latency_log"), null); + private LatencyLog(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private LatencyLog(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } /** @@ -91,12 +93,11 @@ public LatencyLog(Name alias) { this(alias, LATENCY_LOG); } - private LatencyLog(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private LatencyLog(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a latency_log table reference + */ + public LatencyLog() { + this(DSL.name("latency_log"), null); } public LatencyLog(Table child, ForeignKey key) { @@ -115,7 +116,7 @@ public List getIndexes() { @Override public Identity getIdentity() { - return Keys.IDENTITY_LATENCY_LOG; + return (Identity) super.getIdentity(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java index 186ea2d..fccedf7 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java @@ -24,6 +24,7 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -33,7 +34,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Monitor extends TableImpl { - private static final long serialVersionUID = 2078797674; + private static final long serialVersionUID = 1L; /** * The reference instance of monitor @@ -51,53 +52,54 @@ public Class getRecordType() { /** * The column monitor.id. */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.monitor_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); /** * The column monitor.name. Monitor's name */ - public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, "Monitor's name"); + public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255).nullable(false), this, "Monitor's name"); /** * The column monitor.url. URL to check */ - public final TableField URL = createField(DSL.name("url"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, "URL to check"); + public final TableField URL = createField(DSL.name("url"), SQLDataType.CLOB.nullable(false), this, "URL to check"); /** * The column monitor.uptime_check_interval. Uptime checking interval in seconds */ - public final TableField UPTIME_CHECK_INTERVAL = createField(DSL.name("uptime_check_interval"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "Uptime checking interval in seconds"); + public final TableField UPTIME_CHECK_INTERVAL = createField(DSL.name("uptime_check_interval"), SQLDataType.INTEGER.nullable(false), this, "Uptime checking interval in seconds"); /** * The column monitor.enabled. Flag to toggle the monitor */ - public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, "Flag to toggle the monitor"); + public final TableField ENABLED = createField(DSL.name("enabled"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field("true", SQLDataType.BOOLEAN)), this, "Flag to toggle the monitor"); /** * The column monitor.created_at. */ - public final TableField CREATED_AT = createField(DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); + public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); /** * The column monitor.updated_at. */ - public final TableField UPDATED_AT = createField(DSL.name("updated_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE, this, ""); + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); /** * The column monitor.ssl_check_enabled. */ - public final TableField SSL_CHECK_ENABLED = createField(DSL.name("ssl_check_enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); + public final TableField SSL_CHECK_ENABLED = createField(DSL.name("ssl_check_enabled"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field("false", SQLDataType.BOOLEAN)), this, ""); /** * The column monitor.pagerduty_integration_key. */ - public final TableField PAGERDUTY_INTEGRATION_KEY = createField(DSL.name("pagerduty_integration_key"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); + public final TableField PAGERDUTY_INTEGRATION_KEY = createField(DSL.name("pagerduty_integration_key"), SQLDataType.VARCHAR, this, ""); - /** - * Create a monitor table reference - */ - public Monitor() { - this(DSL.name("monitor"), null); + private Monitor(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Monitor(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } /** @@ -114,12 +116,11 @@ public Monitor(Name alias) { this(alias, MONITOR); } - private Monitor(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private Monitor(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a monitor table reference + */ + public Monitor() { + this(DSL.name("monitor"), null); } public Monitor(Table child, ForeignKey key) { @@ -133,7 +134,7 @@ public Schema getSchema() { @Override public Identity getIdentity() { - return Keys.IDENTITY_MONITOR; + return (Identity) super.getIdentity(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java index ca91bc4..8183fbf 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java @@ -27,6 +27,7 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -36,7 +37,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class SslEvent extends TableImpl { - private static final long serialVersionUID = 2029223819; + private static final long serialVersionUID = 1L; /** * The reference instance of ssl_event @@ -54,43 +55,44 @@ public Class getRecordType() { /** * The column ssl_event.id. */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.ssl_event_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); /** * The column ssl_event.monitor_id. */ - public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), SQLDataType.INTEGER.nullable(false), this, ""); /** * The column ssl_event.status. Status of the event */ - public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.SslStatus.class), this, "Status of the event"); + public final TableField STATUS = createField(DSL.name("status"), SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.SslStatus.class), this, "Status of the event"); /** * The column ssl_event.error. */ - public final TableField ERROR = createField(DSL.name("error"), org.jooq.impl.SQLDataType.CLOB, this, ""); + public final TableField ERROR = createField(DSL.name("error"), SQLDataType.CLOB, this, ""); /** * The column ssl_event.started_at. The current event started at */ - public final TableField STARTED_AT = createField(DSL.name("started_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); + public final TableField STARTED_AT = createField(DSL.name("started_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); /** * The column ssl_event.ended_at. The current event ended at */ - public final TableField ENDED_AT = createField(DSL.name("ended_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE, this, "The current event ended at"); + public final TableField ENDED_AT = createField(DSL.name("ended_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, "The current event ended at"); /** * The column ssl_event.updated_at. */ - public final TableField UPDATED_AT = createField(DSL.name("updated_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false), this, ""); + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); - /** - * Create a ssl_event table reference - */ - public SslEvent() { - this(DSL.name("ssl_event"), null); + private SslEvent(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private SslEvent(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } /** @@ -107,12 +109,11 @@ public SslEvent(Name alias) { this(alias, SSL_EVENT); } - private SslEvent(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private SslEvent(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a ssl_event table reference + */ + public SslEvent() { + this(DSL.name("ssl_event"), null); } public SslEvent(Table child, ForeignKey key) { @@ -131,7 +132,7 @@ public List getIndexes() { @Override public Identity getIdentity() { - return Keys.IDENTITY_SSL_EVENT; + return (Identity) super.getIdentity(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java index 78d7f57..6066a72 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java @@ -27,6 +27,7 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -36,7 +37,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UptimeEvent extends TableImpl { - private static final long serialVersionUID = -1860882345; + private static final long serialVersionUID = 1L; /** * The reference instance of uptime_event @@ -54,43 +55,44 @@ public Class getRecordType() { /** * The column uptime_event.id. */ - public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.uptime_event_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); + public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); /** * The column uptime_event.monitor_id. */ - public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), SQLDataType.INTEGER.nullable(false), this, ""); /** * The column uptime_event.status. Status of the event */ - public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.UptimeStatus.class), this, "Status of the event"); + public final TableField STATUS = createField(DSL.name("status"), SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.UptimeStatus.class), this, "Status of the event"); /** * The column uptime_event.error. */ - public final TableField ERROR = createField(DSL.name("error"), org.jooq.impl.SQLDataType.CLOB, this, ""); + public final TableField ERROR = createField(DSL.name("error"), SQLDataType.CLOB, this, ""); /** * The column uptime_event.started_at. The current event started at */ - public final TableField STARTED_AT = createField(DSL.name("started_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); + public final TableField STARTED_AT = createField(DSL.name("started_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); /** * The column uptime_event.ended_at. The current event ended at */ - public final TableField ENDED_AT = createField(DSL.name("ended_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE, this, "The current event ended at"); + public final TableField ENDED_AT = createField(DSL.name("ended_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, "The current event ended at"); /** * The column uptime_event.updated_at. */ - public final TableField UPDATED_AT = createField(DSL.name("updated_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false), this, ""); + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); - /** - * Create a uptime_event table reference - */ - public UptimeEvent() { - this(DSL.name("uptime_event"), null); + private UptimeEvent(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private UptimeEvent(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } /** @@ -107,12 +109,11 @@ public UptimeEvent(Name alias) { this(alias, UPTIME_EVENT); } - private UptimeEvent(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private UptimeEvent(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a uptime_event table reference + */ + public UptimeEvent() { + this(DSL.name("uptime_event"), null); } public UptimeEvent(Table child, ForeignKey key) { @@ -131,7 +132,7 @@ public List getIndexes() { @Override public Identity getIdentity() { - return Keys.IDENTITY_UPTIME_EVENT; + return (Identity) super.getIdentity(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java index 730046c..39d887e 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java @@ -23,15 +23,19 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "latency_log", uniqueConstraints = { - @UniqueConstraint(name = "latency_log_pkey", columnNames = {"id"}) -}, indexes = { - @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), - @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") -}) +@Table( + name = "latency_log", + uniqueConstraints = { + @UniqueConstraint(name = "latency_log_pkey", columnNames = { "id" }) + }, + indexes = { + @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), + @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") + } +) public class LatencyLogPojo implements Serializable { - private static final long serialVersionUID = 1568220283; + private static final long serialVersionUID = 1L; private Integer id; private Integer monitorId; @@ -59,6 +63,9 @@ public LatencyLogPojo( this.createdAt = createdAt; } + /** + * Getter for latency_log.id. + */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -66,38 +73,59 @@ public Integer getId() { return this.id; } + /** + * Setter for latency_log.id. + */ public LatencyLogPojo setId(Integer id) { this.id = id; return this; } + /** + * Getter for latency_log.monitor_id. + */ @Column(name = "monitor_id", nullable = false, precision = 32) @NotNull public Integer getMonitorId() { return this.monitorId; } + /** + * Setter for latency_log.monitor_id. + */ public LatencyLogPojo setMonitorId(Integer monitorId) { this.monitorId = monitorId; return this; } + /** + * Getter for latency_log.latency. Lateny in ms + */ @Column(name = "latency", nullable = false, precision = 32) @NotNull public Integer getLatency() { return this.latency; } + /** + * Setter for latency_log.latency. Lateny in ms + */ public LatencyLogPojo setLatency(Integer latency) { this.latency = latency; return this; } - @Column(name = "created_at", nullable = false) + /** + * Getter for latency_log.created_at. + */ + @Column(name = "created_at", nullable = false, precision = 6) public OffsetDateTime getCreatedAt() { return this.createdAt; } + /** + * Setter for latency_log.created_at. + */ public LatencyLogPojo setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java index 89ea8a4..0aa088d 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java @@ -23,13 +23,16 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "monitor", uniqueConstraints = { - @UniqueConstraint(name = "monitor_pkey", columnNames = {"id"}), - @UniqueConstraint(name = "unique_monitor_name", columnNames = {"name"}) -}) +@Table( + name = "monitor", + uniqueConstraints = { + @UniqueConstraint(name = "monitor_pkey", columnNames = { "id" }), + @UniqueConstraint(name = "unique_monitor_name", columnNames = { "name" }) + } +) public class MonitorPojo implements Serializable { - private static final long serialVersionUID = -1828922669; + private static final long serialVersionUID = 1L; private Integer id; private String name; @@ -77,6 +80,9 @@ public MonitorPojo( this.pagerdutyIntegrationKey = pagerdutyIntegrationKey; } + /** + * Getter for monitor.id. + */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -84,11 +90,17 @@ public Integer getId() { return this.id; } + /** + * Setter for monitor.id. + */ public MonitorPojo setId(Integer id) { this.id = id; return this; } + /** + * Getter for monitor.name. Monitor's name + */ @Column(name = "name", nullable = false, length = 255) @NotNull @Size(max = 255) @@ -96,78 +108,123 @@ public String getName() { return this.name; } + /** + * Setter for monitor.name. Monitor's name + */ public MonitorPojo setName(String name) { this.name = name; return this; } + /** + * Getter for monitor.url. URL to check + */ @Column(name = "url", nullable = false) @NotNull public String getUrl() { return this.url; } + /** + * Setter for monitor.url. URL to check + */ public MonitorPojo setUrl(String url) { this.url = url; return this; } + /** + * Getter for monitor.uptime_check_interval. Uptime checking interval in seconds + */ @Column(name = "uptime_check_interval", nullable = false, precision = 32) @NotNull public Integer getUptimeCheckInterval() { return this.uptimeCheckInterval; } + /** + * Setter for monitor.uptime_check_interval. Uptime checking interval in seconds + */ public MonitorPojo setUptimeCheckInterval(Integer uptimeCheckInterval) { this.uptimeCheckInterval = uptimeCheckInterval; return this; } + /** + * Getter for monitor.enabled. Flag to toggle the monitor + */ @Column(name = "enabled", nullable = false) public Boolean getEnabled() { return this.enabled; } + /** + * Setter for monitor.enabled. Flag to toggle the monitor + */ public MonitorPojo setEnabled(Boolean enabled) { this.enabled = enabled; return this; } - @Column(name = "created_at", nullable = false) + /** + * Getter for monitor.created_at. + */ + @Column(name = "created_at", nullable = false, precision = 6) public OffsetDateTime getCreatedAt() { return this.createdAt; } + /** + * Setter for monitor.created_at. + */ public MonitorPojo setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - @Column(name = "updated_at") + /** + * Getter for monitor.updated_at. + */ + @Column(name = "updated_at", precision = 6) public OffsetDateTime getUpdatedAt() { return this.updatedAt; } + /** + * Setter for monitor.updated_at. + */ public MonitorPojo setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; return this; } + /** + * Getter for monitor.ssl_check_enabled. + */ @Column(name = "ssl_check_enabled", nullable = false) public Boolean getSslCheckEnabled() { return this.sslCheckEnabled; } + /** + * Setter for monitor.ssl_check_enabled. + */ public MonitorPojo setSslCheckEnabled(Boolean sslCheckEnabled) { this.sslCheckEnabled = sslCheckEnabled; return this; } + /** + * Getter for monitor.pagerduty_integration_key. + */ @Column(name = "pagerduty_integration_key") public String getPagerdutyIntegrationKey() { return this.pagerdutyIntegrationKey; } + /** + * Setter for monitor.pagerduty_integration_key. + */ public MonitorPojo setPagerdutyIntegrationKey(String pagerdutyIntegrationKey) { this.pagerdutyIntegrationKey = pagerdutyIntegrationKey; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java index e3ee89e..9750bd2 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java @@ -25,16 +25,20 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "ssl_event", uniqueConstraints = { - @UniqueConstraint(name = "ssl_event_pkey", columnNames = {"id"}), - @UniqueConstraint(name = "ssl_event_key", columnNames = {"monitor_id", "status", "ended_at"}) -}, indexes = { - @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") -}) +@Table( + name = "ssl_event", + uniqueConstraints = { + @UniqueConstraint(name = "ssl_event_pkey", columnNames = { "id" }), + @UniqueConstraint(name = "ssl_event_key", columnNames = { "monitor_id", "status", "ended_at" }) + }, + indexes = { + @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") + } +) public class SslEventPojo implements Serializable { - private static final long serialVersionUID = -231279334; + private static final long serialVersionUID = 1L; private Integer id; private Integer monitorId; @@ -74,6 +78,9 @@ public SslEventPojo( this.updatedAt = updatedAt; } + /** + * Getter for ssl_event.id. + */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -81,69 +88,108 @@ public Integer getId() { return this.id; } + /** + * Setter for ssl_event.id. + */ public SslEventPojo setId(Integer id) { this.id = id; return this; } + /** + * Getter for ssl_event.monitor_id. + */ @Column(name = "monitor_id", nullable = false, precision = 32) @NotNull public Integer getMonitorId() { return this.monitorId; } + /** + * Setter for ssl_event.monitor_id. + */ public SslEventPojo setMonitorId(Integer monitorId) { this.monitorId = monitorId; return this; } + /** + * Getter for ssl_event.status. Status of the event + */ @Column(name = "status", nullable = false) @NotNull public SslStatus getStatus() { return this.status; } + /** + * Setter for ssl_event.status. Status of the event + */ public SslEventPojo setStatus(SslStatus status) { this.status = status; return this; } + /** + * Getter for ssl_event.error. + */ @Column(name = "error") public String getError() { return this.error; } + /** + * Setter for ssl_event.error. + */ public SslEventPojo setError(String error) { this.error = error; return this; } - @Column(name = "started_at", nullable = false) + /** + * Getter for ssl_event.started_at. The current event started at + */ + @Column(name = "started_at", nullable = false, precision = 6) public OffsetDateTime getStartedAt() { return this.startedAt; } + /** + * Setter for ssl_event.started_at. The current event started at + */ public SslEventPojo setStartedAt(OffsetDateTime startedAt) { this.startedAt = startedAt; return this; } - @Column(name = "ended_at") + /** + * Getter for ssl_event.ended_at. The current event ended at + */ + @Column(name = "ended_at", precision = 6) public OffsetDateTime getEndedAt() { return this.endedAt; } + /** + * Setter for ssl_event.ended_at. The current event ended at + */ public SslEventPojo setEndedAt(OffsetDateTime endedAt) { this.endedAt = endedAt; return this; } - @Column(name = "updated_at", nullable = false) + /** + * Getter for ssl_event.updated_at. + */ + @Column(name = "updated_at", nullable = false, precision = 6) @NotNull public OffsetDateTime getUpdatedAt() { return this.updatedAt; } + /** + * Setter for ssl_event.updated_at. + */ public SslEventPojo setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java index e1ed1b4..5178a78 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java @@ -25,16 +25,20 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "uptime_event", uniqueConstraints = { - @UniqueConstraint(name = "uptime_event_pkey", columnNames = {"id"}), - @UniqueConstraint(name = "uptime_event_key", columnNames = {"monitor_id", "status", "ended_at"}) -}, indexes = { - @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") -}) +@Table( + name = "uptime_event", + uniqueConstraints = { + @UniqueConstraint(name = "uptime_event_pkey", columnNames = { "id" }), + @UniqueConstraint(name = "uptime_event_key", columnNames = { "monitor_id", "status", "ended_at" }) + }, + indexes = { + @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") + } +) public class UptimeEventPojo implements Serializable { - private static final long serialVersionUID = 1847709210; + private static final long serialVersionUID = 1L; private Integer id; private Integer monitorId; @@ -74,6 +78,9 @@ public UptimeEventPojo( this.updatedAt = updatedAt; } + /** + * Getter for uptime_event.id. + */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -81,69 +88,108 @@ public Integer getId() { return this.id; } + /** + * Setter for uptime_event.id. + */ public UptimeEventPojo setId(Integer id) { this.id = id; return this; } + /** + * Getter for uptime_event.monitor_id. + */ @Column(name = "monitor_id", nullable = false, precision = 32) @NotNull public Integer getMonitorId() { return this.monitorId; } + /** + * Setter for uptime_event.monitor_id. + */ public UptimeEventPojo setMonitorId(Integer monitorId) { this.monitorId = monitorId; return this; } + /** + * Getter for uptime_event.status. Status of the event + */ @Column(name = "status", nullable = false) @NotNull public UptimeStatus getStatus() { return this.status; } + /** + * Setter for uptime_event.status. Status of the event + */ public UptimeEventPojo setStatus(UptimeStatus status) { this.status = status; return this; } + /** + * Getter for uptime_event.error. + */ @Column(name = "error") public String getError() { return this.error; } + /** + * Setter for uptime_event.error. + */ public UptimeEventPojo setError(String error) { this.error = error; return this; } - @Column(name = "started_at", nullable = false) + /** + * Getter for uptime_event.started_at. The current event started at + */ + @Column(name = "started_at", nullable = false, precision = 6) public OffsetDateTime getStartedAt() { return this.startedAt; } + /** + * Setter for uptime_event.started_at. The current event started at + */ public UptimeEventPojo setStartedAt(OffsetDateTime startedAt) { this.startedAt = startedAt; return this; } - @Column(name = "ended_at") + /** + * Getter for uptime_event.ended_at. The current event ended at + */ + @Column(name = "ended_at", precision = 6) public OffsetDateTime getEndedAt() { return this.endedAt; } + /** + * Setter for uptime_event.ended_at. The current event ended at + */ public UptimeEventPojo setEndedAt(OffsetDateTime endedAt) { this.endedAt = endedAt; return this; } - @Column(name = "updated_at", nullable = false) + /** + * Getter for uptime_event.updated_at. + */ + @Column(name = "updated_at", nullable = false, precision = 6) @NotNull public OffsetDateTime getUpdatedAt() { return this.updatedAt; } + /** + * Setter for uptime_event.updated_at. + */ public UptimeEventPojo setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java index fc7f817..9590824 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java @@ -30,15 +30,19 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "latency_log", uniqueConstraints = { - @UniqueConstraint(name = "latency_log_pkey", columnNames = {"id"}) -}, indexes = { - @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), - @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") -}) +@Table( + name = "latency_log", + uniqueConstraints = { + @UniqueConstraint(name = "latency_log_pkey", columnNames = { "id" }) + }, + indexes = { + @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), + @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") + } +) public class LatencyLogRecord extends UpdatableRecordImpl implements Record4 { - private static final long serialVersionUID = 936267229; + private static final long serialVersionUID = 1L; /** * Setter for latency_log.id. @@ -103,7 +107,7 @@ public LatencyLogRecord setCreatedAt(OffsetDateTime value) { /** * Getter for latency_log.created_at. */ - @Column(name = "created_at", nullable = false) + @Column(name = "created_at", nullable = false, precision = 6) public OffsetDateTime getCreatedAt() { return (OffsetDateTime) get(3); } @@ -241,9 +245,9 @@ public LatencyLogRecord() { public LatencyLogRecord(Integer id, Integer monitorId, Integer latency, OffsetDateTime createdAt) { super(LatencyLog.LATENCY_LOG); - set(0, id); - set(1, monitorId); - set(2, latency); - set(3, createdAt); + setId(id); + setMonitorId(monitorId); + setLatency(latency); + setCreatedAt(createdAt); } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java index a09069e..a4ec7b1 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java @@ -30,13 +30,16 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "monitor", uniqueConstraints = { - @UniqueConstraint(name = "monitor_pkey", columnNames = {"id"}), - @UniqueConstraint(name = "unique_monitor_name", columnNames = {"name"}) -}) +@Table( + name = "monitor", + uniqueConstraints = { + @UniqueConstraint(name = "monitor_pkey", columnNames = { "id" }), + @UniqueConstraint(name = "unique_monitor_name", columnNames = { "name" }) + } +) public class MonitorRecord extends UpdatableRecordImpl implements Record9 { - private static final long serialVersionUID = -1258639093; + private static final long serialVersionUID = 1L; /** * Setter for monitor.id. @@ -135,7 +138,7 @@ public MonitorRecord setCreatedAt(OffsetDateTime value) { /** * Getter for monitor.created_at. */ - @Column(name = "created_at", nullable = false) + @Column(name = "created_at", nullable = false, precision = 6) public OffsetDateTime getCreatedAt() { return (OffsetDateTime) get(5); } @@ -151,7 +154,7 @@ public MonitorRecord setUpdatedAt(OffsetDateTime value) { /** * Getter for monitor.updated_at. */ - @Column(name = "updated_at") + @Column(name = "updated_at", precision = 6) public OffsetDateTime getUpdatedAt() { return (OffsetDateTime) get(6); } @@ -431,14 +434,14 @@ public MonitorRecord() { public MonitorRecord(Integer id, String name, String url, Integer uptimeCheckInterval, Boolean enabled, OffsetDateTime createdAt, OffsetDateTime updatedAt, Boolean sslCheckEnabled, String pagerdutyIntegrationKey) { super(Monitor.MONITOR); - set(0, id); - set(1, name); - set(2, url); - set(3, uptimeCheckInterval); - set(4, enabled); - set(5, createdAt); - set(6, updatedAt); - set(7, sslCheckEnabled); - set(8, pagerdutyIntegrationKey); + setId(id); + setName(name); + setUrl(url); + setUptimeCheckInterval(uptimeCheckInterval); + setEnabled(enabled); + setCreatedAt(createdAt); + setUpdatedAt(updatedAt); + setSslCheckEnabled(sslCheckEnabled); + setPagerdutyIntegrationKey(pagerdutyIntegrationKey); } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java index 02e4404..53a877d 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java @@ -31,16 +31,20 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "ssl_event", uniqueConstraints = { - @UniqueConstraint(name = "ssl_event_pkey", columnNames = {"id"}), - @UniqueConstraint(name = "ssl_event_key", columnNames = {"monitor_id", "status", "ended_at"}) -}, indexes = { - @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") -}) +@Table( + name = "ssl_event", + uniqueConstraints = { + @UniqueConstraint(name = "ssl_event_pkey", columnNames = { "id" }), + @UniqueConstraint(name = "ssl_event_key", columnNames = { "monitor_id", "status", "ended_at" }) + }, + indexes = { + @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") + } +) public class SslEventRecord extends UpdatableRecordImpl implements Record7 { - private static final long serialVersionUID = -877029403; + private static final long serialVersionUID = 1L; /** * Setter for ssl_event.id. @@ -121,7 +125,7 @@ public SslEventRecord setStartedAt(OffsetDateTime value) { /** * Getter for ssl_event.started_at. The current event started at */ - @Column(name = "started_at", nullable = false) + @Column(name = "started_at", nullable = false, precision = 6) public OffsetDateTime getStartedAt() { return (OffsetDateTime) get(4); } @@ -137,7 +141,7 @@ public SslEventRecord setEndedAt(OffsetDateTime value) { /** * Getter for ssl_event.ended_at. The current event ended at */ - @Column(name = "ended_at") + @Column(name = "ended_at", precision = 6) public OffsetDateTime getEndedAt() { return (OffsetDateTime) get(5); } @@ -153,7 +157,7 @@ public SslEventRecord setUpdatedAt(OffsetDateTime value) { /** * Getter for ssl_event.updated_at. */ - @Column(name = "updated_at", nullable = false) + @Column(name = "updated_at", nullable = false, precision = 6) @NotNull public OffsetDateTime getUpdatedAt() { return (OffsetDateTime) get(6); @@ -358,12 +362,12 @@ public SslEventRecord() { public SslEventRecord(Integer id, Integer monitorId, SslStatus status, String error, OffsetDateTime startedAt, OffsetDateTime endedAt, OffsetDateTime updatedAt) { super(SslEvent.SSL_EVENT); - set(0, id); - set(1, monitorId); - set(2, status); - set(3, error); - set(4, startedAt); - set(5, endedAt); - set(6, updatedAt); + setId(id); + setMonitorId(monitorId); + setStatus(status); + setError(error); + setStartedAt(startedAt); + setEndedAt(endedAt); + setUpdatedAt(updatedAt); } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java index 50873ba..a8295c0 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java @@ -31,16 +31,20 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table(name = "uptime_event", uniqueConstraints = { - @UniqueConstraint(name = "uptime_event_pkey", columnNames = {"id"}), - @UniqueConstraint(name = "uptime_event_key", columnNames = {"monitor_id", "status", "ended_at"}) -}, indexes = { - @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") -}) +@Table( + name = "uptime_event", + uniqueConstraints = { + @UniqueConstraint(name = "uptime_event_pkey", columnNames = { "id" }), + @UniqueConstraint(name = "uptime_event_key", columnNames = { "monitor_id", "status", "ended_at" }) + }, + indexes = { + @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") + } +) public class UptimeEventRecord extends UpdatableRecordImpl implements Record7 { - private static final long serialVersionUID = -32451597; + private static final long serialVersionUID = 1L; /** * Setter for uptime_event.id. @@ -121,7 +125,7 @@ public UptimeEventRecord setStartedAt(OffsetDateTime value) { /** * Getter for uptime_event.started_at. The current event started at */ - @Column(name = "started_at", nullable = false) + @Column(name = "started_at", nullable = false, precision = 6) public OffsetDateTime getStartedAt() { return (OffsetDateTime) get(4); } @@ -137,7 +141,7 @@ public UptimeEventRecord setEndedAt(OffsetDateTime value) { /** * Getter for uptime_event.ended_at. The current event ended at */ - @Column(name = "ended_at") + @Column(name = "ended_at", precision = 6) public OffsetDateTime getEndedAt() { return (OffsetDateTime) get(5); } @@ -153,7 +157,7 @@ public UptimeEventRecord setUpdatedAt(OffsetDateTime value) { /** * Getter for uptime_event.updated_at. */ - @Column(name = "updated_at", nullable = false) + @Column(name = "updated_at", nullable = false, precision = 6) @NotNull public OffsetDateTime getUpdatedAt() { return (OffsetDateTime) get(6); @@ -358,12 +362,12 @@ public UptimeEventRecord() { public UptimeEventRecord(Integer id, Integer monitorId, UptimeStatus status, String error, OffsetDateTime startedAt, OffsetDateTime endedAt, OffsetDateTime updatedAt) { super(UptimeEvent.UPTIME_EVENT); - set(0, id); - set(1, monitorId); - set(2, status); - set(3, error); - set(4, startedAt); - set(5, endedAt); - set(6, updatedAt); + setId(id); + setMonitorId(monitorId); + setStatus(status); + setError(error); + setStartedAt(startedAt); + setEndedAt(endedAt); + setUpdatedAt(updatedAt); } } diff --git a/src/main/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandler.kt b/src/main/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandler.kt index 632d0b1..1f47432 100644 --- a/src/main/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandler.kt +++ b/src/main/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandler.kt @@ -6,8 +6,9 @@ import com.kuvaszuptime.kuvasz.repositories.LatencyLogRepository import com.kuvaszuptime.kuvasz.repositories.SSLEventRepository import com.kuvaszuptime.kuvasz.repositories.UptimeEventRepository import com.kuvaszuptime.kuvasz.services.EventDispatcher -import com.kuvaszuptime.kuvasz.util.transaction import io.micronaut.context.annotation.Context +import org.jooq.Configuration +import org.jooq.impl.DSL import org.slf4j.LoggerFactory @Context @@ -15,7 +16,8 @@ class DatabaseEventHandler( private val eventDispatcher: EventDispatcher, private val uptimeEventRepository: UptimeEventRepository, private val latencyLogRepository: LatencyLogRepository, - private val sslEventRepository: SSLEventRepository + private val sslEventRepository: SSLEventRepository, + private val jooqConfig: Configuration ) { companion object { private val logger = LoggerFactory.getLogger(DatabaseEventHandler::class.java) @@ -52,9 +54,9 @@ class DatabaseEventHandler( private fun handleUptimeMonitorEvent(currentEvent: UptimeMonitorEvent) { currentEvent.previousEvent?.let { previousEvent -> if (currentEvent.statusNotEquals(previousEvent)) { - uptimeEventRepository.transaction { - uptimeEventRepository.endEventById(previousEvent.id, currentEvent.dispatchedAt) - uptimeEventRepository.insertFromMonitorEvent(currentEvent) + DSL.using(jooqConfig).transaction { config -> + uptimeEventRepository.endEventById(previousEvent.id, currentEvent.dispatchedAt, config) + uptimeEventRepository.insertFromMonitorEvent(currentEvent, config) } } else { uptimeEventRepository.updateEventUpdatedAt(previousEvent.id, currentEvent.dispatchedAt) @@ -65,9 +67,9 @@ class DatabaseEventHandler( private fun handleSSLMonitorEvent(currentEvent: SSLMonitorEvent) { currentEvent.previousEvent?.let { previousEvent -> if (currentEvent.statusNotEquals(previousEvent)) { - sslEventRepository.transaction { - sslEventRepository.endEventById(previousEvent.id, currentEvent.dispatchedAt) - sslEventRepository.insertFromMonitorEvent(currentEvent) + DSL.using(jooqConfig).transaction { config -> + sslEventRepository.endEventById(previousEvent.id, currentEvent.dispatchedAt, config) + sslEventRepository.insertFromMonitorEvent(currentEvent, config) } } else { sslEventRepository.updateEventUpdatedAt(previousEvent.id, currentEvent.dispatchedAt) diff --git a/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/MonitorRepository.kt b/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/MonitorRepository.kt index 167198a..27b742e 100644 --- a/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/MonitorRepository.kt +++ b/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/MonitorRepository.kt @@ -11,6 +11,8 @@ import com.kuvaszuptime.kuvasz.tables.SslEvent.SSL_EVENT import com.kuvaszuptime.kuvasz.tables.UptimeEvent.UPTIME_EVENT import com.kuvaszuptime.kuvasz.tables.daos.MonitorDao import com.kuvaszuptime.kuvasz.tables.pojos.MonitorPojo +import com.kuvaszuptime.kuvasz.tables.records.MonitorRecord +import com.kuvaszuptime.kuvasz.util.fetchOneIntoOrThrow import com.kuvaszuptime.kuvasz.util.getCurrentTimestamp import com.kuvaszuptime.kuvasz.util.toPersistenceError import org.jooq.Configuration @@ -62,8 +64,7 @@ class MonitorRepository(jooqConfig: Configuration) : MonitorDao(jooqConfig) { .insertInto(MONITOR) .set(dsl.newRecord(MONITOR, monitorPojo)) .returning(MONITOR.asterisk()) - .fetchOne() - .into(MonitorPojo::class.java) + .fetchOneIntoOrThrow() ) } catch (e: DataAccessException) { e.handle() @@ -83,8 +84,7 @@ class MonitorRepository(jooqConfig: Configuration) : MonitorDao(jooqConfig) { .set(MONITOR.PAGERDUTY_INTEGRATION_KEY, updatedPojo.pagerdutyIntegrationKey) .where(MONITOR.ID.eq(updatedPojo.id)) .returning(MONITOR.asterisk()) - .fetchOne() - .into(MonitorPojo::class.java) + .fetchOneIntoOrThrow() ) } catch (e: DataAccessException) { e.handle() diff --git a/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/SSLEventRepository.kt b/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/SSLEventRepository.kt index 49fb604..346cb37 100644 --- a/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/SSLEventRepository.kt +++ b/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/SSLEventRepository.kt @@ -7,14 +7,15 @@ import com.kuvaszuptime.kuvasz.tables.SslEvent.SSL_EVENT import com.kuvaszuptime.kuvasz.tables.daos.SslEventDao import com.kuvaszuptime.kuvasz.tables.pojos.SslEventPojo import org.jooq.Configuration +import org.jooq.impl.DSL import java.time.OffsetDateTime import javax.inject.Singleton @Singleton -class SSLEventRepository(jooqConfig: Configuration) : SslEventDao(jooqConfig) { +class SSLEventRepository(private val jooqConfig: Configuration) : SslEventDao(jooqConfig) { private val dsl = jooqConfig.dsl() - fun insertFromMonitorEvent(event: SSLMonitorEvent) { + fun insertFromMonitorEvent(event: SSLMonitorEvent, configuration: Configuration? = jooqConfig) { val eventToInsert = SslEventPojo() .setMonitorId(event.monitor.id) .setStatus(event.sslStatus) @@ -25,7 +26,10 @@ class SSLEventRepository(jooqConfig: Configuration) : SslEventDao(jooqConfig) { eventToInsert.error = event.error.message } - insert(eventToInsert) + DSL.using(configuration) + .insertInto(SSL_EVENT) + .set(dsl.newRecord(SSL_EVENT, eventToInsert)) + .execute() } fun getPreviousEventByMonitorId(monitorId: Int): SslEventPojo? = @@ -35,8 +39,9 @@ class SSLEventRepository(jooqConfig: Configuration) : SslEventDao(jooqConfig) { .and(SSL_EVENT.ENDED_AT.isNull) .fetchOneInto(SslEventPojo::class.java) - fun endEventById(eventId: Int, endedAt: OffsetDateTime) = - dsl.update(SSL_EVENT) + fun endEventById(eventId: Int, endedAt: OffsetDateTime, configuration: Configuration? = jooqConfig) = + DSL.using(configuration) + .update(SSL_EVENT) .set(SSL_EVENT.ENDED_AT, endedAt) .set(SSL_EVENT.UPDATED_AT, endedAt) .where(SSL_EVENT.ID.eq(eventId)) diff --git a/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/UptimeEventRepository.kt b/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/UptimeEventRepository.kt index d6fd014..0c0547d 100644 --- a/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/UptimeEventRepository.kt +++ b/src/main/kotlin/com/kuvaszuptime/kuvasz/repositories/UptimeEventRepository.kt @@ -8,14 +8,15 @@ import com.kuvaszuptime.kuvasz.tables.UptimeEvent.UPTIME_EVENT import com.kuvaszuptime.kuvasz.tables.daos.UptimeEventDao import com.kuvaszuptime.kuvasz.tables.pojos.UptimeEventPojo import org.jooq.Configuration +import org.jooq.impl.DSL import java.time.OffsetDateTime import javax.inject.Singleton @Singleton -class UptimeEventRepository(jooqConfig: Configuration) : UptimeEventDao(jooqConfig) { +class UptimeEventRepository(private val jooqConfig: Configuration) : UptimeEventDao(jooqConfig) { private val dsl = jooqConfig.dsl() - fun insertFromMonitorEvent(event: UptimeMonitorEvent) { + fun insertFromMonitorEvent(event: UptimeMonitorEvent, configuration: Configuration? = jooqConfig) { val eventToInsert = UptimeEventPojo() .setMonitorId(event.monitor.id) .setStatus(event.uptimeStatus) @@ -26,7 +27,10 @@ class UptimeEventRepository(jooqConfig: Configuration) : UptimeEventDao(jooqConf eventToInsert.error = event.error.message } - insert(eventToInsert) + DSL.using(configuration) + .insertInto(UPTIME_EVENT) + .set(dsl.newRecord(UPTIME_EVENT, eventToInsert)) + .execute() } fun getPreviousEventByMonitorId(monitorId: Int): UptimeEventPojo? = @@ -36,8 +40,9 @@ class UptimeEventRepository(jooqConfig: Configuration) : UptimeEventDao(jooqConf .and(UPTIME_EVENT.ENDED_AT.isNull) .fetchOneInto(UptimeEventPojo::class.java) - fun endEventById(eventId: Int, endedAt: OffsetDateTime) = - dsl.update(UPTIME_EVENT) + fun endEventById(eventId: Int, endedAt: OffsetDateTime, configuration: Configuration? = jooqConfig) = + DSL.using(configuration) + .update(UPTIME_EVENT) .set(UPTIME_EVENT.ENDED_AT, endedAt) .set(UPTIME_EVENT.UPDATED_AT, endedAt) .where(UPTIME_EVENT.ID.eq(eventId)) diff --git a/src/main/kotlin/com/kuvaszuptime/kuvasz/util/Jooq+.kt b/src/main/kotlin/com/kuvaszuptime/kuvasz/util/Jooq+.kt index 3c99cfc..a7e9d1c 100644 --- a/src/main/kotlin/com/kuvaszuptime/kuvasz/util/Jooq+.kt +++ b/src/main/kotlin/com/kuvaszuptime/kuvasz/util/Jooq+.kt @@ -4,17 +4,20 @@ package com.kuvaszuptime.kuvasz.util import com.kuvaszuptime.kuvasz.models.DuplicationError import com.kuvaszuptime.kuvasz.models.PersistenceError -import org.jooq.Configuration -import org.jooq.DAO +import org.jooq.InsertResultStep import org.jooq.TableRecord +import org.jooq.UpdateResultStep import org.jooq.exception.DataAccessException +import org.jooq.exception.NoDataFoundException import org.postgresql.util.PSQLException -fun , P, T> DAO.transaction(block: () -> Unit) { - configuration().dsl().transaction { _: Configuration -> block() } -} - fun DataAccessException.toPersistenceError(): PersistenceError = getCause(PSQLException::class.java)?.message?.let { message -> if (message.contains("duplicate key")) DuplicationError() else PersistenceError(message) } ?: PersistenceError(message) + +inline fun , reified O> InsertResultStep.fetchOneIntoOrThrow(): O = + fetchOne()?.into(O::class.java) ?: throw NoDataFoundException() + +inline fun , reified O> UpdateResultStep.fetchOneIntoOrThrow(): O = + fetchOne()?.into(O::class.java) ?: throw NoDataFoundException() diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/controllers/MonitorControllerTest.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/controllers/MonitorControllerTest.kt index 4deaa73..1ce4978 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/controllers/MonitorControllerTest.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/controllers/MonitorControllerTest.kt @@ -438,7 +438,7 @@ class MonitorControllerTest( then("it should delete the integration key of the given monitor") { response.status shouldBe HttpStatus.NO_CONTENT - monitorInDb.pagerdutyIntegrationKey shouldBe null + monitorInDb!!.pagerdutyIntegrationKey shouldBe null } } diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandlerTest.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandlerTest.kt index e4b3cb9..421ff88 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandlerTest.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/DatabaseEventHandlerTest.kt @@ -30,20 +30,28 @@ import io.mockk.clearAllMocks import io.mockk.spyk import io.mockk.verify import io.mockk.verifyOrder +import org.jooq.Configuration @MicronautTest(startApplication = false) class DatabaseEventHandlerTest( uptimeEventRepository: UptimeEventRepository, latencyLogRepository: LatencyLogRepository, monitorRepository: MonitorRepository, - sslEventRepository: SSLEventRepository + sslEventRepository: SSLEventRepository, + jooqConfig: Configuration ) : DatabaseBehaviorSpec() { init { val eventDispatcher = EventDispatcher() val uptimeEventRepositorySpy = spyk(uptimeEventRepository) val latencyLogRepositorySpy = spyk(latencyLogRepository) val sslEventRepositorySpy = spyk(sslEventRepository) - DatabaseEventHandler(eventDispatcher, uptimeEventRepositorySpy, latencyLogRepositorySpy, sslEventRepositorySpy) + DatabaseEventHandler( + eventDispatcher, + uptimeEventRepositorySpy, + latencyLogRepositorySpy, + sslEventRepositorySpy, + jooqConfig + ) given("the DatabaseEventHandler - UPTIME events") { `when`("it receives a MonitorUpEvent and there is no previous event for the monitor") { @@ -69,11 +77,11 @@ class DatabaseEventHandlerTest( ) } - expectedUptimeRecord.status shouldBe UptimeStatus.UP + expectedUptimeRecord!!.status shouldBe UptimeStatus.UP expectedUptimeRecord.startedAt shouldBe event.dispatchedAt expectedUptimeRecord.endedAt shouldBe null expectedUptimeRecord.updatedAt shouldBe event.dispatchedAt - expectedLatencyRecord.latency shouldBe event.latency + expectedLatencyRecord!!.latency shouldBe event.latency } } @@ -93,7 +101,7 @@ class DatabaseEventHandlerTest( verify(exactly = 1) { uptimeEventRepositorySpy.insertFromMonitorEvent(event) } verify(exactly = 0) { uptimeEventRepositorySpy.endEventById(any(), any()) } - expectedUptimeRecord.status shouldBe UptimeStatus.DOWN + expectedUptimeRecord!!.status shouldBe UptimeStatus.DOWN expectedUptimeRecord.startedAt shouldBe event.dispatchedAt expectedUptimeRecord.endedAt shouldBe null expectedUptimeRecord.updatedAt shouldBe event.dispatchedAt @@ -123,14 +131,14 @@ class DatabaseEventHandlerTest( val expectedUptimeRecord = uptimeEventRepository.fetchOne(UPTIME_EVENT.MONITOR_ID, monitor.id) val latencyRecords = latencyLogRepository.fetchByMonitorId(monitor.id).sortedBy { it.createdAt } - verify(exactly = 1) { uptimeEventRepositorySpy.insertFromMonitorEvent(firstEvent) } - verify(exactly = 0) { uptimeEventRepositorySpy.endEventById(any(), any()) } + verify(exactly = 1) { uptimeEventRepositorySpy.insertFromMonitorEvent(firstEvent, any()) } + verify(exactly = 0) { uptimeEventRepositorySpy.endEventById(any(), any(), any()) } verifyOrder { latencyLogRepositorySpy.insertLatencyForMonitor(monitor.id, firstEvent.latency) latencyLogRepositorySpy.insertLatencyForMonitor(monitor.id, secondEvent.latency) } - expectedUptimeRecord.status shouldBe UptimeStatus.UP + expectedUptimeRecord!!.status shouldBe UptimeStatus.UP expectedUptimeRecord.endedAt shouldBe null expectedUptimeRecord.updatedAt shouldBe secondEvent.dispatchedAt latencyRecords shouldHaveSize 2 @@ -148,7 +156,7 @@ class DatabaseEventHandlerTest( error = Throwable() ) eventDispatcher.dispatch(firstEvent) - val firstUptimeRecord = uptimeEventRepository.fetchOne(UPTIME_EVENT.MONITOR_ID, monitor.id) + val firstUptimeRecord = uptimeEventRepository.fetchOne(UPTIME_EVENT.MONITOR_ID, monitor.id)!! val secondEvent = MonitorUpEvent( monitor = monitor, @@ -160,13 +168,13 @@ class DatabaseEventHandlerTest( then("it should create a new UptimeEvent and a LatencyLog record, and end the previous one") { val uptimeRecords = uptimeEventRepository.fetchByMonitorId(monitor.id).sortedBy { it.startedAt } - val latencyRecord = latencyLogRepository.fetchOne(LATENCY_LOG.MONITOR_ID, monitor.id) + val latencyRecord = latencyLogRepository.fetchOne(LATENCY_LOG.MONITOR_ID, monitor.id)!! verifyOrder { - uptimeEventRepositorySpy.insertFromMonitorEvent(firstEvent) + uptimeEventRepositorySpy.insertFromMonitorEvent(firstEvent, any()) latencyLogRepositorySpy.insertLatencyForMonitor(monitor.id, secondEvent.latency) - uptimeEventRepositorySpy.endEventById(firstUptimeRecord.id, secondEvent.dispatchedAt) - uptimeEventRepositorySpy.insertFromMonitorEvent(secondEvent) + uptimeEventRepositorySpy.endEventById(firstUptimeRecord.id, secondEvent.dispatchedAt, any()) + uptimeEventRepositorySpy.insertFromMonitorEvent(secondEvent, any()) } uptimeRecords[0].status shouldBe UptimeStatus.DOWN @@ -188,7 +196,7 @@ class DatabaseEventHandlerTest( latency = 1000 ) eventDispatcher.dispatch(firstEvent) - val firstUptimeRecord = uptimeEventRepository.fetchOne(UPTIME_EVENT.MONITOR_ID, monitor.id) + val firstUptimeRecord = uptimeEventRepository.fetchOne(UPTIME_EVENT.MONITOR_ID, monitor.id)!! val secondEvent = MonitorDownEvent( monitor = monitor, @@ -200,13 +208,13 @@ class DatabaseEventHandlerTest( then("it should create a new UptimeEvent record and end the previous one") { val uptimeRecords = uptimeEventRepository.fetchByMonitorId(monitor.id).sortedBy { it.startedAt } - val latencyRecord = latencyLogRepository.fetchOne(LATENCY_LOG.MONITOR_ID, monitor.id) + val latencyRecord = latencyLogRepository.fetchOne(LATENCY_LOG.MONITOR_ID, monitor.id)!! verifyOrder { latencyLogRepositorySpy.insertLatencyForMonitor(monitor.id, firstEvent.latency) - uptimeEventRepositorySpy.insertFromMonitorEvent(firstEvent) - uptimeEventRepositorySpy.endEventById(firstUptimeRecord.id, secondEvent.dispatchedAt) - uptimeEventRepositorySpy.insertFromMonitorEvent(secondEvent) + uptimeEventRepositorySpy.insertFromMonitorEvent(firstEvent, any()) + uptimeEventRepositorySpy.endEventById(firstUptimeRecord.id, secondEvent.dispatchedAt, any()) + uptimeEventRepositorySpy.insertFromMonitorEvent(secondEvent, any()) } uptimeRecords[0].status shouldBe UptimeStatus.UP @@ -231,7 +239,7 @@ class DatabaseEventHandlerTest( eventDispatcher.dispatch(event) then("it should insert a new SSLEvent record with status VALID") { - val expectedSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, event.monitor.id) + val expectedSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, event.monitor.id)!! verify(exactly = 1) { sslEventRepositorySpy.insertFromMonitorEvent(event) } verify(exactly = 0) { sslEventRepositorySpy.endEventById(any(), any()) } @@ -255,10 +263,10 @@ class DatabaseEventHandlerTest( then("it should insert a new SSLEvent record with status INVALID") { val expectedSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, event.monitor.id) - verify(exactly = 1) { sslEventRepositorySpy.insertFromMonitorEvent(event) } - verify(exactly = 0) { sslEventRepositorySpy.endEventById(any(), any()) } + verify(exactly = 1) { sslEventRepositorySpy.insertFromMonitorEvent(event, any()) } + verify(exactly = 0) { sslEventRepositorySpy.endEventById(any(), any(), any()) } - expectedSSLRecord.status shouldBe SslStatus.INVALID + expectedSSLRecord!!.status shouldBe SslStatus.INVALID expectedSSLRecord.startedAt shouldBe event.dispatchedAt expectedSSLRecord.endedAt shouldBe null expectedSSLRecord.updatedAt shouldBe event.dispatchedAt @@ -289,7 +297,7 @@ class DatabaseEventHandlerTest( verify(exactly = 1) { sslEventRepositorySpy.insertFromMonitorEvent(firstEvent) } verify(exactly = 0) { sslEventRepositorySpy.endEventById(any(), any()) } - expectedSSLRecord.status shouldBe SslStatus.VALID + expectedSSLRecord!!.status shouldBe SslStatus.VALID expectedSSLRecord.endedAt shouldBe null expectedSSLRecord.updatedAt shouldBe secondEvent.dispatchedAt } @@ -303,7 +311,7 @@ class DatabaseEventHandlerTest( error = SSLValidationError("ssl error") ) eventDispatcher.dispatch(firstEvent) - val firstSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id) + val firstSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id)!! val secondEvent = SSLValidEvent( monitor = monitor, @@ -316,9 +324,9 @@ class DatabaseEventHandlerTest( val sslRecords = sslEventRepository.fetchByMonitorId(monitor.id).sortedBy { it.startedAt } verifyOrder { - sslEventRepositorySpy.insertFromMonitorEvent(firstEvent) - sslEventRepositorySpy.endEventById(firstSSLRecord.id, secondEvent.dispatchedAt) - sslEventRepositorySpy.insertFromMonitorEvent(secondEvent) + sslEventRepositorySpy.insertFromMonitorEvent(firstEvent, any()) + sslEventRepositorySpy.endEventById(firstSSLRecord.id, secondEvent.dispatchedAt, any()) + sslEventRepositorySpy.insertFromMonitorEvent(secondEvent, any()) } sslRecords[0].status shouldBe SslStatus.INVALID @@ -338,7 +346,7 @@ class DatabaseEventHandlerTest( previousEvent = null ) eventDispatcher.dispatch(firstEvent) - val firstSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id) + val firstSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id)!! val secondEvent = SSLInvalidEvent( monitor = monitor, @@ -351,9 +359,9 @@ class DatabaseEventHandlerTest( val sslRecords = sslEventRepository.fetchByMonitorId(monitor.id).sortedBy { it.startedAt } verifyOrder { - sslEventRepositorySpy.insertFromMonitorEvent(firstEvent) - sslEventRepositorySpy.endEventById(firstSSLRecord.id, secondEvent.dispatchedAt) - sslEventRepositorySpy.insertFromMonitorEvent(secondEvent) + sslEventRepositorySpy.insertFromMonitorEvent(firstEvent, any()) + sslEventRepositorySpy.endEventById(firstSSLRecord.id, secondEvent.dispatchedAt, any()) + sslEventRepositorySpy.insertFromMonitorEvent(secondEvent, any()) } sslRecords[0].status shouldBe SslStatus.VALID @@ -375,7 +383,7 @@ class DatabaseEventHandlerTest( eventDispatcher.dispatch(event) then("it should insert a new SSLEvent record with status WILL_EXPIRE") { - val expectedSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, event.monitor.id) + val expectedSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, event.monitor.id)!! verify(exactly = 1) { sslEventRepositorySpy.insertFromMonitorEvent(event) } verify(exactly = 0) { sslEventRepositorySpy.endEventById(any(), any()) } @@ -405,7 +413,7 @@ class DatabaseEventHandlerTest( eventDispatcher.dispatch(secondEvent) then("it should not insert a new SSLEvent record") { - val expectedSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id) + val expectedSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id)!! verify(exactly = 1) { sslEventRepositorySpy.insertFromMonitorEvent(firstEvent) } verify(exactly = 0) { sslEventRepositorySpy.endEventById(any(), any()) } @@ -424,7 +432,7 @@ class DatabaseEventHandlerTest( previousEvent = null ) eventDispatcher.dispatch(firstEvent) - val firstSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id) + val firstSSLRecord = sslEventRepository.fetchOne(SSL_EVENT.MONITOR_ID, monitor.id)!! val secondEvent = SSLWillExpireEvent( monitor = monitor, @@ -437,9 +445,9 @@ class DatabaseEventHandlerTest( val sslRecords = sslEventRepository.fetchByMonitorId(monitor.id).sortedBy { it.startedAt } verifyOrder { - sslEventRepositorySpy.insertFromMonitorEvent(firstEvent) - sslEventRepositorySpy.endEventById(firstSSLRecord.id, secondEvent.dispatchedAt) - sslEventRepositorySpy.insertFromMonitorEvent(secondEvent) + sslEventRepositorySpy.insertFromMonitorEvent(firstEvent, any()) + sslEventRepositorySpy.endEventById(firstSSLRecord.id, secondEvent.dispatchedAt, any()) + sslEventRepositorySpy.insertFromMonitorEvent(secondEvent, any()) } sslRecords[0].status shouldBe SslStatus.VALID diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/PagerdutyEventHandlerTest.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/PagerdutyEventHandlerTest.kt index 66a2d89..c48c7a5 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/PagerdutyEventHandlerTest.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/PagerdutyEventHandlerTest.kt @@ -35,20 +35,28 @@ import io.mockk.mockk import io.mockk.slot import io.mockk.verify import io.reactivex.Single +import org.jooq.Configuration @MicronautTest(startApplication = false) class PagerdutyEventHandlerTest( private val monitorRepository: MonitorRepository, private val uptimeEventRepository: UptimeEventRepository, sslEventRepository: SSLEventRepository, - latencyLogRepository: LatencyLogRepository + latencyLogRepository: LatencyLogRepository, + jooqConfig: Configuration ) : DatabaseBehaviorSpec() { private val mockClient = mockk() init { val eventDispatcher = EventDispatcher() - DatabaseEventHandler(eventDispatcher, uptimeEventRepository, latencyLogRepository, sslEventRepository) + DatabaseEventHandler( + eventDispatcher, + uptimeEventRepository, + latencyLogRepository, + sslEventRepository, + jooqConfig + ) PagerdutyEventHandler(eventDispatcher, mockClient) given("the PagerdutyEventHandler - UPTIME events") { diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SMTPEventHandlerTest.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SMTPEventHandlerTest.kt index 86242a9..91a92b0 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SMTPEventHandlerTest.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SMTPEventHandlerTest.kt @@ -30,9 +30,11 @@ import io.mockk.clearAllMocks import io.mockk.slot import io.mockk.spyk import io.mockk.verify +import org.jooq.Configuration import org.simplejavamail.api.email.Email import java.time.OffsetDateTime +@Suppress("LongParameterList") @MicronautTest(startApplication = false) class SMTPEventHandlerTest( private val monitorRepository: MonitorRepository, @@ -40,14 +42,21 @@ class SMTPEventHandlerTest( private val sslEventRepository: SSLEventRepository, latencyLogRepository: LatencyLogRepository, smtpEventHandlerConfig: SMTPEventHandlerConfig, - smtpMailer: SMTPMailer + smtpMailer: SMTPMailer, + jooqConfig: Configuration ) : DatabaseBehaviorSpec() { init { val eventDispatcher = EventDispatcher() val emailFactory = EmailFactory(smtpEventHandlerConfig) val mailerSpy = spyk(smtpMailer, recordPrivateCalls = true) - DatabaseEventHandler(eventDispatcher, uptimeEventRepository, latencyLogRepository, sslEventRepository) + DatabaseEventHandler( + eventDispatcher, + uptimeEventRepository, + latencyLogRepository, + sslEventRepository, + jooqConfig + ) SMTPEventHandler(smtpEventHandlerConfig, mailerSpy, eventDispatcher) given("the SMTPEventHandler - UPTIME events") { diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SlackEventHandlerTest.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SlackEventHandlerTest.kt index 2922528..1b9abe9 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SlackEventHandlerTest.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/SlackEventHandlerTest.kt @@ -34,6 +34,7 @@ import io.mockk.slot import io.mockk.spyk import io.mockk.verify import io.reactivex.Single +import org.jooq.Configuration import java.time.OffsetDateTime @MicronautTest(startApplication = false) @@ -41,7 +42,8 @@ class SlackEventHandlerTest( private val monitorRepository: MonitorRepository, private val uptimeEventRepository: UptimeEventRepository, private val sslEventRepository: SSLEventRepository, - latencyLogRepository: LatencyLogRepository + latencyLogRepository: LatencyLogRepository, + jooqConfig: Configuration ) : DatabaseBehaviorSpec() { private val mockClient = mockk() @@ -50,7 +52,13 @@ class SlackEventHandlerTest( val slackWebhookService = SlackWebhookService(mockClient) val webhookServiceSpy = spyk(slackWebhookService, recordPrivateCalls = true) - DatabaseEventHandler(eventDispatcher, uptimeEventRepository, latencyLogRepository, sslEventRepository) + DatabaseEventHandler( + eventDispatcher, + uptimeEventRepository, + latencyLogRepository, + sslEventRepository, + jooqConfig + ) SlackEventHandler(webhookServiceSpy, eventDispatcher) given("the SlackEventHandler - UPTIME events") { diff --git a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/TelegramEventHandlerTest.kt b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/TelegramEventHandlerTest.kt index 306bc97..e34c5f3 100644 --- a/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/TelegramEventHandlerTest.kt +++ b/src/test/kotlin/com/kuvaszuptime/kuvasz/handlers/TelegramEventHandlerTest.kt @@ -35,6 +35,7 @@ import io.mockk.slot import io.mockk.spyk import io.mockk.verify import io.reactivex.Single +import org.jooq.Configuration import java.time.OffsetDateTime @MicronautTest(startApplication = false) @@ -42,7 +43,8 @@ class TelegramEventHandlerTest( private val monitorRepository: MonitorRepository, private val uptimeEventRepository: UptimeEventRepository, private val sslEventRepository: SSLEventRepository, - latencyLogRepository: LatencyLogRepository + latencyLogRepository: LatencyLogRepository, + jooqConfig: Configuration ) : DatabaseBehaviorSpec() { private val mockClient = mockk() @@ -55,7 +57,13 @@ class TelegramEventHandlerTest( val telegramAPIService = TelegramAPIService(eventHandlerConfig, mockClient) val apiServiceSpy = spyk(telegramAPIService, recordPrivateCalls = true) - DatabaseEventHandler(eventDispatcher, uptimeEventRepository, latencyLogRepository, sslEventRepository) + DatabaseEventHandler( + eventDispatcher, + uptimeEventRepository, + latencyLogRepository, + sslEventRepository, + jooqConfig + ) TelegramEventHandler(apiServiceSpy, eventDispatcher) given("the TelegramEventHandler") { From 9113388ec31fe0448a36dbdf87fa1f08078311ba Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 15:29:04 +0100 Subject: [PATCH 4/8] Exclude /health endpoint from HTTP communication log --- .../kotlin/com/kuvaszuptime/kuvasz/factories/LogbookFactory.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/com/kuvaszuptime/kuvasz/factories/LogbookFactory.kt b/src/main/kotlin/com/kuvaszuptime/kuvasz/factories/LogbookFactory.kt index d1cefbc..00f7da9 100644 --- a/src/main/kotlin/com/kuvaszuptime/kuvasz/factories/LogbookFactory.kt +++ b/src/main/kotlin/com/kuvaszuptime/kuvasz/factories/LogbookFactory.kt @@ -1,6 +1,8 @@ package com.kuvaszuptime.kuvasz.factories import io.micronaut.context.annotation.Factory +import org.zalando.logbook.Conditions.exclude +import org.zalando.logbook.Conditions.requestTo import org.zalando.logbook.DefaultHttpLogWriter import org.zalando.logbook.DefaultSink import org.zalando.logbook.Logbook @@ -15,6 +17,7 @@ class LogbookFactory { @Singleton fun logbook(): Logbook = Logbook.builder() + .condition(exclude(requestTo("/health"))) .strategy(SecurityStrategy()) .strategy(WithoutBodyStrategy()) .sink(DefaultSink(JsonHttpLogFormatter(), DefaultHttpLogWriter())) From c859b0cc6024f481159e0c1e2c50b0ac547d508e Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 15:29:11 +0100 Subject: [PATCH 5/8] Upgrade Micronaut, Kotlin and other dependencies --- gradle.properties | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index e68984f..18192d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,17 @@ arrowDataVersion=0.11.0 -checkUpdatesVersion=1.1.0 +checkUpdatesVersion=1.1.4 detektVersion=1.14.2 jibVersion=2.6.0 jooqPluginVersion=5.2 jooqVersion=3.14.3 -kotlinCoroutinesVersion=1.3.9 -kotlinVersion=1.4.10 -logbookVersion=2.3.0 -micronautPluginVersion=1.0.5 -micronautVersion=2.1.2 +kotlinCoroutinesVersion=1.4.1 +kotlinVersion=1.4.20 +logbookVersion=2.4.1 +micronautPluginVersion=1.2.0 +micronautVersion=2.2.0 mockkVersion=1.10.2 palantirGitVersion=0.12.3 postgresTestContainersVersion=1.15.0 postgresVersion=42.2.18 shadowVersion=6.1.0 -simpleJavaMailVersion=6.4.3 +simpleJavaMailVersion=6.4.4 From d2af6de2e1f624d1b288e2c05ef1fd46bb7cc007 Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 15:39:46 +0100 Subject: [PATCH 6/8] Add test coverage verification to the test flow --- build.gradle | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/build.gradle b/build.gradle index 8d7b5f4..063db15 100644 --- a/build.gradle +++ b/build.gradle @@ -106,6 +106,29 @@ jacocoTestReport { ) } +jacocoTestCoverageVerification { + afterEvaluate { + classDirectories.setFrom( + fileTree("build/classes/kotlin/main") { + exclude("com/kuvaszuptime/kuvasz/Application.class") + } + ) + } + violationRules { + rule { + limit { + counter = "INSTRUCTION" + value = "COVEREDRATIO" + minimum = 0.9 + } + } + } +} + +check { + dependsOn("jacocoTestCoverageVerification") +} + detekt { input = files( "src/main/kotlin", From 3d3b28a4c62252b5205aeee4baa5221fc5b6b09f Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 16:38:02 +0100 Subject: [PATCH 7/8] Upgrade Graal base image to 20.3.0 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 47568b7..3fc0977 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM oracle/graalvm-ce:20.2.0-java11 as graalvm +FROM oracle/graalvm-ce:20.3.0-java11 as graalvm ARG VERSION="" RUN gu install native-image @@ -6,7 +6,7 @@ COPY . /home/app/kuvasz WORKDIR /home/app/kuvasz RUN native-image --no-server --verbose -cp build/libs/kuvasz-${VERSION}-all.jar \ ---initialize-at-build-time=com.sun.mail.util.LineInputStream +--initialize-at-build-time=com.sun.mail.util.LineInputStream --report-unsupported-elements-at-runtime FROM frolvlad/alpine-glibc:alpine-3.12_glibc-2.31 RUN apk --no-cache add libstdc++ From 449a2d500c0dc83b19a93e6ea0833f483644829f Mon Sep 17 00:00:00 2001 From: adamkobor Date: Sun, 22 Nov 2020 19:20:42 +0100 Subject: [PATCH 8/8] Revert Micronaut and jOOQ version due to GraalVM compatibility issues --- Dockerfile | 4 +- gradle.properties | 4 +- .../kuvaszuptime/kuvasz/DefaultCatalog.java | 2 +- .../kuvaszuptime/kuvasz/DefaultSchema.java | 2 +- .../java/com/kuvaszuptime/kuvasz/Indexes.java | 28 +++++--- .../java/com/kuvaszuptime/kuvasz/Keys.java | 62 ++++++++++++---- .../com/kuvaszuptime/kuvasz/Sequences.java | 11 ++- .../java/com/kuvaszuptime/kuvasz/Tables.java | 2 +- .../kuvaszuptime/kuvasz/enums/SslStatus.java | 2 +- .../kuvasz/enums/UptimeStatus.java | 2 +- .../kuvasz/tables/LatencyLog.java | 35 +++++---- .../kuvaszuptime/kuvasz/tables/Monitor.java | 45 ++++++------ .../kuvaszuptime/kuvasz/tables/SslEvent.java | 41 ++++++----- .../kuvasz/tables/UptimeEvent.java | 41 ++++++----- .../kuvasz/tables/pojos/LatencyLogPojo.java | 44 +++--------- .../kuvasz/tables/pojos/MonitorPojo.java | 71 ++----------------- .../kuvasz/tables/pojos/SslEventPojo.java | 68 +++--------------- .../kuvasz/tables/pojos/UptimeEventPojo.java | 68 +++--------------- .../tables/records/LatencyLogRecord.java | 28 ++++---- .../kuvasz/tables/records/MonitorRecord.java | 35 +++++---- .../kuvasz/tables/records/SslEventRecord.java | 40 +++++------ .../tables/records/UptimeEventRecord.java | 40 +++++------ 22 files changed, 263 insertions(+), 412 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3fc0977..158b56d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ COPY . /home/app/kuvasz WORKDIR /home/app/kuvasz RUN native-image --no-server --verbose -cp build/libs/kuvasz-${VERSION}-all.jar \ ---initialize-at-build-time=com.sun.mail.util.LineInputStream --report-unsupported-elements-at-runtime +--initialize-at-build-time=com.sun.mail.util.LineInputStream -FROM frolvlad/alpine-glibc:alpine-3.12_glibc-2.31 +FROM frolvlad/alpine-glibc:alpine-3.12_glibc-2.32 RUN apk --no-cache add libstdc++ EXPOSE 8080 COPY --from=graalvm /home/app/kuvasz/kuvasz /app/kuvasz diff --git a/gradle.properties b/gradle.properties index 18192d8..80d6611 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ checkUpdatesVersion=1.1.4 detektVersion=1.14.2 jibVersion=2.6.0 jooqPluginVersion=5.2 -jooqVersion=3.14.3 +jooqVersion=3.13.1 kotlinCoroutinesVersion=1.4.1 kotlinVersion=1.4.20 logbookVersion=2.4.1 micronautPluginVersion=1.2.0 -micronautVersion=2.2.0 +micronautVersion=2.1.4 mockkVersion=1.10.2 palantirGitVersion=0.12.3 postgresTestContainersVersion=1.15.0 diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java index 76ba603..e282655 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultCatalog.java @@ -17,7 +17,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultCatalog extends CatalogImpl { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1946704898; /** * The reference instance of DEFAULT_CATALOG diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java index 3ef84a6..585310f 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/DefaultSchema.java @@ -24,7 +24,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class DefaultSchema extends SchemaImpl { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -839450692; /** * The reference instance of DEFAULT_SCHEMA diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java index 0452808..ddc13fb 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Indexes.java @@ -10,12 +10,11 @@ import org.jooq.Index; import org.jooq.OrderField; -import org.jooq.impl.DSL; import org.jooq.impl.Internal; /** - * A class modelling indexes of tables in the default schema. + * A class modelling indexes of tables of the schema. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Indexes { @@ -24,10 +23,23 @@ public class Indexes { // INDEX definitions // ------------------------------------------------------------------------- - public static final Index LATENCY_LOG_LATENCY_IDX = Internal.createIndex(DSL.name("latency_log_latency_idx"), LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.LATENCY }, false); - public static final Index LATENCY_LOG_MONITOR_IDX = Internal.createIndex(DSL.name("latency_log_monitor_idx"), LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, false); - public static final Index SSL_EVENT_ENDED_AT_IDX = Internal.createIndex(DSL.name("ssl_event_ended_at_idx"), SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.ENDED_AT }, false); - public static final Index SSL_EVENT_MONITOR_IDX = Internal.createIndex(DSL.name("ssl_event_monitor_idx"), SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.MONITOR_ID }, false); - public static final Index UPTIME_EVENT_ENDED_AT_IDX = Internal.createIndex(DSL.name("uptime_event_ended_at_idx"), UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.ENDED_AT }, false); - public static final Index UPTIME_EVENT_MONITOR_IDX = Internal.createIndex(DSL.name("uptime_event_monitor_idx"), UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, false); + public static final Index LATENCY_LOG_LATENCY_IDX = Indexes0.LATENCY_LOG_LATENCY_IDX; + public static final Index LATENCY_LOG_MONITOR_IDX = Indexes0.LATENCY_LOG_MONITOR_IDX; + public static final Index SSL_EVENT_ENDED_AT_IDX = Indexes0.SSL_EVENT_ENDED_AT_IDX; + public static final Index SSL_EVENT_MONITOR_IDX = Indexes0.SSL_EVENT_MONITOR_IDX; + public static final Index UPTIME_EVENT_ENDED_AT_IDX = Indexes0.UPTIME_EVENT_ENDED_AT_IDX; + public static final Index UPTIME_EVENT_MONITOR_IDX = Indexes0.UPTIME_EVENT_MONITOR_IDX; + + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- + + private static class Indexes0 { + public static Index LATENCY_LOG_LATENCY_IDX = Internal.createIndex("latency_log_latency_idx", LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.LATENCY }, false); + public static Index LATENCY_LOG_MONITOR_IDX = Internal.createIndex("latency_log_monitor_idx", LatencyLog.LATENCY_LOG, new OrderField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, false); + public static Index SSL_EVENT_ENDED_AT_IDX = Internal.createIndex("ssl_event_ended_at_idx", SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.ENDED_AT }, false); + public static Index SSL_EVENT_MONITOR_IDX = Internal.createIndex("ssl_event_monitor_idx", SslEvent.SSL_EVENT, new OrderField[] { SslEvent.SSL_EVENT.MONITOR_ID }, false); + public static Index UPTIME_EVENT_ENDED_AT_IDX = Internal.createIndex("uptime_event_ended_at_idx", UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.ENDED_AT }, false); + public static Index UPTIME_EVENT_MONITOR_IDX = Internal.createIndex("uptime_event_monitor_idx", UptimeEvent.UPTIME_EVENT, new OrderField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, false); + } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java index 1c54833..3893437 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Keys.java @@ -14,36 +14,72 @@ import com.kuvaszuptime.kuvasz.tables.records.UptimeEventRecord; import org.jooq.ForeignKey; +import org.jooq.Identity; import org.jooq.TableField; import org.jooq.UniqueKey; -import org.jooq.impl.DSL; import org.jooq.impl.Internal; /** - * A class modelling foreign key relationships and constraints of tables in - * the default schema. + * A class modelling foreign key relationships and constraints of tables of + * the schema. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Keys { + // ------------------------------------------------------------------------- + // IDENTITY definitions + // ------------------------------------------------------------------------- + + public static final Identity IDENTITY_LATENCY_LOG = Identities0.IDENTITY_LATENCY_LOG; + public static final Identity IDENTITY_MONITOR = Identities0.IDENTITY_MONITOR; + public static final Identity IDENTITY_SSL_EVENT = Identities0.IDENTITY_SSL_EVENT; + public static final Identity IDENTITY_UPTIME_EVENT = Identities0.IDENTITY_UPTIME_EVENT; + // ------------------------------------------------------------------------- // UNIQUE and PRIMARY KEY definitions // ------------------------------------------------------------------------- - public static final UniqueKey LATENCY_LOG_PKEY = Internal.createUniqueKey(LatencyLog.LATENCY_LOG, DSL.name("latency_log_pkey"), new TableField[] { LatencyLog.LATENCY_LOG.ID }, true); - public static final UniqueKey MONITOR_PKEY = Internal.createUniqueKey(Monitor.MONITOR, DSL.name("monitor_pkey"), new TableField[] { Monitor.MONITOR.ID }, true); - public static final UniqueKey UNIQUE_MONITOR_NAME = Internal.createUniqueKey(Monitor.MONITOR, DSL.name("unique_monitor_name"), new TableField[] { Monitor.MONITOR.NAME }, true); - public static final UniqueKey SSL_EVENT_KEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, DSL.name("ssl_event_key"), new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID, SslEvent.SSL_EVENT.STATUS, SslEvent.SSL_EVENT.ENDED_AT }, true); - public static final UniqueKey SSL_EVENT_PKEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, DSL.name("ssl_event_pkey"), new TableField[] { SslEvent.SSL_EVENT.ID }, true); - public static final UniqueKey UPTIME_EVENT_KEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, DSL.name("uptime_event_key"), new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID, UptimeEvent.UPTIME_EVENT.STATUS, UptimeEvent.UPTIME_EVENT.ENDED_AT }, true); - public static final UniqueKey UPTIME_EVENT_PKEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, DSL.name("uptime_event_pkey"), new TableField[] { UptimeEvent.UPTIME_EVENT.ID }, true); + public static final UniqueKey LATENCY_LOG_PKEY = UniqueKeys0.LATENCY_LOG_PKEY; + public static final UniqueKey MONITOR_PKEY = UniqueKeys0.MONITOR_PKEY; + public static final UniqueKey UNIQUE_MONITOR_NAME = UniqueKeys0.UNIQUE_MONITOR_NAME; + public static final UniqueKey SSL_EVENT_PKEY = UniqueKeys0.SSL_EVENT_PKEY; + public static final UniqueKey SSL_EVENT_KEY = UniqueKeys0.SSL_EVENT_KEY; + public static final UniqueKey UPTIME_EVENT_PKEY = UniqueKeys0.UPTIME_EVENT_PKEY; + public static final UniqueKey UPTIME_EVENT_KEY = UniqueKeys0.UPTIME_EVENT_KEY; // ------------------------------------------------------------------------- // FOREIGN KEY definitions // ------------------------------------------------------------------------- - public static final ForeignKey LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY = Internal.createForeignKey(LatencyLog.LATENCY_LOG, DSL.name("latency_log_monitor_id_fkey"), new TableField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, Keys.MONITOR_PKEY, new TableField[] { Monitor.MONITOR.ID }, true); - public static final ForeignKey SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(SslEvent.SSL_EVENT, DSL.name("ssl_event_monitor_id_fkey"), new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID }, Keys.MONITOR_PKEY, new TableField[] { Monitor.MONITOR.ID }, true); - public static final ForeignKey UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(UptimeEvent.UPTIME_EVENT, DSL.name("uptime_event_monitor_id_fkey"), new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, Keys.MONITOR_PKEY, new TableField[] { Monitor.MONITOR.ID }, true); + public static final ForeignKey LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY = ForeignKeys0.LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY; + public static final ForeignKey SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY = ForeignKeys0.SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY; + public static final ForeignKey UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY = ForeignKeys0.UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY; + + // ------------------------------------------------------------------------- + // [#1459] distribute members to avoid static initialisers > 64kb + // ------------------------------------------------------------------------- + + private static class Identities0 { + public static Identity IDENTITY_LATENCY_LOG = Internal.createIdentity(LatencyLog.LATENCY_LOG, LatencyLog.LATENCY_LOG.ID); + public static Identity IDENTITY_MONITOR = Internal.createIdentity(Monitor.MONITOR, Monitor.MONITOR.ID); + public static Identity IDENTITY_SSL_EVENT = Internal.createIdentity(SslEvent.SSL_EVENT, SslEvent.SSL_EVENT.ID); + public static Identity IDENTITY_UPTIME_EVENT = Internal.createIdentity(UptimeEvent.UPTIME_EVENT, UptimeEvent.UPTIME_EVENT.ID); + } + + private static class UniqueKeys0 { + public static final UniqueKey LATENCY_LOG_PKEY = Internal.createUniqueKey(LatencyLog.LATENCY_LOG, "latency_log_pkey", new TableField[] { LatencyLog.LATENCY_LOG.ID }, true); + public static final UniqueKey MONITOR_PKEY = Internal.createUniqueKey(Monitor.MONITOR, "monitor_pkey", new TableField[] { Monitor.MONITOR.ID }, true); + public static final UniqueKey UNIQUE_MONITOR_NAME = Internal.createUniqueKey(Monitor.MONITOR, "unique_monitor_name", new TableField[] { Monitor.MONITOR.NAME }, true); + public static final UniqueKey SSL_EVENT_PKEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, "ssl_event_pkey", new TableField[] { SslEvent.SSL_EVENT.ID }, true); + public static final UniqueKey SSL_EVENT_KEY = Internal.createUniqueKey(SslEvent.SSL_EVENT, "ssl_event_key", new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID, SslEvent.SSL_EVENT.STATUS, SslEvent.SSL_EVENT.ENDED_AT }, true); + public static final UniqueKey UPTIME_EVENT_PKEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, "uptime_event_pkey", new TableField[] { UptimeEvent.UPTIME_EVENT.ID }, true); + public static final UniqueKey UPTIME_EVENT_KEY = Internal.createUniqueKey(UptimeEvent.UPTIME_EVENT, "uptime_event_key", new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID, UptimeEvent.UPTIME_EVENT.STATUS, UptimeEvent.UPTIME_EVENT.ENDED_AT }, true); + } + + private static class ForeignKeys0 { + public static final ForeignKey LATENCY_LOG__LATENCY_LOG_MONITOR_ID_FKEY = Internal.createForeignKey(Keys.MONITOR_PKEY, LatencyLog.LATENCY_LOG, "latency_log_monitor_id_fkey", new TableField[] { LatencyLog.LATENCY_LOG.MONITOR_ID }, true); + public static final ForeignKey SSL_EVENT__SSL_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(Keys.MONITOR_PKEY, SslEvent.SSL_EVENT, "ssl_event_monitor_id_fkey", new TableField[] { SslEvent.SSL_EVENT.MONITOR_ID }, true); + public static final ForeignKey UPTIME_EVENT__UPTIME_EVENT_MONITOR_ID_FKEY = Internal.createForeignKey(Keys.MONITOR_PKEY, UptimeEvent.UPTIME_EVENT, "uptime_event_monitor_id_fkey", new TableField[] { UptimeEvent.UPTIME_EVENT.MONITOR_ID }, true); + } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java index aab809d..df920b2 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Sequences.java @@ -6,11 +6,10 @@ import org.jooq.Sequence; import org.jooq.impl.Internal; -import org.jooq.impl.SQLDataType; /** - * Convenience access to all sequences in the default schema. + * Convenience access to all sequences in */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Sequences { @@ -18,20 +17,20 @@ public class Sequences { /** * The sequence latency_log_id_seq */ - public static final Sequence LATENCY_LOG_ID_SEQ = Internal.createSequence("latency_log_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence LATENCY_LOG_ID_SEQ = Internal.createSequence("latency_log_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); /** * The sequence monitor_id_seq */ - public static final Sequence MONITOR_ID_SEQ = Internal.createSequence("monitor_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence MONITOR_ID_SEQ = Internal.createSequence("monitor_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); /** * The sequence ssl_event_id_seq */ - public static final Sequence SSL_EVENT_ID_SEQ = Internal.createSequence("ssl_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence SSL_EVENT_ID_SEQ = Internal.createSequence("ssl_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); /** * The sequence uptime_event_id_seq */ - public static final Sequence UPTIME_EVENT_ID_SEQ = Internal.createSequence("uptime_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); + public static final Sequence UPTIME_EVENT_ID_SEQ = Internal.createSequence("uptime_event_id_seq", DefaultSchema.DEFAULT_SCHEMA, org.jooq.impl.SQLDataType.INTEGER.nullable(false), null, null, null, null, false, null); } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java b/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java index 46525ad..086ba4a 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/Tables.java @@ -11,7 +11,7 @@ /** - * Convenience access to all tables in the default schema. + * Convenience access to all tables in */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Tables { diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java index 689c5b6..aee39d5 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/SslStatus.java @@ -31,7 +31,7 @@ private SslStatus(String literal) { @Override public Catalog getCatalog() { - return getSchema().getCatalog(); + return getSchema() == null ? null : getSchema().getCatalog(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java index 1eeb57a..9c95501 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/enums/UptimeStatus.java @@ -29,7 +29,7 @@ private UptimeStatus(String literal) { @Override public Catalog getCatalog() { - return getSchema().getCatalog(); + return getSchema() == null ? null : getSchema().getCatalog(); } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java index a066649..616e72d 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/LatencyLog.java @@ -26,7 +26,6 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; -import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -36,7 +35,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class LatencyLog extends TableImpl { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -466401116; /** * The reference instance of latency_log @@ -54,29 +53,28 @@ public Class getRecordType() { /** * The column latency_log.id. */ - public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.latency_log_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); /** * The column latency_log.monitor_id. */ - public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); /** * The column latency_log.latency. Lateny in ms */ - public final TableField LATENCY = createField(DSL.name("latency"), SQLDataType.INTEGER.nullable(false), this, "Lateny in ms"); + public final TableField LATENCY = createField(DSL.name("latency"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "Lateny in ms"); /** * The column latency_log.created_at. */ - public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); + public final TableField CREATED_AT = createField(DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); - private LatencyLog(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private LatencyLog(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a latency_log table reference + */ + public LatencyLog() { + this(DSL.name("latency_log"), null); } /** @@ -93,11 +91,12 @@ public LatencyLog(Name alias) { this(alias, LATENCY_LOG); } - /** - * Create a latency_log table reference - */ - public LatencyLog() { - this(DSL.name("latency_log"), null); + private LatencyLog(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private LatencyLog(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } public LatencyLog(Table child, ForeignKey key) { @@ -116,7 +115,7 @@ public List getIndexes() { @Override public Identity getIdentity() { - return (Identity) super.getIdentity(); + return Keys.IDENTITY_LATENCY_LOG; } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java index fccedf7..186ea2d 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/Monitor.java @@ -24,7 +24,6 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; -import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -34,7 +33,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Monitor extends TableImpl { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2078797674; /** * The reference instance of monitor @@ -52,54 +51,53 @@ public Class getRecordType() { /** * The column monitor.id. */ - public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.monitor_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); /** * The column monitor.name. Monitor's name */ - public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255).nullable(false), this, "Monitor's name"); + public final TableField NAME = createField(DSL.name("name"), org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, "Monitor's name"); /** * The column monitor.url. URL to check */ - public final TableField URL = createField(DSL.name("url"), SQLDataType.CLOB.nullable(false), this, "URL to check"); + public final TableField URL = createField(DSL.name("url"), org.jooq.impl.SQLDataType.CLOB.nullable(false), this, "URL to check"); /** * The column monitor.uptime_check_interval. Uptime checking interval in seconds */ - public final TableField UPTIME_CHECK_INTERVAL = createField(DSL.name("uptime_check_interval"), SQLDataType.INTEGER.nullable(false), this, "Uptime checking interval in seconds"); + public final TableField UPTIME_CHECK_INTERVAL = createField(DSL.name("uptime_check_interval"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "Uptime checking interval in seconds"); /** * The column monitor.enabled. Flag to toggle the monitor */ - public final TableField ENABLED = createField(DSL.name("enabled"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field("true", SQLDataType.BOOLEAN)), this, "Flag to toggle the monitor"); + public final TableField ENABLED = createField(DSL.name("enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("true", org.jooq.impl.SQLDataType.BOOLEAN)), this, "Flag to toggle the monitor"); /** * The column monitor.created_at. */ - public final TableField CREATED_AT = createField(DSL.name("created_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); + public final TableField CREATED_AT = createField(DSL.name("created_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, ""); /** * The column monitor.updated_at. */ - public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, ""); + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE, this, ""); /** * The column monitor.ssl_check_enabled. */ - public final TableField SSL_CHECK_ENABLED = createField(DSL.name("ssl_check_enabled"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.field("false", SQLDataType.BOOLEAN)), this, ""); + public final TableField SSL_CHECK_ENABLED = createField(DSL.name("ssl_check_enabled"), org.jooq.impl.SQLDataType.BOOLEAN.nullable(false).defaultValue(org.jooq.impl.DSL.field("false", org.jooq.impl.SQLDataType.BOOLEAN)), this, ""); /** * The column monitor.pagerduty_integration_key. */ - public final TableField PAGERDUTY_INTEGRATION_KEY = createField(DSL.name("pagerduty_integration_key"), SQLDataType.VARCHAR, this, ""); + public final TableField PAGERDUTY_INTEGRATION_KEY = createField(DSL.name("pagerduty_integration_key"), org.jooq.impl.SQLDataType.VARCHAR, this, ""); - private Monitor(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private Monitor(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a monitor table reference + */ + public Monitor() { + this(DSL.name("monitor"), null); } /** @@ -116,11 +114,12 @@ public Monitor(Name alias) { this(alias, MONITOR); } - /** - * Create a monitor table reference - */ - public Monitor() { - this(DSL.name("monitor"), null); + private Monitor(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Monitor(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } public Monitor(Table child, ForeignKey key) { @@ -134,7 +133,7 @@ public Schema getSchema() { @Override public Identity getIdentity() { - return (Identity) super.getIdentity(); + return Keys.IDENTITY_MONITOR; } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java index 8183fbf..ca91bc4 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/SslEvent.java @@ -27,7 +27,6 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; -import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -37,7 +36,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class SslEvent extends TableImpl { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2029223819; /** * The reference instance of ssl_event @@ -55,44 +54,43 @@ public Class getRecordType() { /** * The column ssl_event.id. */ - public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.ssl_event_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); /** * The column ssl_event.monitor_id. */ - public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); /** * The column ssl_event.status. Status of the event */ - public final TableField STATUS = createField(DSL.name("status"), SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.SslStatus.class), this, "Status of the event"); + public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.SslStatus.class), this, "Status of the event"); /** * The column ssl_event.error. */ - public final TableField ERROR = createField(DSL.name("error"), SQLDataType.CLOB, this, ""); + public final TableField ERROR = createField(DSL.name("error"), org.jooq.impl.SQLDataType.CLOB, this, ""); /** * The column ssl_event.started_at. The current event started at */ - public final TableField STARTED_AT = createField(DSL.name("started_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); + public final TableField STARTED_AT = createField(DSL.name("started_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); /** * The column ssl_event.ended_at. The current event ended at */ - public final TableField ENDED_AT = createField(DSL.name("ended_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, "The current event ended at"); + public final TableField ENDED_AT = createField(DSL.name("ended_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE, this, "The current event ended at"); /** * The column ssl_event.updated_at. */ - public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false), this, ""); - private SslEvent(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private SslEvent(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a ssl_event table reference + */ + public SslEvent() { + this(DSL.name("ssl_event"), null); } /** @@ -109,11 +107,12 @@ public SslEvent(Name alias) { this(alias, SSL_EVENT); } - /** - * Create a ssl_event table reference - */ - public SslEvent() { - this(DSL.name("ssl_event"), null); + private SslEvent(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private SslEvent(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } public SslEvent(Table child, ForeignKey key) { @@ -132,7 +131,7 @@ public List getIndexes() { @Override public Identity getIdentity() { - return (Identity) super.getIdentity(); + return Keys.IDENTITY_SSL_EVENT; } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java index 6066a72..78d7f57 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/UptimeEvent.java @@ -27,7 +27,6 @@ import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.impl.DSL; -import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -37,7 +36,7 @@ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class UptimeEvent extends TableImpl { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1860882345; /** * The reference instance of uptime_event @@ -55,44 +54,43 @@ public Class getRecordType() { /** * The column uptime_event.id. */ - public final TableField ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); + public final TableField ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('kuvasz.uptime_event_id_seq'::regclass)", org.jooq.impl.SQLDataType.INTEGER)), this, ""); /** * The column uptime_event.monitor_id. */ - public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), SQLDataType.INTEGER.nullable(false), this, ""); + public final TableField MONITOR_ID = createField(DSL.name("monitor_id"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); /** * The column uptime_event.status. Status of the event */ - public final TableField STATUS = createField(DSL.name("status"), SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.UptimeStatus.class), this, "Status of the event"); + public final TableField STATUS = createField(DSL.name("status"), org.jooq.impl.SQLDataType.VARCHAR.nullable(false).asEnumDataType(com.kuvaszuptime.kuvasz.enums.UptimeStatus.class), this, "Status of the event"); /** * The column uptime_event.error. */ - public final TableField ERROR = createField(DSL.name("error"), SQLDataType.CLOB, this, ""); + public final TableField ERROR = createField(DSL.name("error"), org.jooq.impl.SQLDataType.CLOB, this, ""); /** * The column uptime_event.started_at. The current event started at */ - public final TableField STARTED_AT = createField(DSL.name("started_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); + public final TableField STARTED_AT = createField(DSL.name("started_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false).defaultValue(org.jooq.impl.DSL.field("now()", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "The current event started at"); /** * The column uptime_event.ended_at. The current event ended at */ - public final TableField ENDED_AT = createField(DSL.name("ended_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6), this, "The current event ended at"); + public final TableField ENDED_AT = createField(DSL.name("ended_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE, this, "The current event ended at"); /** * The column uptime_event.updated_at. */ - public final TableField UPDATED_AT = createField(DSL.name("updated_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).nullable(false), this, ""); + public final TableField UPDATED_AT = createField(DSL.name("updated_at"), org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE.nullable(false), this, ""); - private UptimeEvent(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private UptimeEvent(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + /** + * Create a uptime_event table reference + */ + public UptimeEvent() { + this(DSL.name("uptime_event"), null); } /** @@ -109,11 +107,12 @@ public UptimeEvent(Name alias) { this(alias, UPTIME_EVENT); } - /** - * Create a uptime_event table reference - */ - public UptimeEvent() { - this(DSL.name("uptime_event"), null); + private UptimeEvent(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private UptimeEvent(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); } public UptimeEvent(Table child, ForeignKey key) { @@ -132,7 +131,7 @@ public List getIndexes() { @Override public Identity getIdentity() { - return (Identity) super.getIdentity(); + return Keys.IDENTITY_UPTIME_EVENT; } @Override diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java index 39d887e..730046c 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/LatencyLogPojo.java @@ -23,19 +23,15 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "latency_log", - uniqueConstraints = { - @UniqueConstraint(name = "latency_log_pkey", columnNames = { "id" }) - }, - indexes = { - @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), - @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") - } -) +@Table(name = "latency_log", uniqueConstraints = { + @UniqueConstraint(name = "latency_log_pkey", columnNames = {"id"}) +}, indexes = { + @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), + @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") +}) public class LatencyLogPojo implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1568220283; private Integer id; private Integer monitorId; @@ -63,9 +59,6 @@ public LatencyLogPojo( this.createdAt = createdAt; } - /** - * Getter for latency_log.id. - */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -73,59 +66,38 @@ public Integer getId() { return this.id; } - /** - * Setter for latency_log.id. - */ public LatencyLogPojo setId(Integer id) { this.id = id; return this; } - /** - * Getter for latency_log.monitor_id. - */ @Column(name = "monitor_id", nullable = false, precision = 32) @NotNull public Integer getMonitorId() { return this.monitorId; } - /** - * Setter for latency_log.monitor_id. - */ public LatencyLogPojo setMonitorId(Integer monitorId) { this.monitorId = monitorId; return this; } - /** - * Getter for latency_log.latency. Lateny in ms - */ @Column(name = "latency", nullable = false, precision = 32) @NotNull public Integer getLatency() { return this.latency; } - /** - * Setter for latency_log.latency. Lateny in ms - */ public LatencyLogPojo setLatency(Integer latency) { this.latency = latency; return this; } - /** - * Getter for latency_log.created_at. - */ - @Column(name = "created_at", nullable = false, precision = 6) + @Column(name = "created_at", nullable = false) public OffsetDateTime getCreatedAt() { return this.createdAt; } - /** - * Setter for latency_log.created_at. - */ public LatencyLogPojo setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java index 0aa088d..89ea8a4 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/MonitorPojo.java @@ -23,16 +23,13 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "monitor", - uniqueConstraints = { - @UniqueConstraint(name = "monitor_pkey", columnNames = { "id" }), - @UniqueConstraint(name = "unique_monitor_name", columnNames = { "name" }) - } -) +@Table(name = "monitor", uniqueConstraints = { + @UniqueConstraint(name = "monitor_pkey", columnNames = {"id"}), + @UniqueConstraint(name = "unique_monitor_name", columnNames = {"name"}) +}) public class MonitorPojo implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1828922669; private Integer id; private String name; @@ -80,9 +77,6 @@ public MonitorPojo( this.pagerdutyIntegrationKey = pagerdutyIntegrationKey; } - /** - * Getter for monitor.id. - */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -90,17 +84,11 @@ public Integer getId() { return this.id; } - /** - * Setter for monitor.id. - */ public MonitorPojo setId(Integer id) { this.id = id; return this; } - /** - * Getter for monitor.name. Monitor's name - */ @Column(name = "name", nullable = false, length = 255) @NotNull @Size(max = 255) @@ -108,123 +96,78 @@ public String getName() { return this.name; } - /** - * Setter for monitor.name. Monitor's name - */ public MonitorPojo setName(String name) { this.name = name; return this; } - /** - * Getter for monitor.url. URL to check - */ @Column(name = "url", nullable = false) @NotNull public String getUrl() { return this.url; } - /** - * Setter for monitor.url. URL to check - */ public MonitorPojo setUrl(String url) { this.url = url; return this; } - /** - * Getter for monitor.uptime_check_interval. Uptime checking interval in seconds - */ @Column(name = "uptime_check_interval", nullable = false, precision = 32) @NotNull public Integer getUptimeCheckInterval() { return this.uptimeCheckInterval; } - /** - * Setter for monitor.uptime_check_interval. Uptime checking interval in seconds - */ public MonitorPojo setUptimeCheckInterval(Integer uptimeCheckInterval) { this.uptimeCheckInterval = uptimeCheckInterval; return this; } - /** - * Getter for monitor.enabled. Flag to toggle the monitor - */ @Column(name = "enabled", nullable = false) public Boolean getEnabled() { return this.enabled; } - /** - * Setter for monitor.enabled. Flag to toggle the monitor - */ public MonitorPojo setEnabled(Boolean enabled) { this.enabled = enabled; return this; } - /** - * Getter for monitor.created_at. - */ - @Column(name = "created_at", nullable = false, precision = 6) + @Column(name = "created_at", nullable = false) public OffsetDateTime getCreatedAt() { return this.createdAt; } - /** - * Setter for monitor.created_at. - */ public MonitorPojo setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; return this; } - /** - * Getter for monitor.updated_at. - */ - @Column(name = "updated_at", precision = 6) + @Column(name = "updated_at") public OffsetDateTime getUpdatedAt() { return this.updatedAt; } - /** - * Setter for monitor.updated_at. - */ public MonitorPojo setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; return this; } - /** - * Getter for monitor.ssl_check_enabled. - */ @Column(name = "ssl_check_enabled", nullable = false) public Boolean getSslCheckEnabled() { return this.sslCheckEnabled; } - /** - * Setter for monitor.ssl_check_enabled. - */ public MonitorPojo setSslCheckEnabled(Boolean sslCheckEnabled) { this.sslCheckEnabled = sslCheckEnabled; return this; } - /** - * Getter for monitor.pagerduty_integration_key. - */ @Column(name = "pagerduty_integration_key") public String getPagerdutyIntegrationKey() { return this.pagerdutyIntegrationKey; } - /** - * Setter for monitor.pagerduty_integration_key. - */ public MonitorPojo setPagerdutyIntegrationKey(String pagerdutyIntegrationKey) { this.pagerdutyIntegrationKey = pagerdutyIntegrationKey; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java index 9750bd2..e3ee89e 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/SslEventPojo.java @@ -25,20 +25,16 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "ssl_event", - uniqueConstraints = { - @UniqueConstraint(name = "ssl_event_pkey", columnNames = { "id" }), - @UniqueConstraint(name = "ssl_event_key", columnNames = { "monitor_id", "status", "ended_at" }) - }, - indexes = { - @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") - } -) +@Table(name = "ssl_event", uniqueConstraints = { + @UniqueConstraint(name = "ssl_event_pkey", columnNames = {"id"}), + @UniqueConstraint(name = "ssl_event_key", columnNames = {"monitor_id", "status", "ended_at"}) +}, indexes = { + @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") +}) public class SslEventPojo implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -231279334; private Integer id; private Integer monitorId; @@ -78,9 +74,6 @@ public SslEventPojo( this.updatedAt = updatedAt; } - /** - * Getter for ssl_event.id. - */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -88,108 +81,69 @@ public Integer getId() { return this.id; } - /** - * Setter for ssl_event.id. - */ public SslEventPojo setId(Integer id) { this.id = id; return this; } - /** - * Getter for ssl_event.monitor_id. - */ @Column(name = "monitor_id", nullable = false, precision = 32) @NotNull public Integer getMonitorId() { return this.monitorId; } - /** - * Setter for ssl_event.monitor_id. - */ public SslEventPojo setMonitorId(Integer monitorId) { this.monitorId = monitorId; return this; } - /** - * Getter for ssl_event.status. Status of the event - */ @Column(name = "status", nullable = false) @NotNull public SslStatus getStatus() { return this.status; } - /** - * Setter for ssl_event.status. Status of the event - */ public SslEventPojo setStatus(SslStatus status) { this.status = status; return this; } - /** - * Getter for ssl_event.error. - */ @Column(name = "error") public String getError() { return this.error; } - /** - * Setter for ssl_event.error. - */ public SslEventPojo setError(String error) { this.error = error; return this; } - /** - * Getter for ssl_event.started_at. The current event started at - */ - @Column(name = "started_at", nullable = false, precision = 6) + @Column(name = "started_at", nullable = false) public OffsetDateTime getStartedAt() { return this.startedAt; } - /** - * Setter for ssl_event.started_at. The current event started at - */ public SslEventPojo setStartedAt(OffsetDateTime startedAt) { this.startedAt = startedAt; return this; } - /** - * Getter for ssl_event.ended_at. The current event ended at - */ - @Column(name = "ended_at", precision = 6) + @Column(name = "ended_at") public OffsetDateTime getEndedAt() { return this.endedAt; } - /** - * Setter for ssl_event.ended_at. The current event ended at - */ public SslEventPojo setEndedAt(OffsetDateTime endedAt) { this.endedAt = endedAt; return this; } - /** - * Getter for ssl_event.updated_at. - */ - @Column(name = "updated_at", nullable = false, precision = 6) + @Column(name = "updated_at", nullable = false) @NotNull public OffsetDateTime getUpdatedAt() { return this.updatedAt; } - /** - * Setter for ssl_event.updated_at. - */ public SslEventPojo setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java index 5178a78..e1ed1b4 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/pojos/UptimeEventPojo.java @@ -25,20 +25,16 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "uptime_event", - uniqueConstraints = { - @UniqueConstraint(name = "uptime_event_pkey", columnNames = { "id" }), - @UniqueConstraint(name = "uptime_event_key", columnNames = { "monitor_id", "status", "ended_at" }) - }, - indexes = { - @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") - } -) +@Table(name = "uptime_event", uniqueConstraints = { + @UniqueConstraint(name = "uptime_event_pkey", columnNames = {"id"}), + @UniqueConstraint(name = "uptime_event_key", columnNames = {"monitor_id", "status", "ended_at"}) +}, indexes = { + @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") +}) public class UptimeEventPojo implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1847709210; private Integer id; private Integer monitorId; @@ -78,9 +74,6 @@ public UptimeEventPojo( this.updatedAt = updatedAt; } - /** - * Getter for uptime_event.id. - */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", nullable = false, precision = 32) @@ -88,108 +81,69 @@ public Integer getId() { return this.id; } - /** - * Setter for uptime_event.id. - */ public UptimeEventPojo setId(Integer id) { this.id = id; return this; } - /** - * Getter for uptime_event.monitor_id. - */ @Column(name = "monitor_id", nullable = false, precision = 32) @NotNull public Integer getMonitorId() { return this.monitorId; } - /** - * Setter for uptime_event.monitor_id. - */ public UptimeEventPojo setMonitorId(Integer monitorId) { this.monitorId = monitorId; return this; } - /** - * Getter for uptime_event.status. Status of the event - */ @Column(name = "status", nullable = false) @NotNull public UptimeStatus getStatus() { return this.status; } - /** - * Setter for uptime_event.status. Status of the event - */ public UptimeEventPojo setStatus(UptimeStatus status) { this.status = status; return this; } - /** - * Getter for uptime_event.error. - */ @Column(name = "error") public String getError() { return this.error; } - /** - * Setter for uptime_event.error. - */ public UptimeEventPojo setError(String error) { this.error = error; return this; } - /** - * Getter for uptime_event.started_at. The current event started at - */ - @Column(name = "started_at", nullable = false, precision = 6) + @Column(name = "started_at", nullable = false) public OffsetDateTime getStartedAt() { return this.startedAt; } - /** - * Setter for uptime_event.started_at. The current event started at - */ public UptimeEventPojo setStartedAt(OffsetDateTime startedAt) { this.startedAt = startedAt; return this; } - /** - * Getter for uptime_event.ended_at. The current event ended at - */ - @Column(name = "ended_at", precision = 6) + @Column(name = "ended_at") public OffsetDateTime getEndedAt() { return this.endedAt; } - /** - * Setter for uptime_event.ended_at. The current event ended at - */ public UptimeEventPojo setEndedAt(OffsetDateTime endedAt) { this.endedAt = endedAt; return this; } - /** - * Getter for uptime_event.updated_at. - */ - @Column(name = "updated_at", nullable = false, precision = 6) + @Column(name = "updated_at", nullable = false) @NotNull public OffsetDateTime getUpdatedAt() { return this.updatedAt; } - /** - * Setter for uptime_event.updated_at. - */ public UptimeEventPojo setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; return this; diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java index 9590824..fc7f817 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/LatencyLogRecord.java @@ -30,19 +30,15 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "latency_log", - uniqueConstraints = { - @UniqueConstraint(name = "latency_log_pkey", columnNames = { "id" }) - }, - indexes = { - @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), - @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") - } -) +@Table(name = "latency_log", uniqueConstraints = { + @UniqueConstraint(name = "latency_log_pkey", columnNames = {"id"}) +}, indexes = { + @Index(name = "latency_log_latency_idx", columnList = "latency ASC"), + @Index(name = "latency_log_monitor_idx", columnList = "monitor_id ASC") +}) public class LatencyLogRecord extends UpdatableRecordImpl implements Record4 { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 936267229; /** * Setter for latency_log.id. @@ -107,7 +103,7 @@ public LatencyLogRecord setCreatedAt(OffsetDateTime value) { /** * Getter for latency_log.created_at. */ - @Column(name = "created_at", nullable = false, precision = 6) + @Column(name = "created_at", nullable = false) public OffsetDateTime getCreatedAt() { return (OffsetDateTime) get(3); } @@ -245,9 +241,9 @@ public LatencyLogRecord() { public LatencyLogRecord(Integer id, Integer monitorId, Integer latency, OffsetDateTime createdAt) { super(LatencyLog.LATENCY_LOG); - setId(id); - setMonitorId(monitorId); - setLatency(latency); - setCreatedAt(createdAt); + set(0, id); + set(1, monitorId); + set(2, latency); + set(3, createdAt); } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java index a4ec7b1..a09069e 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/MonitorRecord.java @@ -30,16 +30,13 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "monitor", - uniqueConstraints = { - @UniqueConstraint(name = "monitor_pkey", columnNames = { "id" }), - @UniqueConstraint(name = "unique_monitor_name", columnNames = { "name" }) - } -) +@Table(name = "monitor", uniqueConstraints = { + @UniqueConstraint(name = "monitor_pkey", columnNames = {"id"}), + @UniqueConstraint(name = "unique_monitor_name", columnNames = {"name"}) +}) public class MonitorRecord extends UpdatableRecordImpl implements Record9 { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1258639093; /** * Setter for monitor.id. @@ -138,7 +135,7 @@ public MonitorRecord setCreatedAt(OffsetDateTime value) { /** * Getter for monitor.created_at. */ - @Column(name = "created_at", nullable = false, precision = 6) + @Column(name = "created_at", nullable = false) public OffsetDateTime getCreatedAt() { return (OffsetDateTime) get(5); } @@ -154,7 +151,7 @@ public MonitorRecord setUpdatedAt(OffsetDateTime value) { /** * Getter for monitor.updated_at. */ - @Column(name = "updated_at", precision = 6) + @Column(name = "updated_at") public OffsetDateTime getUpdatedAt() { return (OffsetDateTime) get(6); } @@ -434,14 +431,14 @@ public MonitorRecord() { public MonitorRecord(Integer id, String name, String url, Integer uptimeCheckInterval, Boolean enabled, OffsetDateTime createdAt, OffsetDateTime updatedAt, Boolean sslCheckEnabled, String pagerdutyIntegrationKey) { super(Monitor.MONITOR); - setId(id); - setName(name); - setUrl(url); - setUptimeCheckInterval(uptimeCheckInterval); - setEnabled(enabled); - setCreatedAt(createdAt); - setUpdatedAt(updatedAt); - setSslCheckEnabled(sslCheckEnabled); - setPagerdutyIntegrationKey(pagerdutyIntegrationKey); + set(0, id); + set(1, name); + set(2, url); + set(3, uptimeCheckInterval); + set(4, enabled); + set(5, createdAt); + set(6, updatedAt); + set(7, sslCheckEnabled); + set(8, pagerdutyIntegrationKey); } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java index 53a877d..02e4404 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/SslEventRecord.java @@ -31,20 +31,16 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "ssl_event", - uniqueConstraints = { - @UniqueConstraint(name = "ssl_event_pkey", columnNames = { "id" }), - @UniqueConstraint(name = "ssl_event_key", columnNames = { "monitor_id", "status", "ended_at" }) - }, - indexes = { - @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") - } -) +@Table(name = "ssl_event", uniqueConstraints = { + @UniqueConstraint(name = "ssl_event_pkey", columnNames = {"id"}), + @UniqueConstraint(name = "ssl_event_key", columnNames = {"monitor_id", "status", "ended_at"}) +}, indexes = { + @Index(name = "ssl_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "ssl_event_monitor_idx", columnList = "monitor_id ASC") +}) public class SslEventRecord extends UpdatableRecordImpl implements Record7 { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -877029403; /** * Setter for ssl_event.id. @@ -125,7 +121,7 @@ public SslEventRecord setStartedAt(OffsetDateTime value) { /** * Getter for ssl_event.started_at. The current event started at */ - @Column(name = "started_at", nullable = false, precision = 6) + @Column(name = "started_at", nullable = false) public OffsetDateTime getStartedAt() { return (OffsetDateTime) get(4); } @@ -141,7 +137,7 @@ public SslEventRecord setEndedAt(OffsetDateTime value) { /** * Getter for ssl_event.ended_at. The current event ended at */ - @Column(name = "ended_at", precision = 6) + @Column(name = "ended_at") public OffsetDateTime getEndedAt() { return (OffsetDateTime) get(5); } @@ -157,7 +153,7 @@ public SslEventRecord setUpdatedAt(OffsetDateTime value) { /** * Getter for ssl_event.updated_at. */ - @Column(name = "updated_at", nullable = false, precision = 6) + @Column(name = "updated_at", nullable = false) @NotNull public OffsetDateTime getUpdatedAt() { return (OffsetDateTime) get(6); @@ -362,12 +358,12 @@ public SslEventRecord() { public SslEventRecord(Integer id, Integer monitorId, SslStatus status, String error, OffsetDateTime startedAt, OffsetDateTime endedAt, OffsetDateTime updatedAt) { super(SslEvent.SSL_EVENT); - setId(id); - setMonitorId(monitorId); - setStatus(status); - setError(error); - setStartedAt(startedAt); - setEndedAt(endedAt); - setUpdatedAt(updatedAt); + set(0, id); + set(1, monitorId); + set(2, status); + set(3, error); + set(4, startedAt); + set(5, endedAt); + set(6, updatedAt); } } diff --git a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java index a8295c0..50873ba 100644 --- a/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java +++ b/src/jooq/java/com/kuvaszuptime/kuvasz/tables/records/UptimeEventRecord.java @@ -31,20 +31,16 @@ */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity -@Table( - name = "uptime_event", - uniqueConstraints = { - @UniqueConstraint(name = "uptime_event_pkey", columnNames = { "id" }), - @UniqueConstraint(name = "uptime_event_key", columnNames = { "monitor_id", "status", "ended_at" }) - }, - indexes = { - @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), - @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") - } -) +@Table(name = "uptime_event", uniqueConstraints = { + @UniqueConstraint(name = "uptime_event_pkey", columnNames = {"id"}), + @UniqueConstraint(name = "uptime_event_key", columnNames = {"monitor_id", "status", "ended_at"}) +}, indexes = { + @Index(name = "uptime_event_ended_at_idx", columnList = "ended_at ASC"), + @Index(name = "uptime_event_monitor_idx", columnList = "monitor_id ASC") +}) public class UptimeEventRecord extends UpdatableRecordImpl implements Record7 { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -32451597; /** * Setter for uptime_event.id. @@ -125,7 +121,7 @@ public UptimeEventRecord setStartedAt(OffsetDateTime value) { /** * Getter for uptime_event.started_at. The current event started at */ - @Column(name = "started_at", nullable = false, precision = 6) + @Column(name = "started_at", nullable = false) public OffsetDateTime getStartedAt() { return (OffsetDateTime) get(4); } @@ -141,7 +137,7 @@ public UptimeEventRecord setEndedAt(OffsetDateTime value) { /** * Getter for uptime_event.ended_at. The current event ended at */ - @Column(name = "ended_at", precision = 6) + @Column(name = "ended_at") public OffsetDateTime getEndedAt() { return (OffsetDateTime) get(5); } @@ -157,7 +153,7 @@ public UptimeEventRecord setUpdatedAt(OffsetDateTime value) { /** * Getter for uptime_event.updated_at. */ - @Column(name = "updated_at", nullable = false, precision = 6) + @Column(name = "updated_at", nullable = false) @NotNull public OffsetDateTime getUpdatedAt() { return (OffsetDateTime) get(6); @@ -362,12 +358,12 @@ public UptimeEventRecord() { public UptimeEventRecord(Integer id, Integer monitorId, UptimeStatus status, String error, OffsetDateTime startedAt, OffsetDateTime endedAt, OffsetDateTime updatedAt) { super(UptimeEvent.UPTIME_EVENT); - setId(id); - setMonitorId(monitorId); - setStatus(status); - setError(error); - setStartedAt(startedAt); - setEndedAt(endedAt); - setUpdatedAt(updatedAt); + set(0, id); + set(1, monitorId); + set(2, status); + set(3, error); + set(4, startedAt); + set(5, endedAt); + set(6, updatedAt); } }