[jOOQ/jOOQ#8939] Added missing files

This commit is contained in:
Lukas Eder 2019-07-25 17:26:44 +02:00
parent 95168c1e76
commit 4fdc37527d
12 changed files with 1224 additions and 0 deletions

View File

@ -0,0 +1,60 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.processing.Generated;
import org.jooq.Schema;
import org.jooq.impl.CatalogImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class DefaultCatalog extends CatalogImpl {
private static final long serialVersionUID = -846185862;
/**
* The reference instance of <code></code>
*/
public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog();
/**
* The schema <code>FLYWAY_TEST</code>.
*/
public final FlywayTest FLYWAY_TEST = org.jooq.example.flyway.ddl.db.h2.FlywayTest.FLYWAY_TEST;
/**
* No further instances allowed
*/
private DefaultCatalog() {
super("");
}
@Override
public final List<Schema> getSchemas() {
List result = new ArrayList();
result.addAll(getSchemas0());
return result;
}
private final List<Schema> getSchemas0() {
return Arrays.<Schema>asList(
FlywayTest.FLYWAY_TEST);
}
}

View File

@ -0,0 +1,88 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.processing.Generated;
import org.jooq.Catalog;
import org.jooq.Sequence;
import org.jooq.Table;
import org.jooq.example.flyway.ddl.db.h2.tables.Author;
import org.jooq.example.flyway.ddl.db.h2.tables.Book;
import org.jooq.impl.SchemaImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class FlywayTest extends SchemaImpl {
private static final long serialVersionUID = -520771476;
/**
* The reference instance of <code>FLYWAY_TEST</code>
*/
public static final FlywayTest FLYWAY_TEST = new FlywayTest();
/**
* The table <code>FLYWAY_TEST.AUTHOR</code>.
*/
public final Author AUTHOR = org.jooq.example.flyway.ddl.db.h2.tables.Author.AUTHOR;
/**
* The table <code>FLYWAY_TEST.BOOK</code>.
*/
public final Book BOOK = org.jooq.example.flyway.ddl.db.h2.tables.Book.BOOK;
/**
* No further instances allowed
*/
private FlywayTest() {
super("FLYWAY_TEST", null);
}
@Override
public Catalog getCatalog() {
return DefaultCatalog.DEFAULT_CATALOG;
}
@Override
public final List<Sequence<?>> getSequences() {
List result = new ArrayList();
result.addAll(getSequences0());
return result;
}
private final List<Sequence<?>> getSequences0() {
return Arrays.<Sequence<?>>asList(
Sequences.S_AUTHOR_ID);
}
@Override
public final List<Table<?>> getTables() {
List result = new ArrayList();
result.addAll(getTables0());
return result;
}
private final List<Table<?>> getTables0() {
return Arrays.<Table<?>>asList(
Author.AUTHOR,
Book.BOOK);
}
}

View File

@ -0,0 +1,46 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2;
import javax.annotation.processing.Generated;
import org.jooq.Index;
import org.jooq.OrderField;
import org.jooq.example.flyway.ddl.db.h2.tables.Author;
import org.jooq.example.flyway.ddl.db.h2.tables.Book;
import org.jooq.impl.Internal;
/**
* A class modelling indexes of tables of the <code>FLYWAY_TEST</code> schema.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Indexes {
// -------------------------------------------------------------------------
// INDEX definitions
// -------------------------------------------------------------------------
public static final Index PRIMARY_KEY_7 = Indexes0.PRIMARY_KEY_7;
public static final Index FK_T_BOOK_AUTHOR_ID_INDEX_1 = Indexes0.FK_T_BOOK_AUTHOR_ID_INDEX_1;
public static final Index PRIMARY_KEY_1 = Indexes0.PRIMARY_KEY_1;
// -------------------------------------------------------------------------
// [#1459] distribute members to avoid static initialisers > 64kb
// -------------------------------------------------------------------------
private static class Indexes0 {
public static Index PRIMARY_KEY_7 = Internal.createIndex("PRIMARY_KEY_7", Author.AUTHOR, new OrderField[] { Author.AUTHOR.ID }, true);
public static Index FK_T_BOOK_AUTHOR_ID_INDEX_1 = Internal.createIndex("FK_T_BOOK_AUTHOR_ID_INDEX_1", Book.BOOK, new OrderField[] { Book.BOOK.AUTHOR_ID }, false);
public static Index PRIMARY_KEY_1 = Internal.createIndex("PRIMARY_KEY_1", Book.BOOK, new OrderField[] { Book.BOOK.ID }, true);
}
}

View File

@ -0,0 +1,62 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2;
import javax.annotation.processing.Generated;
import org.jooq.ForeignKey;
import org.jooq.UniqueKey;
import org.jooq.example.flyway.ddl.db.h2.tables.Author;
import org.jooq.example.flyway.ddl.db.h2.tables.Book;
import org.jooq.example.flyway.ddl.db.h2.tables.records.AuthorRecord;
import org.jooq.example.flyway.ddl.db.h2.tables.records.BookRecord;
import org.jooq.impl.Internal;
/**
* A class modelling foreign key relationships and constraints of tables of
* the <code>FLYWAY_TEST</code> schema.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Keys {
// -------------------------------------------------------------------------
// IDENTITY definitions
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
// UNIQUE and PRIMARY KEY definitions
// -------------------------------------------------------------------------
public static final UniqueKey<AuthorRecord> PK_T_AUTHOR = UniqueKeys0.PK_T_AUTHOR;
public static final UniqueKey<BookRecord> PK_T_BOOK = UniqueKeys0.PK_T_BOOK;
// -------------------------------------------------------------------------
// FOREIGN KEY definitions
// -------------------------------------------------------------------------
public static final ForeignKey<BookRecord, AuthorRecord> FK_T_BOOK_AUTHOR_ID = ForeignKeys0.FK_T_BOOK_AUTHOR_ID;
// -------------------------------------------------------------------------
// [#1459] distribute members to avoid static initialisers > 64kb
// -------------------------------------------------------------------------
private static class UniqueKeys0 {
public static final UniqueKey<AuthorRecord> PK_T_AUTHOR = Internal.createUniqueKey(Author.AUTHOR, "PK_T_AUTHOR", Author.AUTHOR.ID);
public static final UniqueKey<BookRecord> PK_T_BOOK = Internal.createUniqueKey(Book.BOOK, "PK_T_BOOK", Book.BOOK.ID);
}
private static class ForeignKeys0 {
public static final ForeignKey<BookRecord, AuthorRecord> FK_T_BOOK_AUTHOR_ID = Internal.createForeignKey(org.jooq.example.flyway.ddl.db.h2.Keys.PK_T_AUTHOR, Book.BOOK, "FK_T_BOOK_AUTHOR_ID", Book.BOOK.AUTHOR_ID);
}
}

View File

@ -0,0 +1,30 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2;
import javax.annotation.processing.Generated;
import org.jooq.Sequence;
import org.jooq.impl.SequenceImpl;
/**
* Convenience access to all sequences in FLYWAY_TEST
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Sequences {
/**
* The sequence <code>FLYWAY_TEST.S_AUTHOR_ID</code>
*/
public static final Sequence<Long> S_AUTHOR_ID = new SequenceImpl<Long>("S_AUTHOR_ID", FlywayTest.FLYWAY_TEST, org.jooq.impl.SQLDataType.BIGINT);
}

View File

@ -0,0 +1,35 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2;
import javax.annotation.processing.Generated;
import org.jooq.example.flyway.ddl.db.h2.tables.Author;
import org.jooq.example.flyway.ddl.db.h2.tables.Book;
/**
* Convenience access to all tables in FLYWAY_TEST
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Tables {
/**
* The table <code>FLYWAY_TEST.AUTHOR</code>.
*/
public static final Author AUTHOR = Author.AUTHOR;
/**
* The table <code>FLYWAY_TEST.BOOK</code>.
*/
public static final Book BOOK = Book.BOOK;
}

View File

@ -0,0 +1,176 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2.tables;
import java.sql.Date;
import java.util.Arrays;
import java.util.List;
import javax.annotation.processing.Generated;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row6;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.example.flyway.ddl.db.h2.FlywayTest;
import org.jooq.example.flyway.ddl.db.h2.Indexes;
import org.jooq.example.flyway.ddl.db.h2.Keys;
import org.jooq.example.flyway.ddl.db.h2.tables.records.AuthorRecord;
import org.jooq.impl.DSL;
import org.jooq.impl.TableImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Author extends TableImpl<AuthorRecord> {
private static final long serialVersionUID = 1689383333;
/**
* The reference instance of <code>FLYWAY_TEST.AUTHOR</code>
*/
public static final Author AUTHOR = new Author();
/**
* The class holding records for this type
*/
@Override
public Class<AuthorRecord> getRecordType() {
return AuthorRecord.class;
}
/**
* The column <code>FLYWAY_TEST.AUTHOR.ID</code>.
*/
public final TableField<AuthorRecord, Integer> ID = createField(DSL.name("ID"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>FLYWAY_TEST.AUTHOR.FIRST_NAME</code>.
*/
public final TableField<AuthorRecord, String> FIRST_NAME = createField(DSL.name("FIRST_NAME"), org.jooq.impl.SQLDataType.VARCHAR(50), this, "");
/**
* The column <code>FLYWAY_TEST.AUTHOR.LAST_NAME</code>.
*/
public final TableField<AuthorRecord, String> LAST_NAME = createField(DSL.name("LAST_NAME"), org.jooq.impl.SQLDataType.VARCHAR(50).nullable(false), this, "");
/**
* The column <code>FLYWAY_TEST.AUTHOR.DATE_OF_BIRTH</code>.
*/
public final TableField<AuthorRecord, Date> DATE_OF_BIRTH = createField(DSL.name("DATE_OF_BIRTH"), org.jooq.impl.SQLDataType.DATE, this, "");
/**
* The column <code>FLYWAY_TEST.AUTHOR.YEAR_OF_BIRTH</code>.
*/
public final TableField<AuthorRecord, Integer> YEAR_OF_BIRTH = createField(DSL.name("YEAR_OF_BIRTH"), org.jooq.impl.SQLDataType.INTEGER, this, "");
/**
* The column <code>FLYWAY_TEST.AUTHOR.ADDRESS</code>.
*/
public final TableField<AuthorRecord, String> ADDRESS = createField(DSL.name("ADDRESS"), org.jooq.impl.SQLDataType.VARCHAR(50), this, "");
/**
* Create a <code>FLYWAY_TEST.AUTHOR</code> table reference
*/
public Author() {
this(DSL.name("AUTHOR"), null);
}
/**
* Create an aliased <code>FLYWAY_TEST.AUTHOR</code> table reference
*/
public Author(String alias) {
this(DSL.name(alias), AUTHOR);
}
/**
* Create an aliased <code>FLYWAY_TEST.AUTHOR</code> table reference
*/
public Author(Name alias) {
this(alias, AUTHOR);
}
private Author(Name alias, Table<AuthorRecord> aliased) {
this(alias, aliased, null);
}
private Author(Name alias, Table<AuthorRecord> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, DSL.comment(""));
}
public <O extends Record> Author(Table<O> child, ForeignKey<O, AuthorRecord> key) {
super(child, key, AUTHOR);
}
@Override
public Schema getSchema() {
return FlywayTest.FLYWAY_TEST;
}
@Override
public List<Index> getIndexes() {
return Arrays.<Index>asList(Indexes.PRIMARY_KEY_7);
}
@Override
public UniqueKey<AuthorRecord> getPrimaryKey() {
return Keys.PK_T_AUTHOR;
}
@Override
public List<UniqueKey<AuthorRecord>> getKeys() {
return Arrays.<UniqueKey<AuthorRecord>>asList(Keys.PK_T_AUTHOR);
}
@Override
public Author as(String alias) {
return new Author(DSL.name(alias), this);
}
@Override
public Author as(Name alias) {
return new Author(alias, this);
}
/**
* Rename this table
*/
@Override
public Author rename(String name) {
return new Author(DSL.name(name), null);
}
/**
* Rename this table
*/
@Override
public Author rename(Name name) {
return new Author(name, null);
}
// -------------------------------------------------------------------------
// Row6 type methods
// -------------------------------------------------------------------------
@Override
public Row6<Integer, String, String, Date, Integer, String> fieldsRow() {
return (Row6) super.fieldsRow();
}
}

View File

@ -0,0 +1,169 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2.tables;
import java.util.Arrays;
import java.util.List;
import javax.annotation.processing.Generated;
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Index;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row3;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.UniqueKey;
import org.jooq.example.flyway.ddl.db.h2.FlywayTest;
import org.jooq.example.flyway.ddl.db.h2.Indexes;
import org.jooq.example.flyway.ddl.db.h2.Keys;
import org.jooq.example.flyway.ddl.db.h2.tables.records.BookRecord;
import org.jooq.impl.DSL;
import org.jooq.impl.TableImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Book extends TableImpl<BookRecord> {
private static final long serialVersionUID = 353140781;
/**
* The reference instance of <code>FLYWAY_TEST.BOOK</code>
*/
public static final Book BOOK = new Book();
/**
* The class holding records for this type
*/
@Override
public Class<BookRecord> getRecordType() {
return BookRecord.class;
}
/**
* The column <code>FLYWAY_TEST.BOOK.ID</code>.
*/
public final TableField<BookRecord, Integer> ID = createField(DSL.name("ID"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>FLYWAY_TEST.BOOK.AUTHOR_ID</code>.
*/
public final TableField<BookRecord, Integer> AUTHOR_ID = createField(DSL.name("AUTHOR_ID"), org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>FLYWAY_TEST.BOOK.TITLE</code>.
*/
public final TableField<BookRecord, String> TITLE = createField(DSL.name("TITLE"), org.jooq.impl.SQLDataType.VARCHAR(400).nullable(false), this, "");
/**
* Create a <code>FLYWAY_TEST.BOOK</code> table reference
*/
public Book() {
this(DSL.name("BOOK"), null);
}
/**
* Create an aliased <code>FLYWAY_TEST.BOOK</code> table reference
*/
public Book(String alias) {
this(DSL.name(alias), BOOK);
}
/**
* Create an aliased <code>FLYWAY_TEST.BOOK</code> table reference
*/
public Book(Name alias) {
this(alias, BOOK);
}
private Book(Name alias, Table<BookRecord> aliased) {
this(alias, aliased, null);
}
private Book(Name alias, Table<BookRecord> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, DSL.comment(""));
}
public <O extends Record> Book(Table<O> child, ForeignKey<O, BookRecord> key) {
super(child, key, BOOK);
}
@Override
public Schema getSchema() {
return FlywayTest.FLYWAY_TEST;
}
@Override
public List<Index> getIndexes() {
return Arrays.<Index>asList(Indexes.FK_T_BOOK_AUTHOR_ID_INDEX_1, Indexes.PRIMARY_KEY_1);
}
@Override
public UniqueKey<BookRecord> getPrimaryKey() {
return Keys.PK_T_BOOK;
}
@Override
public List<UniqueKey<BookRecord>> getKeys() {
return Arrays.<UniqueKey<BookRecord>>asList(Keys.PK_T_BOOK);
}
@Override
public List<ForeignKey<BookRecord, ?>> getReferences() {
return Arrays.<ForeignKey<BookRecord, ?>>asList(Keys.FK_T_BOOK_AUTHOR_ID);
}
public Author author() {
return new Author(this, Keys.FK_T_BOOK_AUTHOR_ID);
}
@Override
public Book as(String alias) {
return new Book(DSL.name(alias), this);
}
@Override
public Book as(Name alias) {
return new Book(alias, this);
}
/**
* Rename this table
*/
@Override
public Book rename(String name) {
return new Book(DSL.name(name), null);
}
/**
* Rename this table
*/
@Override
public Book rename(Name name) {
return new Book(name, null);
}
// -------------------------------------------------------------------------
// Row3 type methods
// -------------------------------------------------------------------------
@Override
public Row3<Integer, Integer, String> fieldsRow() {
return (Row3) super.fieldsRow();
}
}

View File

@ -0,0 +1,302 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2.tables.records;
import java.sql.Date;
import javax.annotation.processing.Generated;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record6;
import org.jooq.Row6;
import org.jooq.example.flyway.ddl.db.h2.tables.Author;
import org.jooq.impl.UpdatableRecordImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AuthorRecord extends UpdatableRecordImpl<AuthorRecord> implements Record6<Integer, String, String, Date, Integer, String> {
private static final long serialVersionUID = -850705131;
/**
* Setter for <code>FLYWAY_TEST.AUTHOR.ID</code>.
*/
public void setId(Integer value) {
set(0, value);
}
/**
* Getter for <code>FLYWAY_TEST.AUTHOR.ID</code>.
*/
public Integer getId() {
return (Integer) get(0);
}
/**
* Setter for <code>FLYWAY_TEST.AUTHOR.FIRST_NAME</code>.
*/
public void setFirstName(String value) {
set(1, value);
}
/**
* Getter for <code>FLYWAY_TEST.AUTHOR.FIRST_NAME</code>.
*/
public String getFirstName() {
return (String) get(1);
}
/**
* Setter for <code>FLYWAY_TEST.AUTHOR.LAST_NAME</code>.
*/
public void setLastName(String value) {
set(2, value);
}
/**
* Getter for <code>FLYWAY_TEST.AUTHOR.LAST_NAME</code>.
*/
public String getLastName() {
return (String) get(2);
}
/**
* Setter for <code>FLYWAY_TEST.AUTHOR.DATE_OF_BIRTH</code>.
*/
public void setDateOfBirth(Date value) {
set(3, value);
}
/**
* Getter for <code>FLYWAY_TEST.AUTHOR.DATE_OF_BIRTH</code>.
*/
public Date getDateOfBirth() {
return (Date) get(3);
}
/**
* Setter for <code>FLYWAY_TEST.AUTHOR.YEAR_OF_BIRTH</code>.
*/
public void setYearOfBirth(Integer value) {
set(4, value);
}
/**
* Getter for <code>FLYWAY_TEST.AUTHOR.YEAR_OF_BIRTH</code>.
*/
public Integer getYearOfBirth() {
return (Integer) get(4);
}
/**
* Setter for <code>FLYWAY_TEST.AUTHOR.ADDRESS</code>.
*/
public void setAddress(String value) {
set(5, value);
}
/**
* Getter for <code>FLYWAY_TEST.AUTHOR.ADDRESS</code>.
*/
public String getAddress() {
return (String) get(5);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
@Override
public Record1<Integer> key() {
return (Record1) super.key();
}
// -------------------------------------------------------------------------
// Record6 type implementation
// -------------------------------------------------------------------------
@Override
public Row6<Integer, String, String, Date, Integer, String> fieldsRow() {
return (Row6) super.fieldsRow();
}
@Override
public Row6<Integer, String, String, Date, Integer, String> valuesRow() {
return (Row6) super.valuesRow();
}
@Override
public Field<Integer> field1() {
return Author.AUTHOR.ID;
}
@Override
public Field<String> field2() {
return Author.AUTHOR.FIRST_NAME;
}
@Override
public Field<String> field3() {
return Author.AUTHOR.LAST_NAME;
}
@Override
public Field<Date> field4() {
return Author.AUTHOR.DATE_OF_BIRTH;
}
@Override
public Field<Integer> field5() {
return Author.AUTHOR.YEAR_OF_BIRTH;
}
@Override
public Field<String> field6() {
return Author.AUTHOR.ADDRESS;
}
@Override
public Integer component1() {
return getId();
}
@Override
public String component2() {
return getFirstName();
}
@Override
public String component3() {
return getLastName();
}
@Override
public Date component4() {
return getDateOfBirth();
}
@Override
public Integer component5() {
return getYearOfBirth();
}
@Override
public String component6() {
return getAddress();
}
@Override
public Integer value1() {
return getId();
}
@Override
public String value2() {
return getFirstName();
}
@Override
public String value3() {
return getLastName();
}
@Override
public Date value4() {
return getDateOfBirth();
}
@Override
public Integer value5() {
return getYearOfBirth();
}
@Override
public String value6() {
return getAddress();
}
@Override
public AuthorRecord value1(Integer value) {
setId(value);
return this;
}
@Override
public AuthorRecord value2(String value) {
setFirstName(value);
return this;
}
@Override
public AuthorRecord value3(String value) {
setLastName(value);
return this;
}
@Override
public AuthorRecord value4(Date value) {
setDateOfBirth(value);
return this;
}
@Override
public AuthorRecord value5(Integer value) {
setYearOfBirth(value);
return this;
}
@Override
public AuthorRecord value6(String value) {
setAddress(value);
return this;
}
@Override
public AuthorRecord values(Integer value1, String value2, String value3, Date value4, Integer value5, String value6) {
value1(value1);
value2(value2);
value3(value3);
value4(value4);
value5(value5);
value6(value6);
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached AuthorRecord
*/
public AuthorRecord() {
super(Author.AUTHOR);
}
/**
* Create a detached, initialised AuthorRecord
*/
public AuthorRecord(Integer id, String firstName, String lastName, Date dateOfBirth, Integer yearOfBirth, String address) {
super(Author.AUTHOR);
set(0, id);
set(1, firstName);
set(2, lastName);
set(3, dateOfBirth);
set(4, yearOfBirth);
set(5, address);
}
}

View File

@ -0,0 +1,189 @@
/*
* This file is generated by jOOQ.
*/
package org.jooq.example.flyway.ddl.db.h2.tables.records;
import javax.annotation.processing.Generated;
import org.jooq.Field;
import org.jooq.Record1;
import org.jooq.Record3;
import org.jooq.Row3;
import org.jooq.example.flyway.ddl.db.h2.tables.Book;
import org.jooq.impl.UpdatableRecordImpl;
/**
* This class is generated by jOOQ.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.12.0-SNAPSHOT"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class BookRecord extends UpdatableRecordImpl<BookRecord> implements Record3<Integer, Integer, String> {
private static final long serialVersionUID = 789103786;
/**
* Setter for <code>FLYWAY_TEST.BOOK.ID</code>.
*/
public void setId(Integer value) {
set(0, value);
}
/**
* Getter for <code>FLYWAY_TEST.BOOK.ID</code>.
*/
public Integer getId() {
return (Integer) get(0);
}
/**
* Setter for <code>FLYWAY_TEST.BOOK.AUTHOR_ID</code>.
*/
public void setAuthorId(Integer value) {
set(1, value);
}
/**
* Getter for <code>FLYWAY_TEST.BOOK.AUTHOR_ID</code>.
*/
public Integer getAuthorId() {
return (Integer) get(1);
}
/**
* Setter for <code>FLYWAY_TEST.BOOK.TITLE</code>.
*/
public void setTitle(String value) {
set(2, value);
}
/**
* Getter for <code>FLYWAY_TEST.BOOK.TITLE</code>.
*/
public String getTitle() {
return (String) get(2);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
@Override
public Record1<Integer> key() {
return (Record1) super.key();
}
// -------------------------------------------------------------------------
// Record3 type implementation
// -------------------------------------------------------------------------
@Override
public Row3<Integer, Integer, String> fieldsRow() {
return (Row3) super.fieldsRow();
}
@Override
public Row3<Integer, Integer, String> valuesRow() {
return (Row3) super.valuesRow();
}
@Override
public Field<Integer> field1() {
return Book.BOOK.ID;
}
@Override
public Field<Integer> field2() {
return Book.BOOK.AUTHOR_ID;
}
@Override
public Field<String> field3() {
return Book.BOOK.TITLE;
}
@Override
public Integer component1() {
return getId();
}
@Override
public Integer component2() {
return getAuthorId();
}
@Override
public String component3() {
return getTitle();
}
@Override
public Integer value1() {
return getId();
}
@Override
public Integer value2() {
return getAuthorId();
}
@Override
public String value3() {
return getTitle();
}
@Override
public BookRecord value1(Integer value) {
setId(value);
return this;
}
@Override
public BookRecord value2(Integer value) {
setAuthorId(value);
return this;
}
@Override
public BookRecord value3(String value) {
setTitle(value);
return this;
}
@Override
public BookRecord values(Integer value1, Integer value2, String value3) {
value1(value1);
value2(value2);
value3(value3);
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached BookRecord
*/
public BookRecord() {
super(Book.BOOK);
}
/**
* Create a detached, initialised BookRecord
*/
public BookRecord(Integer id, Integer authorId, String title) {
super(Book.BOOK);
set(0, id);
set(1, authorId);
set(2, title);
}
}

View File

@ -0,0 +1,7 @@
INSERT INTO flyway_test.author VALUES (next value for flyway_test.s_author_id, 'George', 'Orwell', '1903-06-25', 1903, null);
INSERT INTO flyway_test.author VALUES (next value for flyway_test.s_author_id, 'Paulo', 'Coelho', '1947-08-24', 1947, null);
INSERT INTO flyway_test.book VALUES (1, 1, '1984');
INSERT INTO flyway_test.book VALUES (2, 1, 'Animal Farm');
INSERT INTO flyway_test.book VALUES (3, 2, 'O Alquimista');
INSERT INTO flyway_test.book VALUES (4, 2, 'Brida');

View File

@ -0,0 +1,60 @@
package org.jooq.example.flyway.ddl;
import static java.util.Arrays.asList;
import static org.jooq.example.flyway.ddl.db.h2.Tables.AUTHOR;
import static org.jooq.example.flyway.ddl.db.h2.Tables.BOOK;
import static org.junit.Assert.assertEquals;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Properties;
import java.util.UUID;
import org.flywaydb.core.Flyway;
import org.jooq.Record3;
import org.jooq.Result;
import org.jooq.impl.DSL;
import org.jooq.tools.jdbc.SingleConnectionDataSource;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class FlywayTest {
private Connection connection;
@Before
public void setup() throws SQLException {
Properties info = new Properties();
info.put("user", "sa");
info.put("password", "");
connection = new org.h2.Driver().connect("jdbc:h2:mem:jooq-example-flyway-ddl-" + UUID.randomUUID(), info);
// This flyway migration should produce the same database as the DDLDatabase
// used by the code generator, as it is configured using flyway file sorting
Flyway flyway = Flyway.configure().dataSource(new SingleConnectionDataSource(connection)).load();
flyway.migrate();
}
@After
public void teardown() throws SQLException {
connection.close();
}
@Test
public void test() {
Result<Record3<String, String, String>> result =
DSL.using(connection)
.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, BOOK.TITLE)
.from(AUTHOR)
.join(BOOK).on(AUTHOR.ID.eq(BOOK.AUTHOR_ID))
.orderBy(AUTHOR.ID, BOOK.ID)
.fetch();
assertEquals(4, result.size());
assertEquals(asList("George", "George", "Paulo", "Paulo"), result.getValues(AUTHOR.FIRST_NAME));
assertEquals(asList("Orwell", "Orwell", "Coelho", "Coelho"), result.getValues(AUTHOR.LAST_NAME));
assertEquals(asList("1984", "Animal Farm", "O Alquimista", "Brida"), result.getValues(BOOK.TITLE));
}
}