From 32c16d854cbb849776111bba969555dabb1cc93b Mon Sep 17 00:00:00 2001 From: Milenko Supic Date: Mon, 3 Apr 2023 14:49:58 +0200 Subject: [PATCH] Added metadata for `org.jooq:jooq:3.17.7` (#257) * Added metadata for `org.jooq:jooq:3.17.7` * Added more tests and test metadata * Added more tests and fixed checkstyle --- metadata/index.json | 4 + metadata/org.jooq/jooq/3.17.7/index.json | 3 + .../org.jooq/jooq/3.17.7/reflect-config.json | 303 +++++++++++++++++ metadata/org.jooq/jooq/index.json | 10 + tests/src/index.json | 11 + tests/src/org.jooq/jooq/3.17.7/.gitignore | 4 + tests/src/org.jooq/jooq/3.17.7/README.md | 7 + .../org.jooq/jooq/3.17.7/access-filter.json | 10 + tests/src/org.jooq/jooq/3.17.7/build.gradle | 42 +++ .../org.jooq/jooq/3.17.7/generate-metadata.sh | 5 + .../org.jooq/jooq/3.17.7/gradle.properties | 2 + .../3.17.7/metadata-user-code-filter.json | 10 + .../src/org.jooq/jooq/3.17.7/settings.gradle | 13 + .../src/test/java/org_jooq/jooq/JooqTest.java | 319 ++++++++++++++++++ .../java/org_jooq/jooq/model/College.java | 85 +++++ .../org_jooq/jooq/model/DefaultCatalog.java | 57 ++++ .../test/java/org_jooq/jooq/model/Keys.java | 53 +++ .../test/java/org_jooq/jooq/model/Tables.java | 47 +++ .../org_jooq/jooq/model/tables/Course.java | 200 +++++++++++ .../jooq/model/tables/CourseMaterial.java | 205 +++++++++++ .../org_jooq/jooq/model/tables/Student.java | 197 +++++++++++ .../jooq/model/tables/StudentCourse.java | 194 +++++++++++ .../org_jooq/jooq/model/tables/Teacher.java | 181 ++++++++++ .../tables/records/CourseMaterialRecord.java | 184 ++++++++++ .../model/tables/records/CourseRecord.java | 184 ++++++++++ .../tables/records/StudentCourseRecord.java | 137 ++++++++ .../model/tables/records/StudentRecord.java | 297 ++++++++++++++++ .../model/tables/records/TeacherRecord.java | 184 ++++++++++ .../java/org_jooq/jooq/proxy/CourseProxy.java | 22 ++ .../native-image/tests-only/proxy-config.json | 10 + .../tests-only/reflect-config.json | 100 ++++++ .../3.17.7/src/test/resources/logback.xml | 16 + 32 files changed, 3096 insertions(+) create mode 100644 metadata/org.jooq/jooq/3.17.7/index.json create mode 100644 metadata/org.jooq/jooq/3.17.7/reflect-config.json create mode 100644 metadata/org.jooq/jooq/index.json create mode 100644 tests/src/org.jooq/jooq/3.17.7/.gitignore create mode 100644 tests/src/org.jooq/jooq/3.17.7/README.md create mode 100644 tests/src/org.jooq/jooq/3.17.7/access-filter.json create mode 100644 tests/src/org.jooq/jooq/3.17.7/build.gradle create mode 100644 tests/src/org.jooq/jooq/3.17.7/generate-metadata.sh create mode 100644 tests/src/org.jooq/jooq/3.17.7/gradle.properties create mode 100644 tests/src/org.jooq/jooq/3.17.7/metadata-user-code-filter.json create mode 100644 tests/src/org.jooq/jooq/3.17.7/settings.gradle create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/JooqTest.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/College.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/DefaultCatalog.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Keys.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Tables.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Course.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/CourseMaterial.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Student.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/StudentCourse.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Teacher.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseMaterialRecord.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseRecord.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentCourseRecord.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentRecord.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/TeacherRecord.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/proxy/CourseProxy.java create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/proxy-config.json create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/reflect-config.json create mode 100644 tests/src/org.jooq/jooq/3.17.7/src/test/resources/logback.xml diff --git a/metadata/index.json b/metadata/index.json index 7a6d71c4e..0b654fbc2 100644 --- a/metadata/index.json +++ b/metadata/index.json @@ -19,6 +19,10 @@ "org.jline:jline" ] }, + { + "directory" : "org.jooq/jooq", + "module" : "org.jooq:jooq" + }, { "directory": "com.h2database/h2", "module": "com.h2database:h2" diff --git a/metadata/org.jooq/jooq/3.17.7/index.json b/metadata/org.jooq/jooq/3.17.7/index.json new file mode 100644 index 000000000..768b5502a --- /dev/null +++ b/metadata/org.jooq/jooq/3.17.7/index.json @@ -0,0 +1,3 @@ +[ + "reflect-config.json" +] diff --git a/metadata/org.jooq/jooq/3.17.7/reflect-config.json b/metadata/org.jooq/jooq/3.17.7/reflect-config.json new file mode 100644 index 000000000..f55ede991 --- /dev/null +++ b/metadata/org.jooq/jooq/3.17.7/reflect-config.json @@ -0,0 +1,303 @@ +[ + { + "name": "[Ljava.lang.Boolean;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.Byte;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.Double;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.Float;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.Integer;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.Long;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.Object;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.Short;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.lang.String;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.math.BigDecimal;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.math.BigInteger;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.sql.Date;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.sql.Time;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.sql.Timestamp;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.time.Instant;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.time.LocalDate;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.time.LocalDateTime;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.time.LocalTime;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.time.OffsetDateTime;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.time.OffsetTime;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Ljava.util.UUID;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.Geography;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.Geometry;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.JSON;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.JSONB;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.Record;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.Result;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.RowId;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.XML;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.types.DayToSecond;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.types.UByte;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.types.UInteger;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.types.ULong;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.types.UShort;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.types.YearToMonth;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "[Lorg.jooq.types.YearToSecond;", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.impl.SQLDataType", + "condition": { + "typeReachable": "org.jooq.impl.DefaultDSLContext" + } + }, + { + "name": "org.jooq.impl.SQLDataType", + "condition": { + "typeReachable": "org.jooq.impl.DefaultDataType" + } + }, + { + "name": "org.jooq.impl.SQLDataType", + "allPublicFields": true, + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.cubrid.CUBRIDDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.derby.DerbyDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.firebird.FirebirdDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.h2.H2DataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.hsqldb.HSQLDBDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.ignite.IgniteDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.mariadb.MariaDBDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.mysql.MySQLDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.postgres.PostgresDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.sqlite.SQLiteDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + }, + { + "name": "org.jooq.util.yugabytedb.YugabyteDBDataType", + "condition": { + "typeReachable": "org.jooq.impl.SQLDataType" + } + } +] diff --git a/metadata/org.jooq/jooq/index.json b/metadata/org.jooq/jooq/index.json new file mode 100644 index 000000000..5f098937b --- /dev/null +++ b/metadata/org.jooq/jooq/index.json @@ -0,0 +1,10 @@ +[ + { + "latest": true, + "metadata-version": "3.17.7", + "module": "org.jooq:jooq", + "tested-versions": [ + "3.17.7" + ] + } +] diff --git a/tests/src/index.json b/tests/src/index.json index 7da623b9f..3dd7a6a36 100644 --- a/tests/src/index.json +++ b/tests/src/index.json @@ -21,6 +21,17 @@ } ] }, + { + "test-project-path": "org.jooq/jooq/3.17.7", + "libraries": [ + { + "name": "org.jooq:jooq", + "versions": [ + "3.17.7" + ] + } + ] + }, { "test-project-path": "com.h2database/h2/2.1.210", "libraries": [ diff --git a/tests/src/org.jooq/jooq/3.17.7/.gitignore b/tests/src/org.jooq/jooq/3.17.7/.gitignore new file mode 100644 index 000000000..c98c7875b --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/.gitignore @@ -0,0 +1,4 @@ +gradlew.bat +gradlew +gradle/ +build/ diff --git a/tests/src/org.jooq/jooq/3.17.7/README.md b/tests/src/org.jooq/jooq/3.17.7/README.md new file mode 100644 index 000000000..3df0a24f2 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/README.md @@ -0,0 +1,7 @@ +The metadata has been generated by executing the following script: + +```bash +./generate-metadata.sh +``` + +The generated metadata can be found in the `build/native/agent-output/test` directory. diff --git a/tests/src/org.jooq/jooq/3.17.7/access-filter.json b/tests/src/org.jooq/jooq/3.17.7/access-filter.json new file mode 100644 index 000000000..1f83a7fdb --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/access-filter.json @@ -0,0 +1,10 @@ +{ + "regexRules": [ + { + "includeClasses": "org\\.jooq.*" + }, + { + "includeClasses": "\\[L.*" + } + ] +} diff --git a/tests/src/org.jooq/jooq/3.17.7/build.gradle b/tests/src/org.jooq/jooq/3.17.7/build.gradle new file mode 100644 index 000000000..d72a0464c --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/build.gradle @@ -0,0 +1,42 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ + +plugins { + id "org.graalvm.internal.tck" +} + +String libraryVersion = tck.testedLibraryVersion.get() + +dependencies { + testImplementation "org.jooq:jooq:$libraryVersion" + testImplementation 'org.assertj:assertj-core:3.22.0' + testImplementation 'com.h2database:h2:2.1.214' + testImplementation 'ch.qos.logback:logback-classic:1.4.5' +} + +task updateGeneratedMetadata { + doLast { + final ant = new groovy.ant.AntBuilder() + final metadataDir = project.projectDir.toString() + "/build/native/agent-output/test" + // replace typeReachable value for entries generated by JooqTest test class + ant.replace(file: metadataDir + "/reflect-config.json", + token: "org_jooq.jooq.JooqTest", + value: "org.jooq.impl.SQLDataType") + } +} + +graalvmNative { + agent { + defaultMode = "conditional" + modes { + conditional { + userCodeFilterPath = "metadata-user-code-filter.json" + } + } + accessFilterFiles.from("access-filter.json") + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/generate-metadata.sh b/tests/src/org.jooq/jooq/3.17.7/generate-metadata.sh new file mode 100644 index 000000000..8a608f0c5 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/generate-metadata.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +./gradlew clean +./gradlew test --tests "org_jooq.jooq.JooqTest" -Pagent +./gradlew updateGeneratedMetadata diff --git a/tests/src/org.jooq/jooq/3.17.7/gradle.properties b/tests/src/org.jooq/jooq/3.17.7/gradle.properties new file mode 100644 index 000000000..569cfc7d5 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/gradle.properties @@ -0,0 +1,2 @@ +library.version = 3.17.7 +metadata.dir = org.jooq/jooq/3.17.7/ diff --git a/tests/src/org.jooq/jooq/3.17.7/metadata-user-code-filter.json b/tests/src/org.jooq/jooq/3.17.7/metadata-user-code-filter.json new file mode 100644 index 000000000..620b9f6ba --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/metadata-user-code-filter.json @@ -0,0 +1,10 @@ +{ + "rules": [ + { + "includeClasses": "org.jooq.**" + }, + { + "includeClasses": "org_jooq.jooq.JooqTest" + } + ] +} diff --git a/tests/src/org.jooq/jooq/3.17.7/settings.gradle b/tests/src/org.jooq/jooq/3.17.7/settings.gradle new file mode 100644 index 000000000..349e469f1 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/settings.gradle @@ -0,0 +1,13 @@ +pluginManagement { + def tckPath = Objects.requireNonNullElse( + System.getenv("GVM_TCK_TCKDIR"), + "../../../../tck-build-logic" + ) + includeBuild(tckPath) +} + +plugins { + id "org.graalvm.internal.tck-settings" version "1.0.0-SNAPSHOT" +} + +rootProject.name = 'org.jooq.jooq_tests' diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/JooqTest.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/JooqTest.java new file mode 100644 index 000000000..318bd64f9 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/JooqTest.java @@ -0,0 +1,319 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq; + +import org.jooq.DSLContext; +import org.jooq.SQLDialect; +import org.jooq.impl.BuiltInDataType; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org_jooq.jooq.model.tables.records.CourseMaterialRecord; +import org_jooq.jooq.model.tables.records.CourseRecord; +import org_jooq.jooq.model.tables.records.StudentCourseRecord; +import org_jooq.jooq.model.tables.records.StudentRecord; +import org_jooq.jooq.model.tables.records.TeacherRecord; +import org_jooq.jooq.proxy.CourseProxy; + +import java.lang.reflect.Field; +import java.sql.Connection; +import java.sql.DriverManager; +import java.time.LocalDate; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import static org.assertj.core.api.Assertions.assertThat; +import static org_jooq.jooq.model.College.COLLEGE; +import static org_jooq.jooq.model.Tables.COURSE; +import static org_jooq.jooq.model.Tables.COURSE_MATERIAL; +import static org_jooq.jooq.model.Tables.STUDENT; +import static org_jooq.jooq.model.Tables.STUDENT_COURSE; +import static org_jooq.jooq.model.Tables.TEACHER; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +class JooqTest { + + private static final String USERNAME = "fred"; + + private static final String PASSWORD = "secret"; + + private static final String JDBC_URL = "jdbc:h2:mem:default;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"; + + private final Map studentIds = new HashMap<>(); + + private final Map teacherIds = new HashMap<>(); + + private final Map courseIds = new HashMap<>(); + + private Connection conn; + + private DSLContext context; + + @BeforeAll + public void init() throws Exception { + Properties props = new Properties(); + props.setProperty("user", USERNAME); + props.setProperty("password", PASSWORD); + conn = DriverManager.getConnection(JDBC_URL, props); + context = DSL.using(conn, SQLDialect.H2); + createSchema(); + insertTestData(); + } + + @AfterAll + public void close() throws Exception { + deleteTestData(); + dropSchema(); + conn.close(); + } + + @Test + public void testLoadStudents() { + List students = context.select() + .from(STUDENT) + .orderBy(STUDENT.AGE.asc()) + .fetch() + .into(StudentRecord.class); + + assertThat(students) + .hasSize(5) + .extracting(StudentRecord::getId) + .containsExactly(studentIds.get("John Miller"), studentIds.get("Patricia Miller"), studentIds.get("Robert Smith"), + studentIds.get("John Smith"), studentIds.get("Mary Smith")); + + students = context.select() + .from(STUDENT) + .where(STUDENT.LAST_NAME.eq("Smith")) + .and(STUDENT.AGE.ge(25)) + .fetch() + .into(StudentRecord.class); + + assertThat(students) + .hasSize(2) + .extracting(StudentRecord::getId) + .containsExactly(studentIds.get("John Smith"), studentIds.get("Mary Smith")); + + students = context.select() + .from(STUDENT) + .join(STUDENT_COURSE).on(STUDENT_COURSE.STUDENT_ID.eq(STUDENT.ID)) + .join(COURSE).on(COURSE.ID.eq(STUDENT_COURSE.COURSE_ID)) + .where(COURSE.TITLE.eq("Statistics")) + .fetch() + .into(StudentRecord.class); + + assertThat(students) + .hasSize(3) + .extracting(StudentRecord::getId) + .containsExactly(studentIds.get("John Smith"), studentIds.get("Robert Smith"), studentIds.get("Mary Smith")); + + StudentRecord student = context.select() + .from(STUDENT) + .where(STUDENT.ID.eq(studentIds.get("John Smith"))) + .fetchSingle() + .into(StudentRecord.class); + + assertThat(student).isNotNull(); + assertThat(student.getFirstName()).isEqualTo("John"); + assertThat(student.getLastName()).isEqualTo("Smith"); + assertThat(student.getGender()).isEqualTo("male"); + assertThat(student.getAge()).isEqualTo(25); + } + + @Test + public void testLoadTeacher() { + TeacherRecord teacher = context.select() + .from(TEACHER) + .where(TEACHER.ID.eq(teacherIds.get("Jennifer Brown"))) + .fetchSingle() + .into(TeacherRecord.class); + + assertThat(teacher).isNotNull(); + assertThat(teacher.getFirstName()).isEqualTo("Jennifer"); + assertThat(teacher.getLastName()).isEqualTo("Brown"); + } + + @Test + public void testLoadCourse() { + CourseRecord course = context.select() + .from(COURSE) + .where(COURSE.ID.eq(courseIds.get("Statistics"))) + .fetchSingle() + .into(CourseRecord.class); + + List studentCourses = context.select() + .from(STUDENT_COURSE) + .where(STUDENT_COURSE.COURSE_ID.eq(courseIds.get("Statistics"))) + .fetch() + .into(StudentCourseRecord.class); + + assertThat(course).isNotNull(); + assertThat(course.getTitle()).isEqualTo("Statistics"); + assertThat(course.getTeacherId()).isEqualTo(teacherIds.get("Jennifer Brown")); + assertThat(studentCourses) + .hasSize(3) + .extracting(StudentCourseRecord::getStudentId) + .containsExactly(studentIds.get("John Smith"), studentIds.get("Robert Smith"), studentIds.get("Mary Smith")); + } + + @Test + public void testArrayDataTypes() throws Exception { + Set types = new HashSet<>(); + + for (Field field : SQLDataType.class.getFields()) { + Object value = field.get(null); + if (value instanceof BuiltInDataType) { + Class type = ((BuiltInDataType) value).getType(); + if (!type.isArray()) { + types.add(type); + } + } + } + + for (Class type : types) { + assertThat(Class.forName(type.arrayType().getName())).isNotNull(); + } + } + + @Test + public void testProxy() { + CourseProxy courseProxy = context.select() + .from(COURSE) + .where(COURSE.ID.eq(courseIds.get("Design"))) + .fetchSingle() + .into(CourseProxy.class); + + assertThat(courseProxy).isNotNull(); + assertThat(courseProxy.getTitle()).isEqualTo("Design"); + assertThat(courseProxy.getTeacherId()).isEqualTo(teacherIds.get("Richard Davis")); + } + + private void createSchema() { + context.createSchema(COLLEGE).execute(); + + context.createTable(STUDENT) + .columns(STUDENT.fields()) + .primaryKey(STUDENT.ID) + .execute(); + + context.createTable(TEACHER) + .columns(TEACHER.fields()) + .primaryKey(TEACHER.ID) + .execute(); + + context.createTable(COURSE) + .columns(COURSE.fields()) + .primaryKey(COURSE.ID) + .constraint(DSL.constraint("FK_COURSE_TEACHER_ID").foreignKey(COURSE.TEACHER_ID).references(TEACHER, TEACHER.ID)) + .execute(); + + context.createTable(COURSE_MATERIAL) + .columns(COURSE_MATERIAL.fields()) + .primaryKey(COURSE_MATERIAL.ID) + .constraint(DSL.constraint("FK_COURSE_MATERIAL_COURSE_ID").foreignKey(COURSE_MATERIAL.COURSE_ID).references(COURSE, COURSE.ID)) + .unique(COURSE_MATERIAL.COURSE_ID) + .execute(); + + context.createTable(STUDENT_COURSE) + .columns(STUDENT_COURSE.fields()) + .constraint(DSL.constraint("FK_STUDENT_COURSE_COURSE_ID").foreignKey(STUDENT_COURSE.STUDENT_ID).references(STUDENT, STUDENT.ID)) + .constraint(DSL.constraint("FK_STUDENT_COURSE_STUDENT_ID").foreignKey(STUDENT_COURSE.COURSE_ID).references(COURSE, COURSE.ID)) + .execute(); + } + + private void dropSchema() { + context.dropTable(STUDENT_COURSE).execute(); + context.dropTable(COURSE_MATERIAL).execute(); + context.dropTable(COURSE).execute(); + context.dropTable(TEACHER).execute(); + context.dropTable(STUDENT).execute(); + context.dropSchema(COLLEGE).execute(); + } + + private void insertTestData() { + StudentRecord student1 = createStudentRecord("John", "Smith", "male", 25); + StudentRecord student2 = createStudentRecord("Robert", "Smith", "male", 24); + StudentRecord student3 = createStudentRecord("John", "Miller", "male", 21); + StudentRecord student4 = createStudentRecord("Mary", "Smith", "female", 26); + StudentRecord student5 = createStudentRecord("Patricia", "Miller", "female", 22); + + TeacherRecord teacher1 = createTeacherRecord("Jennifer", "Brown"); + TeacherRecord teacher2 = createTeacherRecord("Richard", "Davis"); + + CourseRecord course1 = createCourseRecord("Statistics", teacher1.getId()); + CourseRecord course2 = createCourseRecord("Math", teacher1.getId()); + CourseRecord course3 = createCourseRecord("Design", teacher2.getId()); + + createStudentCourseRecord(course1.getId(), student1.getId()); + createStudentCourseRecord(course1.getId(), student2.getId()); + createStudentCourseRecord(course1.getId(), student4.getId()); + createStudentCourseRecord(course2.getId(), student1.getId()); + createStudentCourseRecord(course2.getId(), student2.getId()); + createStudentCourseRecord(course2.getId(), student4.getId()); + createStudentCourseRecord(course2.getId(), student5.getId()); + createStudentCourseRecord(course3.getId(), student3.getId()); + createStudentCourseRecord(course3.getId(), student4.getId()); + createStudentCourseRecord(course3.getId(), student5.getId()); + } + + private void deleteTestData() { + context.delete(STUDENT_COURSE).execute(); + context.delete(COURSE_MATERIAL).execute(); + context.delete(COURSE).execute(); + context.delete(TEACHER).execute(); + context.delete(STUDENT).execute(); + } + + private StudentRecord createStudentRecord(String firstName, String lastName, String gender, int age) { + StudentRecord student = context.newRecord(STUDENT); + student.setFirstName(firstName); + student.setLastName(lastName); + student.setGender(gender); + student.setAge(age); + student.setBirthDate(LocalDate.now()); + student.store(); + studentIds.put(firstName + " " + lastName, student.getId()); + return student; + } + + private TeacherRecord createTeacherRecord(String firstName, String lastName) { + TeacherRecord teacher = context.newRecord(TEACHER); + teacher.setFirstName(firstName); + teacher.setLastName(lastName); + teacher.store(); + teacherIds.put(firstName + " " + lastName, teacher.getId()); + return teacher; + } + + private CourseRecord createCourseRecord(String title, Long teacherId) { + CourseRecord course = context.newRecord(COURSE); + course.setTitle(title); + course.setTeacherId(teacherId); + course.store(); + courseIds.put(title, course.getId()); + + CourseMaterialRecord courseMaterial = context.newRecord(COURSE_MATERIAL); + courseMaterial.setUrl(title + "Url"); + courseMaterial.setCourseId(course.getId()); + courseMaterial.store(); + return course; + } + + private StudentCourseRecord createStudentCourseRecord(Long courseId, Long studentId) { + StudentCourseRecord studentCourse = context.newRecord(STUDENT_COURSE); + studentCourse.setCourseId(courseId); + studentCourse.setStudentId(studentId); + studentCourse.insert(); + return studentCourse; + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/College.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/College.java new file mode 100644 index 000000000..c5cc24aea --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/College.java @@ -0,0 +1,85 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model; + + +import java.util.Arrays; +import java.util.List; + +import org.jooq.Catalog; +import org.jooq.Table; +import org.jooq.impl.SchemaImpl; + +import org_jooq.jooq.model.tables.Course; +import org_jooq.jooq.model.tables.CourseMaterial; +import org_jooq.jooq.model.tables.Student; +import org_jooq.jooq.model.tables.StudentCourse; +import org_jooq.jooq.model.tables.Teacher; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class College extends SchemaImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of college + */ + public static final College COLLEGE = new College(); + + /** + * The table college.course. + */ + public final Course COURSE = Course.COURSE; + + /** + * The table college.course_material. + */ + public final CourseMaterial COURSE_MATERIAL = CourseMaterial.COURSE_MATERIAL; + + /** + * The table college.student. + */ + public final Student STUDENT = Student.STUDENT; + + /** + * The table college.student_course. + */ + public final StudentCourse STUDENT_COURSE = StudentCourse.STUDENT_COURSE; + + /** + * The table college.teacher. + */ + public final Teacher TEACHER = Teacher.TEACHER; + + /** + * No further instances allowed + */ + private College() { + super("college", null); + } + + + @Override + public Catalog getCatalog() { + return DefaultCatalog.DEFAULT_CATALOG; + } + + @Override + public final List> getTables() { + return Arrays.asList( + Course.COURSE, + CourseMaterial.COURSE_MATERIAL, + Student.STUDENT, + StudentCourse.STUDENT_COURSE, + Teacher.TEACHER + ); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/DefaultCatalog.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/DefaultCatalog.java new file mode 100644 index 000000000..ab24771ef --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/DefaultCatalog.java @@ -0,0 +1,57 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model; + + +import java.util.Arrays; +import java.util.List; + +import org.jooq.Constants; +import org.jooq.Schema; +import org.jooq.impl.CatalogImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class DefaultCatalog extends CatalogImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of DEFAULT_CATALOG + */ + public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog(); + + /** + * The schema college. + */ + public final College COLLEGE = College.COLLEGE; + + /** + * No further instances allowed + */ + private DefaultCatalog() { + super(""); + } + + @Override + public final List getSchemas() { + return Arrays.asList( + College.COLLEGE + ); + } + + /** + * A reference to the 3.17 minor release of the code generator. If this + * doesn't compile, it's because the runtime library uses an older minor + * release, namely: 3.17. You can turn off the generation of this reference + * by specifying /configuration/generator/generate/jooqVersionReference + */ + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_17; +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Keys.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Keys.java new file mode 100644 index 000000000..14f047cdf --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Keys.java @@ -0,0 +1,53 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model; + + +import org.jooq.ForeignKey; +import org.jooq.TableField; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + +import org_jooq.jooq.model.tables.Course; +import org_jooq.jooq.model.tables.CourseMaterial; +import org_jooq.jooq.model.tables.Student; +import org_jooq.jooq.model.tables.StudentCourse; +import org_jooq.jooq.model.tables.Teacher; +import org_jooq.jooq.model.tables.records.CourseMaterialRecord; +import org_jooq.jooq.model.tables.records.CourseRecord; +import org_jooq.jooq.model.tables.records.StudentCourseRecord; +import org_jooq.jooq.model.tables.records.StudentRecord; +import org_jooq.jooq.model.tables.records.TeacherRecord; + + +/** + * A class modelling foreign key relationships and constraints of tables in + * college. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Keys { + + // ------------------------------------------------------------------------- + // UNIQUE and PRIMARY KEY definitions + // ------------------------------------------------------------------------- + + public static final UniqueKey KEY_COURSE_PRIMARY = Internal.createUniqueKey(Course.COURSE, DSL.name("KEY_course_PRIMARY"), new TableField[] { Course.COURSE.ID }, true); + public static final UniqueKey KEY_COURSE_MATERIAL_COURSE_ID = Internal.createUniqueKey(CourseMaterial.COURSE_MATERIAL, DSL.name("KEY_course_material_course_id"), new TableField[] { CourseMaterial.COURSE_MATERIAL.COURSE_ID }, true); + public static final UniqueKey KEY_COURSE_MATERIAL_PRIMARY = Internal.createUniqueKey(CourseMaterial.COURSE_MATERIAL, DSL.name("KEY_course_material_PRIMARY"), new TableField[] { CourseMaterial.COURSE_MATERIAL.ID }, true); + public static final UniqueKey KEY_STUDENT_PRIMARY = Internal.createUniqueKey(Student.STUDENT, DSL.name("KEY_student_PRIMARY"), new TableField[] { Student.STUDENT.ID }, true); + public static final UniqueKey KEY_TEACHER_PRIMARY = Internal.createUniqueKey(Teacher.TEACHER, DSL.name("KEY_teacher_PRIMARY"), new TableField[] { Teacher.TEACHER.ID }, true); + + // ------------------------------------------------------------------------- + // FOREIGN KEY definitions + // ------------------------------------------------------------------------- + + public static final ForeignKey FK_COURSE_TEACHER_ID = Internal.createForeignKey(Course.COURSE, DSL.name("FK_COURSE_TEACHER_ID"), new TableField[] { Course.COURSE.TEACHER_ID }, Keys.KEY_TEACHER_PRIMARY, new TableField[] { Teacher.TEACHER.ID }, true); + public static final ForeignKey FK_COURSE_MATERIAL_COURSE_ID = Internal.createForeignKey(CourseMaterial.COURSE_MATERIAL, DSL.name("FK_COURSE_MATERIAL_COURSE_ID"), new TableField[] { CourseMaterial.COURSE_MATERIAL.COURSE_ID }, Keys.KEY_COURSE_PRIMARY, new TableField[] { Course.COURSE.ID }, true); + public static final ForeignKey FK_STUDENT_COURSE_COURSE_ID = Internal.createForeignKey(StudentCourse.STUDENT_COURSE, DSL.name("FK_STUDENT_COURSE_COURSE_ID"), new TableField[] { StudentCourse.STUDENT_COURSE.STUDENT_ID }, Keys.KEY_STUDENT_PRIMARY, new TableField[] { Student.STUDENT.ID }, true); + public static final ForeignKey FK_STUDENT_COURSE_STUDENT_ID = Internal.createForeignKey(StudentCourse.STUDENT_COURSE, DSL.name("FK_STUDENT_COURSE_STUDENT_ID"), new TableField[] { StudentCourse.STUDENT_COURSE.COURSE_ID }, Keys.KEY_COURSE_PRIMARY, new TableField[] { Course.COURSE.ID }, true); +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Tables.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Tables.java new file mode 100644 index 000000000..e16d7aeff --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/Tables.java @@ -0,0 +1,47 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model; + + +import org_jooq.jooq.model.tables.Course; +import org_jooq.jooq.model.tables.CourseMaterial; +import org_jooq.jooq.model.tables.Student; +import org_jooq.jooq.model.tables.StudentCourse; +import org_jooq.jooq.model.tables.Teacher; + + +/** + * Convenience access to all tables in college. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Tables { + + /** + * The table college.course. + */ + public static final Course COURSE = Course.COURSE; + + /** + * The table college.course_material. + */ + public static final CourseMaterial COURSE_MATERIAL = CourseMaterial.COURSE_MATERIAL; + + /** + * The table college.student. + */ + public static final Student STUDENT = Student.STUDENT; + + /** + * The table college.student_course. + */ + public static final StudentCourse STUDENT_COURSE = StudentCourse.STUDENT_COURSE; + + /** + * The table college.teacher. + */ + public static final Teacher TEACHER = Teacher.TEACHER; +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Course.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Course.java new file mode 100644 index 000000000..0a5f6e78a --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Course.java @@ -0,0 +1,200 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables; + + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function3; +import org.jooq.Identity; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import org_jooq.jooq.model.College; +import org_jooq.jooq.model.Keys; +import org_jooq.jooq.model.tables.records.CourseRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Course extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of college.course + */ + public static final Course COURSE = new Course(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CourseRecord.class; + } + + /** + * The column college.course.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); + + /** + * The column college.course.title. + */ + public final TableField TITLE = createField(DSL.name("title"), SQLDataType.VARCHAR(255), this, ""); + + /** + * The column college.course.teacher_id. + */ + public final TableField TEACHER_ID = createField(DSL.name("teacher_id"), SQLDataType.BIGINT, this, ""); + + private Course(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Course(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased college.course table reference + */ + public Course(String alias) { + this(DSL.name(alias), COURSE); + } + + /** + * Create an aliased college.course table reference + */ + public Course(Name alias) { + this(alias, COURSE); + } + + /** + * Create a college.course table reference + */ + public Course() { + this(DSL.name("course"), null); + } + + public Course(Table child, ForeignKey key) { + super(child, key, COURSE); + } + + @Override + public Schema getSchema() { + return aliased() ? null : College.COLLEGE; + } + + @Override + public Identity getIdentity() { + return (Identity) super.getIdentity(); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.KEY_COURSE_PRIMARY; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.FK_COURSE_TEACHER_ID); + } + + private transient Teacher _teacher; + + /** + * Get the implicit join path to the college.teacher table. + */ + public Teacher teacher() { + if (_teacher == null) + _teacher = new Teacher(this, Keys.FK_COURSE_TEACHER_ID); + + return _teacher; + } + + @Override + public Course as(String alias) { + return new Course(DSL.name(alias), this); + } + + @Override + public Course as(Name alias) { + return new Course(alias, this); + } + + @Override + public Course as(Table alias) { + return new Course(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Course rename(String name) { + return new Course(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Course rename(Name name) { + return new Course(name, null); + } + + /** + * Rename this table + */ + @Override + public Course rename(Table name) { + return new Course(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/CourseMaterial.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/CourseMaterial.java new file mode 100644 index 000000000..19cbfefcf --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/CourseMaterial.java @@ -0,0 +1,205 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables; + + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function3; +import org.jooq.Identity; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import org_jooq.jooq.model.College; +import org_jooq.jooq.model.Keys; +import org_jooq.jooq.model.tables.records.CourseMaterialRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class CourseMaterial extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of college.course_material + */ + public static final CourseMaterial COURSE_MATERIAL = new CourseMaterial(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return CourseMaterialRecord.class; + } + + /** + * The column college.course_material.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); + + /** + * The column college.course_material.url. + */ + public final TableField URL = createField(DSL.name("url"), SQLDataType.VARCHAR(255), this, ""); + + /** + * The column college.course_material.course_id. + */ + public final TableField COURSE_ID = createField(DSL.name("course_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + private CourseMaterial(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private CourseMaterial(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased college.course_material table reference + */ + public CourseMaterial(String alias) { + this(DSL.name(alias), COURSE_MATERIAL); + } + + /** + * Create an aliased college.course_material table reference + */ + public CourseMaterial(Name alias) { + this(alias, COURSE_MATERIAL); + } + + /** + * Create a college.course_material table reference + */ + public CourseMaterial() { + this(DSL.name("course_material"), null); + } + + public CourseMaterial(Table child, ForeignKey key) { + super(child, key, COURSE_MATERIAL); + } + + @Override + public Schema getSchema() { + return aliased() ? null : College.COLLEGE; + } + + @Override + public Identity getIdentity() { + return (Identity) super.getIdentity(); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.KEY_COURSE_MATERIAL_PRIMARY; + } + + @Override + public List> getUniqueKeys() { + return Arrays.asList(Keys.KEY_COURSE_MATERIAL_COURSE_ID); + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.FK_COURSE_MATERIAL_COURSE_ID); + } + + private transient Course _course; + + /** + * Get the implicit join path to the college.course table. + */ + public Course course() { + if (_course == null) + _course = new Course(this, Keys.FK_COURSE_MATERIAL_COURSE_ID); + + return _course; + } + + @Override + public CourseMaterial as(String alias) { + return new CourseMaterial(DSL.name(alias), this); + } + + @Override + public CourseMaterial as(Name alias) { + return new CourseMaterial(alias, this); + } + + @Override + public CourseMaterial as(Table alias) { + return new CourseMaterial(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public CourseMaterial rename(String name) { + return new CourseMaterial(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public CourseMaterial rename(Name name) { + return new CourseMaterial(name, null); + } + + /** + * Rename this table + */ + @Override + public CourseMaterial rename(Table name) { + return new CourseMaterial(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Student.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Student.java new file mode 100644 index 000000000..5dc44d0e6 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Student.java @@ -0,0 +1,197 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables; + + +import java.time.LocalDate; +import java.util.function.Function; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function6; +import org.jooq.Identity; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row6; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import org_jooq.jooq.model.College; +import org_jooq.jooq.model.Keys; +import org_jooq.jooq.model.tables.records.StudentRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Student extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of college.student + */ + public static final Student STUDENT = new Student(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return StudentRecord.class; + } + + /** + * The column college.student.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); + + /** + * The column college.student.age. + */ + public final TableField AGE = createField(DSL.name("age"), SQLDataType.INTEGER, this, ""); + + /** + * The column college.student.birth_date. + */ + public final TableField BIRTH_DATE = createField(DSL.name("birth_date"), SQLDataType.LOCALDATE, this, ""); + + /** + * The column college.student.first_name. + */ + public final TableField FIRST_NAME = createField(DSL.name("first_name"), SQLDataType.VARCHAR(255), this, ""); + + /** + * The column college.student.gender. + */ + public final TableField GENDER = createField(DSL.name("gender"), SQLDataType.VARCHAR(255), this, ""); + + /** + * The column college.student.last_name. + */ + public final TableField LAST_NAME = createField(DSL.name("last_name"), SQLDataType.VARCHAR(255), this, ""); + + private Student(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Student(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased college.student table reference + */ + public Student(String alias) { + this(DSL.name(alias), STUDENT); + } + + /** + * Create an aliased college.student table reference + */ + public Student(Name alias) { + this(alias, STUDENT); + } + + /** + * Create a college.student table reference + */ + public Student() { + this(DSL.name("student"), null); + } + + public Student(Table child, ForeignKey key) { + super(child, key, STUDENT); + } + + @Override + public Schema getSchema() { + return aliased() ? null : College.COLLEGE; + } + + @Override + public Identity getIdentity() { + return (Identity) super.getIdentity(); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.KEY_STUDENT_PRIMARY; + } + + @Override + public Student as(String alias) { + return new Student(DSL.name(alias), this); + } + + @Override + public Student as(Name alias) { + return new Student(alias, this); + } + + @Override + public Student as(Table alias) { + return new Student(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Student rename(String name) { + return new Student(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Student rename(Name name) { + return new Student(name, null); + } + + /** + * Rename this table + */ + @Override + public Student rename(Table name) { + return new Student(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row6 type methods + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function6 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function6 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/StudentCourse.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/StudentCourse.java new file mode 100644 index 000000000..47c1621dc --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/StudentCourse.java @@ -0,0 +1,194 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables; + + +import java.util.Arrays; +import java.util.List; +import java.util.function.Function; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function2; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row2; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import org_jooq.jooq.model.College; +import org_jooq.jooq.model.Keys; +import org_jooq.jooq.model.tables.records.StudentCourseRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class StudentCourse extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of college.student_course + */ + public static final StudentCourse STUDENT_COURSE = new StudentCourse(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return StudentCourseRecord.class; + } + + /** + * The column college.student_course.course_id. + */ + public final TableField COURSE_ID = createField(DSL.name("course_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + /** + * The column college.student_course.student_id. + */ + public final TableField STUDENT_ID = createField(DSL.name("student_id"), SQLDataType.BIGINT.nullable(false), this, ""); + + private StudentCourse(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private StudentCourse(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased college.student_course table reference + */ + public StudentCourse(String alias) { + this(DSL.name(alias), STUDENT_COURSE); + } + + /** + * Create an aliased college.student_course table reference + */ + public StudentCourse(Name alias) { + this(alias, STUDENT_COURSE); + } + + /** + * Create a college.student_course table reference + */ + public StudentCourse() { + this(DSL.name("student_course"), null); + } + + public StudentCourse(Table child, ForeignKey key) { + super(child, key, STUDENT_COURSE); + } + + @Override + public Schema getSchema() { + return aliased() ? null : College.COLLEGE; + } + + @Override + public List> getReferences() { + return Arrays.asList(Keys.FK_STUDENT_COURSE_STUDENT_ID, Keys.FK_STUDENT_COURSE_COURSE_ID); + } + + private transient Course _course; + private transient Student _student; + + /** + * Get the implicit join path to the college.course table. + */ + public Course course() { + if (_course == null) + _course = new Course(this, Keys.FK_STUDENT_COURSE_STUDENT_ID); + + return _course; + } + + /** + * Get the implicit join path to the college.student table. + */ + public Student student() { + if (_student == null) + _student = new Student(this, Keys.FK_STUDENT_COURSE_COURSE_ID); + + return _student; + } + + @Override + public StudentCourse as(String alias) { + return new StudentCourse(DSL.name(alias), this); + } + + @Override + public StudentCourse as(Name alias) { + return new StudentCourse(alias, this); + } + + @Override + public StudentCourse as(Table alias) { + return new StudentCourse(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public StudentCourse rename(String name) { + return new StudentCourse(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public StudentCourse rename(Name name) { + return new StudentCourse(name, null); + } + + /** + * Rename this table + */ + @Override + public StudentCourse rename(Table name) { + return new StudentCourse(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row2 type methods + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function2 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function2 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Teacher.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Teacher.java new file mode 100644 index 000000000..f19276912 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/Teacher.java @@ -0,0 +1,181 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables; + + +import java.util.function.Function; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Function3; +import org.jooq.Identity; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Records; +import org.jooq.Row3; +import org.jooq.Schema; +import org.jooq.SelectField; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + +import org_jooq.jooq.model.College; +import org_jooq.jooq.model.Keys; +import org_jooq.jooq.model.tables.records.TeacherRecord; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class Teacher extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of college.teacher + */ + public static final Teacher TEACHER = new Teacher(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TeacherRecord.class; + } + + /** + * The column college.teacher.id. + */ + public final TableField ID = createField(DSL.name("id"), SQLDataType.BIGINT.nullable(false).identity(true), this, ""); + + /** + * The column college.teacher.first_name. + */ + public final TableField FIRST_NAME = createField(DSL.name("first_name"), SQLDataType.VARCHAR(255), this, ""); + + /** + * The column college.teacher.last_name. + */ + public final TableField LAST_NAME = createField(DSL.name("last_name"), SQLDataType.VARCHAR(255), this, ""); + + private Teacher(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private Teacher(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased college.teacher table reference + */ + public Teacher(String alias) { + this(DSL.name(alias), TEACHER); + } + + /** + * Create an aliased college.teacher table reference + */ + public Teacher(Name alias) { + this(alias, TEACHER); + } + + /** + * Create a college.teacher table reference + */ + public Teacher() { + this(DSL.name("teacher"), null); + } + + public Teacher(Table child, ForeignKey key) { + super(child, key, TEACHER); + } + + @Override + public Schema getSchema() { + return aliased() ? null : College.COLLEGE; + } + + @Override + public Identity getIdentity() { + return (Identity) super.getIdentity(); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.KEY_TEACHER_PRIMARY; + } + + @Override + public Teacher as(String alias) { + return new Teacher(DSL.name(alias), this); + } + + @Override + public Teacher as(Name alias) { + return new Teacher(alias, this); + } + + @Override + public Teacher as(Table alias) { + return new Teacher(alias.getQualifiedName(), this); + } + + /** + * Rename this table + */ + @Override + public Teacher rename(String name) { + return new Teacher(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public Teacher rename(Name name) { + return new Teacher(name, null); + } + + /** + * Rename this table + */ + @Override + public Teacher rename(Table name) { + return new Teacher(name.getQualifiedName(), null); + } + + // ------------------------------------------------------------------------- + // Row3 type methods + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseMaterialRecord.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseMaterialRecord.java new file mode 100644 index 000000000..4141d50b3 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseMaterialRecord.java @@ -0,0 +1,184 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables.records; + + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + +import org_jooq.jooq.model.tables.CourseMaterial; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class CourseMaterialRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for college.course_material.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for college.course_material.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for college.course_material.url. + */ + public void setUrl(String value) { + set(1, value); + } + + /** + * Getter for college.course_material.url. + */ + public String getUrl() { + return (String) get(1); + } + + /** + * Setter for college.course_material.course_id. + */ + public void setCourseId(Long value) { + set(2, value); + } + + /** + * Getter for college.course_material.course_id. + */ + public Long getCourseId() { + return (Long) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return CourseMaterial.COURSE_MATERIAL.ID; + } + + @Override + public Field field2() { + return CourseMaterial.COURSE_MATERIAL.URL; + } + + @Override + public Field field3() { + return CourseMaterial.COURSE_MATERIAL.COURSE_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getUrl(); + } + + @Override + public Long component3() { + return getCourseId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getUrl(); + } + + @Override + public Long value3() { + return getCourseId(); + } + + @Override + public CourseMaterialRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public CourseMaterialRecord value2(String value) { + setUrl(value); + return this; + } + + @Override + public CourseMaterialRecord value3(Long value) { + setCourseId(value); + return this; + } + + @Override + public CourseMaterialRecord values(Long value1, String value2, Long value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CourseMaterialRecord + */ + public CourseMaterialRecord() { + super(CourseMaterial.COURSE_MATERIAL); + } + + /** + * Create a detached, initialised CourseMaterialRecord + */ + public CourseMaterialRecord(Long id, String url, Long courseId) { + super(CourseMaterial.COURSE_MATERIAL); + + setId(id); + setUrl(url); + setCourseId(courseId); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseRecord.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseRecord.java new file mode 100644 index 000000000..72dbc4d9e --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/CourseRecord.java @@ -0,0 +1,184 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables.records; + + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + +import org_jooq.jooq.model.tables.Course; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class CourseRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for college.course.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for college.course.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for college.course.title. + */ + public void setTitle(String value) { + set(1, value); + } + + /** + * Getter for college.course.title. + */ + public String getTitle() { + return (String) get(1); + } + + /** + * Setter for college.course.teacher_id. + */ + public void setTeacherId(Long value) { + set(2, value); + } + + /** + * Getter for college.course.teacher_id. + */ + public Long getTeacherId() { + return (Long) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return Course.COURSE.ID; + } + + @Override + public Field field2() { + return Course.COURSE.TITLE; + } + + @Override + public Field field3() { + return Course.COURSE.TEACHER_ID; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getTitle(); + } + + @Override + public Long component3() { + return getTeacherId(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getTitle(); + } + + @Override + public Long value3() { + return getTeacherId(); + } + + @Override + public CourseRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public CourseRecord value2(String value) { + setTitle(value); + return this; + } + + @Override + public CourseRecord value3(Long value) { + setTeacherId(value); + return this; + } + + @Override + public CourseRecord values(Long value1, String value2, Long value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached CourseRecord + */ + public CourseRecord() { + super(Course.COURSE); + } + + /** + * Create a detached, initialised CourseRecord + */ + public CourseRecord(Long id, String title, Long teacherId) { + super(Course.COURSE); + + setId(id); + setTitle(title); + setTeacherId(teacherId); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentCourseRecord.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentCourseRecord.java new file mode 100644 index 000000000..b92f7c983 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentCourseRecord.java @@ -0,0 +1,137 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables.records; + + +import org.jooq.Field; +import org.jooq.Record2; +import org.jooq.Row2; +import org.jooq.impl.TableRecordImpl; + +import org_jooq.jooq.model.tables.StudentCourse; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class StudentCourseRecord extends TableRecordImpl implements Record2 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for college.student_course.course_id. + */ + public void setCourseId(Long value) { + set(0, value); + } + + /** + * Getter for college.student_course.course_id. + */ + public Long getCourseId() { + return (Long) get(0); + } + + /** + * Setter for college.student_course.student_id. + */ + public void setStudentId(Long value) { + set(1, value); + } + + /** + * Getter for college.student_course.student_id. + */ + public Long getStudentId() { + return (Long) get(1); + } + + // ------------------------------------------------------------------------- + // Record2 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row2 fieldsRow() { + return (Row2) super.fieldsRow(); + } + + @Override + public Row2 valuesRow() { + return (Row2) super.valuesRow(); + } + + @Override + public Field field1() { + return StudentCourse.STUDENT_COURSE.COURSE_ID; + } + + @Override + public Field field2() { + return StudentCourse.STUDENT_COURSE.STUDENT_ID; + } + + @Override + public Long component1() { + return getCourseId(); + } + + @Override + public Long component2() { + return getStudentId(); + } + + @Override + public Long value1() { + return getCourseId(); + } + + @Override + public Long value2() { + return getStudentId(); + } + + @Override + public StudentCourseRecord value1(Long value) { + setCourseId(value); + return this; + } + + @Override + public StudentCourseRecord value2(Long value) { + setStudentId(value); + return this; + } + + @Override + public StudentCourseRecord values(Long value1, Long value2) { + value1(value1); + value2(value2); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached StudentCourseRecord + */ + public StudentCourseRecord() { + super(StudentCourse.STUDENT_COURSE); + } + + /** + * Create a detached, initialised StudentCourseRecord + */ + public StudentCourseRecord(Long courseId, Long studentId) { + super(StudentCourse.STUDENT_COURSE); + + setCourseId(courseId); + setStudentId(studentId); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentRecord.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentRecord.java new file mode 100644 index 000000000..ff735cd7f --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/StudentRecord.java @@ -0,0 +1,297 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables.records; + + +import java.time.LocalDate; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record6; +import org.jooq.Row6; +import org.jooq.impl.UpdatableRecordImpl; + +import org_jooq.jooq.model.tables.Student; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class StudentRecord extends UpdatableRecordImpl implements Record6 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for college.student.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for college.student.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for college.student.age. + */ + public void setAge(Integer value) { + set(1, value); + } + + /** + * Getter for college.student.age. + */ + public Integer getAge() { + return (Integer) get(1); + } + + /** + * Setter for college.student.birth_date. + */ + public void setBirthDate(LocalDate value) { + set(2, value); + } + + /** + * Getter for college.student.birth_date. + */ + public LocalDate getBirthDate() { + return (LocalDate) get(2); + } + + /** + * Setter for college.student.first_name. + */ + public void setFirstName(String value) { + set(3, value); + } + + /** + * Getter for college.student.first_name. + */ + public String getFirstName() { + return (String) get(3); + } + + /** + * Setter for college.student.gender. + */ + public void setGender(String value) { + set(4, value); + } + + /** + * Getter for college.student.gender. + */ + public String getGender() { + return (String) get(4); + } + + /** + * Setter for college.student.last_name. + */ + public void setLastName(String value) { + set(5, value); + } + + /** + * Getter for college.student.last_name. + */ + public String getLastName() { + return (String) get(5); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record6 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row6 fieldsRow() { + return (Row6) super.fieldsRow(); + } + + @Override + public Row6 valuesRow() { + return (Row6) super.valuesRow(); + } + + @Override + public Field field1() { + return Student.STUDENT.ID; + } + + @Override + public Field field2() { + return Student.STUDENT.AGE; + } + + @Override + public Field field3() { + return Student.STUDENT.BIRTH_DATE; + } + + @Override + public Field field4() { + return Student.STUDENT.FIRST_NAME; + } + + @Override + public Field field5() { + return Student.STUDENT.GENDER; + } + + @Override + public Field field6() { + return Student.STUDENT.LAST_NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public Integer component2() { + return getAge(); + } + + @Override + public LocalDate component3() { + return getBirthDate(); + } + + @Override + public String component4() { + return getFirstName(); + } + + @Override + public String component5() { + return getGender(); + } + + @Override + public String component6() { + return getLastName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public Integer value2() { + return getAge(); + } + + @Override + public LocalDate value3() { + return getBirthDate(); + } + + @Override + public String value4() { + return getFirstName(); + } + + @Override + public String value5() { + return getGender(); + } + + @Override + public String value6() { + return getLastName(); + } + + @Override + public StudentRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public StudentRecord value2(Integer value) { + setAge(value); + return this; + } + + @Override + public StudentRecord value3(LocalDate value) { + setBirthDate(value); + return this; + } + + @Override + public StudentRecord value4(String value) { + setFirstName(value); + return this; + } + + @Override + public StudentRecord value5(String value) { + setGender(value); + return this; + } + + @Override + public StudentRecord value6(String value) { + setLastName(value); + return this; + } + + @Override + public StudentRecord values(Long value1, Integer value2, LocalDate value3, String value4, String value5, String value6) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + value6(value6); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached StudentRecord + */ + public StudentRecord() { + super(Student.STUDENT); + } + + /** + * Create a detached, initialised StudentRecord + */ + public StudentRecord(Long id, Integer age, LocalDate birthDate, String firstName, String gender, String lastName) { + super(Student.STUDENT); + + setId(id); + setAge(age); + setBirthDate(birthDate); + setFirstName(firstName); + setGender(gender); + setLastName(lastName); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/TeacherRecord.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/TeacherRecord.java new file mode 100644 index 000000000..8522eeafa --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/model/tables/records/TeacherRecord.java @@ -0,0 +1,184 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.model.tables.records; + + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record3; +import org.jooq.Row3; +import org.jooq.impl.UpdatableRecordImpl; + +import org_jooq.jooq.model.tables.Teacher; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TeacherRecord extends UpdatableRecordImpl implements Record3 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for college.teacher.id. + */ + public void setId(Long value) { + set(0, value); + } + + /** + * Getter for college.teacher.id. + */ + public Long getId() { + return (Long) get(0); + } + + /** + * Setter for college.teacher.first_name. + */ + public void setFirstName(String value) { + set(1, value); + } + + /** + * Getter for college.teacher.first_name. + */ + public String getFirstName() { + return (String) get(1); + } + + /** + * Setter for college.teacher.last_name. + */ + public void setLastName(String value) { + set(2, value); + } + + /** + * Getter for college.teacher.last_name. + */ + public String getLastName() { + return (String) get(2); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record3 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row3 fieldsRow() { + return (Row3) super.fieldsRow(); + } + + @Override + public Row3 valuesRow() { + return (Row3) super.valuesRow(); + } + + @Override + public Field field1() { + return Teacher.TEACHER.ID; + } + + @Override + public Field field2() { + return Teacher.TEACHER.FIRST_NAME; + } + + @Override + public Field field3() { + return Teacher.TEACHER.LAST_NAME; + } + + @Override + public Long component1() { + return getId(); + } + + @Override + public String component2() { + return getFirstName(); + } + + @Override + public String component3() { + return getLastName(); + } + + @Override + public Long value1() { + return getId(); + } + + @Override + public String value2() { + return getFirstName(); + } + + @Override + public String value3() { + return getLastName(); + } + + @Override + public TeacherRecord value1(Long value) { + setId(value); + return this; + } + + @Override + public TeacherRecord value2(String value) { + setFirstName(value); + return this; + } + + @Override + public TeacherRecord value3(String value) { + setLastName(value); + return this; + } + + @Override + public TeacherRecord values(Long value1, String value2, String value3) { + value1(value1); + value2(value2); + value3(value3); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TeacherRecord + */ + public TeacherRecord() { + super(Teacher.TEACHER); + } + + /** + * Create a detached, initialised TeacherRecord + */ + public TeacherRecord(Long id, String firstName, String lastName) { + super(Teacher.TEACHER); + + setId(id); + setFirstName(firstName); + setLastName(lastName); + } +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/proxy/CourseProxy.java b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/proxy/CourseProxy.java new file mode 100644 index 000000000..aabeb0883 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/java/org_jooq/jooq/proxy/CourseProxy.java @@ -0,0 +1,22 @@ +/* + * Copyright and related rights waived via CC0 + * + * You should have received a copy of the CC0 legalcode along with this + * work. If not, see . + */ +package org_jooq.jooq.proxy; + +public interface CourseProxy { + + void setId(Long id); + + Long getId(); + + void setTitle(String title); + + String getTitle(); + + void setTeacherId(Long teacherId); + + Long getTeacherId(); +} diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/proxy-config.json b/tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/proxy-config.json new file mode 100644 index 000000000..67eca2ba8 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/proxy-config.json @@ -0,0 +1,10 @@ +[ + { + "condition": { + "typeReachable": "org.jooq.impl.DefaultRecordMapper$ProxyMapper" + }, + "interfaces": [ + "org_jooq.jooq.proxy.CourseProxy" + ] + } +] \ No newline at end of file diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/reflect-config.json b/tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/reflect-config.json new file mode 100644 index 000000000..d661bbd22 --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/resources/META-INF/native-image/tests-only/reflect-config.json @@ -0,0 +1,100 @@ +[ + { + "name": "org_jooq.jooq.model.tables.records.CourseMaterialRecord", + "condition": { + "typeReachable": "org_jooq.jooq.JooqTest" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org_jooq.jooq.model.tables.records.CourseRecord", + "condition": { + "typeReachable": "org_jooq.jooq.JooqTest" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org_jooq.jooq.model.tables.records.StudentCourseRecord", + "condition": { + "typeReachable": "org.jooq.RecordMapper" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org_jooq.jooq.model.tables.records.StudentCourseRecord", + "condition": { + "typeReachable": "org.jooq.impl.AbstractResultQuery" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org_jooq.jooq.model.tables.records.StudentCourseRecord", + "condition": { + "typeReachable": "org_jooq.jooq.JooqTest" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org_jooq.jooq.model.tables.records.StudentRecord", + "condition": { + "typeReachable": "org_jooq.jooq.JooqTest" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + }, + { + "name": "org_jooq.jooq.model.tables.records.TeacherRecord", + "condition": { + "typeReachable": "org_jooq.jooq.JooqTest" + }, + "methods": [ + { + "name": "", + "parameterTypes": [ + + ] + } + ] + } +] \ No newline at end of file diff --git a/tests/src/org.jooq/jooq/3.17.7/src/test/resources/logback.xml b/tests/src/org.jooq/jooq/3.17.7/src/test/resources/logback.xml new file mode 100644 index 000000000..bbc2159ee --- /dev/null +++ b/tests/src/org.jooq/jooq/3.17.7/src/test/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + +