[#6355] Improve Kotlin example in manual

This commit is contained in:
lukaseder 2017-06-21 17:38:43 +02:00
parent bc05c60bc0
commit 5e5d44b6a6
9 changed files with 18 additions and 41 deletions

View File

@ -33,7 +33,7 @@ import org.jooq.impl.SchemaImpl;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Public extends SchemaImpl {
private static final long serialVersionUID = 1479776736;
private static final long serialVersionUID = -231148938;
/**
* The reference instance of <code>PUBLIC</code>
@ -85,10 +85,9 @@ public class Public extends SchemaImpl {
private final List<Sequence<?>> getSequences0() {
return Arrays.<Sequence<?>>asList(
Sequences.SYSTEM_SEQUENCE_428E0FE3_9D55_4EFE_978E_3C4A0D1539E3,
Sequences.SYSTEM_SEQUENCE_49E7A2A7_7321_4CE9_BC66_5FD0863DF24C,
Sequences.S_AUTHOR_ID,
Sequences.S_BOOK_ID);
Sequences.SYSTEM_SEQUENCE_8CD71463_69CD_4A57_B8AB_B9985402B0A2,
Sequences.SYSTEM_SEQUENCE_A76C8A36_BAEB_4088_8A30_29365F363038,
Sequences.S_AUTHOR_ID);
}
@Override

View File

@ -24,22 +24,17 @@ import org.jooq.impl.SequenceImpl;
public class Sequences {
/**
* The sequence <code>PUBLIC.SYSTEM_SEQUENCE_428E0FE3_9D55_4EFE_978E_3C4A0D1539E3</code>
* The sequence <code>PUBLIC.SYSTEM_SEQUENCE_8CD71463_69CD_4A57_B8AB_B9985402B0A2</code>
*/
public static final Sequence<Long> SYSTEM_SEQUENCE_428E0FE3_9D55_4EFE_978E_3C4A0D1539E3 = new SequenceImpl<Long>("SYSTEM_SEQUENCE_428E0FE3_9D55_4EFE_978E_3C4A0D1539E3", Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);
public static final Sequence<Long> SYSTEM_SEQUENCE_8CD71463_69CD_4A57_B8AB_B9985402B0A2 = new SequenceImpl<Long>("SYSTEM_SEQUENCE_8CD71463_69CD_4A57_B8AB_B9985402B0A2", Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);
/**
* The sequence <code>PUBLIC.SYSTEM_SEQUENCE_49E7A2A7_7321_4CE9_BC66_5FD0863DF24C</code>
* The sequence <code>PUBLIC.SYSTEM_SEQUENCE_A76C8A36_BAEB_4088_8A30_29365F363038</code>
*/
public static final Sequence<Long> SYSTEM_SEQUENCE_49E7A2A7_7321_4CE9_BC66_5FD0863DF24C = new SequenceImpl<Long>("SYSTEM_SEQUENCE_49E7A2A7_7321_4CE9_BC66_5FD0863DF24C", Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);
public static final Sequence<Long> SYSTEM_SEQUENCE_A76C8A36_BAEB_4088_8A30_29365F363038 = new SequenceImpl<Long>("SYSTEM_SEQUENCE_A76C8A36_BAEB_4088_8A30_29365F363038", Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);
/**
* The sequence <code>PUBLIC.S_AUTHOR_ID</code>
*/
public static final Sequence<Long> S_AUTHOR_ID = new SequenceImpl<Long>("S_AUTHOR_ID", Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);
/**
* The sequence <code>PUBLIC.S_BOOK_ID</code>
*/
public static final Sequence<Long> S_BOOK_ID = new SequenceImpl<Long>("S_BOOK_ID", Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);
}

View File

@ -39,7 +39,7 @@ import org.jooq.impl.TableImpl;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Author extends TableImpl<AuthorRecord> {
private static final long serialVersionUID = -558423724;
private static final long serialVersionUID = -259612025;
/**
* The reference instance of <code>PUBLIC.AUTHOR</code>
@ -57,7 +57,7 @@ public class Author extends TableImpl<AuthorRecord> {
/**
* The column <code>PUBLIC.AUTHOR.ID</code>.
*/
public final TableField<AuthorRecord, Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("(NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_428E0FE3_9D55_4EFE_978E_3C4A0D1539E3)", org.jooq.impl.SQLDataType.INTEGER)), this, "");
public final TableField<AuthorRecord, Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false).identity(true), this, "");
/**
* The column <code>PUBLIC.AUTHOR.FIRST_NAME</code>.

View File

@ -40,7 +40,7 @@ import org.jooq.impl.TableImpl;
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Book extends TableImpl<BookRecord> {
private static final long serialVersionUID = 126975315;
private static final long serialVersionUID = -350867238;
/**
* The reference instance of <code>PUBLIC.BOOK</code>
@ -58,7 +58,7 @@ public class Book extends TableImpl<BookRecord> {
/**
* The column <code>PUBLIC.BOOK.ID</code>.
*/
public final TableField<BookRecord, Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaultValue(org.jooq.impl.DSL.field("(NEXT VALUE FOR PUBLIC.SYSTEM_SEQUENCE_49E7A2A7_7321_4CE9_BC66_5FD0863DF24C)", org.jooq.impl.SQLDataType.INTEGER)), this, "");
public final TableField<BookRecord, Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false).identity(true), this, "");
/**
* The column <code>PUBLIC.BOOK.AUTHOR_ID</code>.

View File

@ -53,12 +53,11 @@ fun main(args: Array<String>) {
val properties = Properties();
properties.load(properties::class.java.getResourceAsStream("/config.properties"));
DriverManager.getConnection(
DSL.using(
properties.getProperty("db.url"),
properties.getProperty("db.username"),
properties.getProperty("db.password")
).use {
val ctx = DSL.using(it)
).use { ctx ->
val a = AUTHOR
val b = BOOK

View File

@ -2771,11 +2771,7 @@ fun main(args: Array<String>) {
properties.getProperty("db.url"),
properties.getProperty("db.username"),
properties.getProperty("db.password")
// The below "use" method is an adapted version of the one in kotlin.io
// See also: https://github.com/JetBrains/kotlin/pull/807
).use {
val ctx = it
).use { ctx ->
val a = AUTHOR
val b = BOOK

View File

@ -2772,11 +2772,7 @@ fun main(args: Array<String>) {
properties.getProperty("db.url"),
properties.getProperty("db.username"),
properties.getProperty("db.password")
// The below "use" method is an adapted version of the one in kotlin.io
// See also: https://github.com/JetBrains/kotlin/pull/807
).use {
val ctx = it
).use { ctx ->
val a = AUTHOR
val b = BOOK

View File

@ -2772,11 +2772,7 @@ fun main(args: Array<String>) {
properties.getProperty("db.url"),
properties.getProperty("db.username"),
properties.getProperty("db.password")
// The below "use" method is an adapted version of the one in kotlin.io
// See also: https://github.com/JetBrains/kotlin/pull/807
).use {
val ctx = it
).use { ctx ->
val a = AUTHOR
val b = BOOK

View File

@ -2771,11 +2771,7 @@ fun main(args: Array<String>) {
properties.getProperty("db.url"),
properties.getProperty("db.username"),
properties.getProperty("db.password")
// The below "use" method is an adapted version of the one in kotlin.io
// See also: https://github.com/JetBrains/kotlin/pull/807
).use {
val ctx = it
).use { ctx ->
val a = AUTHOR
val b = BOOK