forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
2,385 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
== jOOQ Sample | ||
|
||
To rerun the code generator: | ||
|
||
[indent=0] | ||
---- | ||
$ rm -fr gensrc | ||
$ mvn clean generate-sources -Pgenerate | ||
---- |
81 changes: 81 additions & 0 deletions
81
spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Keys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/** | ||
* This class is generated by jOOQ | ||
*/ | ||
package sample.jooq.domain; | ||
|
||
|
||
import javax.annotation.Generated; | ||
|
||
import org.jooq.ForeignKey; | ||
import org.jooq.UniqueKey; | ||
import org.jooq.impl.AbstractKeys; | ||
|
||
import sample.jooq.domain.tables.Author; | ||
import sample.jooq.domain.tables.Book; | ||
import sample.jooq.domain.tables.BookStore; | ||
import sample.jooq.domain.tables.BookToBookStore; | ||
import sample.jooq.domain.tables.Language; | ||
import sample.jooq.domain.tables.records.AuthorRecord; | ||
import sample.jooq.domain.tables.records.BookRecord; | ||
import sample.jooq.domain.tables.records.BookStoreRecord; | ||
import sample.jooq.domain.tables.records.BookToBookStoreRecord; | ||
import sample.jooq.domain.tables.records.LanguageRecord; | ||
|
||
|
||
/** | ||
* A class modelling foreign key relationships between tables of the <code>PUBLIC</code> | ||
* schema | ||
*/ | ||
@Generated( | ||
value = { | ||
"http://www.jooq.org", | ||
"jOOQ version:3.6.2" | ||
}, | ||
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<LanguageRecord> CONSTRAINT_C = UniqueKeys0.CONSTRAINT_C; | ||
public static final UniqueKey<AuthorRecord> CONSTRAINT_7 = UniqueKeys0.CONSTRAINT_7; | ||
public static final UniqueKey<BookRecord> CONSTRAINT_1 = UniqueKeys0.CONSTRAINT_1; | ||
public static final UniqueKey<BookStoreRecord> CONSTRAINT_F = UniqueKeys0.CONSTRAINT_F; | ||
public static final UniqueKey<BookToBookStoreRecord> CONSTRAINT_2 = UniqueKeys0.CONSTRAINT_2; | ||
|
||
// ------------------------------------------------------------------------- | ||
// FOREIGN KEY definitions | ||
// ------------------------------------------------------------------------- | ||
|
||
public static final ForeignKey<BookRecord, AuthorRecord> FK_BOOK_AUTHOR = ForeignKeys0.FK_BOOK_AUTHOR; | ||
public static final ForeignKey<BookRecord, LanguageRecord> FK_BOOK_LANGUAGE = ForeignKeys0.FK_BOOK_LANGUAGE; | ||
public static final ForeignKey<BookToBookStoreRecord, BookStoreRecord> FK_B2BS_BOOK_STORE = ForeignKeys0.FK_B2BS_BOOK_STORE; | ||
public static final ForeignKey<BookToBookStoreRecord, BookRecord> FK_B2BS_BOOK = ForeignKeys0.FK_B2BS_BOOK; | ||
|
||
// ------------------------------------------------------------------------- | ||
// [#1459] distribute members to avoid static initialisers > 64kb | ||
// ------------------------------------------------------------------------- | ||
|
||
private static class UniqueKeys0 extends AbstractKeys { | ||
public static final UniqueKey<LanguageRecord> CONSTRAINT_C = createUniqueKey(Language.LANGUAGE, Language.LANGUAGE.ID); | ||
public static final UniqueKey<AuthorRecord> CONSTRAINT_7 = createUniqueKey(Author.AUTHOR, Author.AUTHOR.ID); | ||
public static final UniqueKey<BookRecord> CONSTRAINT_1 = createUniqueKey(Book.BOOK, Book.BOOK.ID); | ||
public static final UniqueKey<BookStoreRecord> CONSTRAINT_F = createUniqueKey(BookStore.BOOK_STORE, BookStore.BOOK_STORE.NAME); | ||
public static final UniqueKey<BookToBookStoreRecord> CONSTRAINT_2 = createUniqueKey(BookToBookStore.BOOK_TO_BOOK_STORE, BookToBookStore.BOOK_TO_BOOK_STORE.NAME, BookToBookStore.BOOK_TO_BOOK_STORE.BOOK_ID); | ||
} | ||
|
||
private static class ForeignKeys0 extends AbstractKeys { | ||
public static final ForeignKey<BookRecord, AuthorRecord> FK_BOOK_AUTHOR = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_7, Book.BOOK, Book.BOOK.AUTHOR_ID); | ||
public static final ForeignKey<BookRecord, LanguageRecord> FK_BOOK_LANGUAGE = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_C, Book.BOOK, Book.BOOK.LANGUAGE_ID); | ||
public static final ForeignKey<BookToBookStoreRecord, BookStoreRecord> FK_B2BS_BOOK_STORE = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_F, BookToBookStore.BOOK_TO_BOOK_STORE, BookToBookStore.BOOK_TO_BOOK_STORE.NAME); | ||
public static final ForeignKey<BookToBookStoreRecord, BookRecord> FK_B2BS_BOOK = createForeignKey(sample.jooq.domain.Keys.CONSTRAINT_1, BookToBookStore.BOOK_TO_BOOK_STORE, BookToBookStore.BOOK_TO_BOOK_STORE.BOOK_ID); | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Public.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* This class is generated by jOOQ | ||
*/ | ||
package sample.jooq.domain; | ||
|
||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import javax.annotation.Generated; | ||
|
||
import org.jooq.Table; | ||
import org.jooq.impl.SchemaImpl; | ||
|
||
import sample.jooq.domain.tables.Author; | ||
import sample.jooq.domain.tables.Book; | ||
import sample.jooq.domain.tables.BookStore; | ||
import sample.jooq.domain.tables.BookToBookStore; | ||
import sample.jooq.domain.tables.Language; | ||
|
||
|
||
/** | ||
* This class is generated by jOOQ. | ||
*/ | ||
@Generated( | ||
value = { | ||
"http://www.jooq.org", | ||
"jOOQ version:3.6.2" | ||
}, | ||
comments = "This class is generated by jOOQ" | ||
) | ||
@SuppressWarnings({ "all", "unchecked", "rawtypes" }) | ||
public class Public extends SchemaImpl { | ||
|
||
private static final long serialVersionUID = 1051839433; | ||
|
||
/** | ||
* The reference instance of <code>PUBLIC</code> | ||
*/ | ||
public static final Public PUBLIC = new Public(); | ||
|
||
/** | ||
* No further instances allowed | ||
*/ | ||
private Public() { | ||
super("PUBLIC"); | ||
} | ||
|
||
@Override | ||
public final List<Table<?>> getTables() { | ||
List result = new ArrayList(); | ||
result.addAll(getTables0()); | ||
return result; | ||
} | ||
|
||
private final List<Table<?>> getTables0() { | ||
return Arrays.<Table<?>>asList( | ||
Language.LANGUAGE, | ||
Author.AUTHOR, | ||
Book.BOOK, | ||
BookStore.BOOK_STORE, | ||
BookToBookStore.BOOK_TO_BOOK_STORE); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
spring-boot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/Tables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* This class is generated by jOOQ | ||
*/ | ||
package sample.jooq.domain; | ||
|
||
|
||
import javax.annotation.Generated; | ||
|
||
import sample.jooq.domain.tables.Author; | ||
import sample.jooq.domain.tables.Book; | ||
import sample.jooq.domain.tables.BookStore; | ||
import sample.jooq.domain.tables.BookToBookStore; | ||
import sample.jooq.domain.tables.Language; | ||
|
||
|
||
/** | ||
* Convenience access to all tables in PUBLIC | ||
*/ | ||
@Generated( | ||
value = { | ||
"http://www.jooq.org", | ||
"jOOQ version:3.6.2" | ||
}, | ||
comments = "This class is generated by jOOQ" | ||
) | ||
@SuppressWarnings({ "all", "unchecked", "rawtypes" }) | ||
public class Tables { | ||
|
||
/** | ||
* The table PUBLIC.LANGUAGE | ||
*/ | ||
public static final Language LANGUAGE = sample.jooq.domain.tables.Language.LANGUAGE; | ||
|
||
/** | ||
* The table PUBLIC.AUTHOR | ||
*/ | ||
public static final Author AUTHOR = sample.jooq.domain.tables.Author.AUTHOR; | ||
|
||
/** | ||
* The table PUBLIC.BOOK | ||
*/ | ||
public static final Book BOOK = sample.jooq.domain.tables.Book.BOOK; | ||
|
||
/** | ||
* The table PUBLIC.BOOK_STORE | ||
*/ | ||
public static final BookStore BOOK_STORE = sample.jooq.domain.tables.BookStore.BOOK_STORE; | ||
|
||
/** | ||
* The table PUBLIC.BOOK_TO_BOOK_STORE | ||
*/ | ||
public static final BookToBookStore BOOK_TO_BOOK_STORE = sample.jooq.domain.tables.BookToBookStore.BOOK_TO_BOOK_STORE; | ||
} |
134 changes: 134 additions & 0 deletions
134
...ot-samples/spring-boot-sample-jooq/gensrc/main/java/sample/jooq/domain/tables/Author.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/** | ||
* This class is generated by jOOQ | ||
*/ | ||
package sample.jooq.domain.tables; | ||
|
||
|
||
import java.sql.Date; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import javax.annotation.Generated; | ||
|
||
import org.jooq.Field; | ||
import org.jooq.Table; | ||
import org.jooq.TableField; | ||
import org.jooq.UniqueKey; | ||
import org.jooq.impl.TableImpl; | ||
|
||
import sample.jooq.domain.Keys; | ||
import sample.jooq.domain.Public; | ||
import sample.jooq.domain.tables.records.AuthorRecord; | ||
|
||
|
||
/** | ||
* This class is generated by jOOQ. | ||
*/ | ||
@Generated( | ||
value = { | ||
"http://www.jooq.org", | ||
"jOOQ version:3.6.2" | ||
}, | ||
comments = "This class is generated by jOOQ" | ||
) | ||
@SuppressWarnings({ "all", "unchecked", "rawtypes" }) | ||
public class Author extends TableImpl<AuthorRecord> { | ||
|
||
private static final long serialVersionUID = -1989221607; | ||
|
||
/** | ||
* The reference instance of <code>PUBLIC.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>PUBLIC.AUTHOR.ID</code>. | ||
*/ | ||
public final TableField<AuthorRecord, Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); | ||
|
||
/** | ||
* The column <code>PUBLIC.AUTHOR.FIRST_NAME</code>. | ||
*/ | ||
public final TableField<AuthorRecord, String> FIRST_NAME = createField("FIRST_NAME", org.jooq.impl.SQLDataType.VARCHAR.length(50), this, ""); | ||
|
||
/** | ||
* The column <code>PUBLIC.AUTHOR.LAST_NAME</code>. | ||
*/ | ||
public final TableField<AuthorRecord, String> LAST_NAME = createField("LAST_NAME", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this, ""); | ||
|
||
/** | ||
* The column <code>PUBLIC.AUTHOR.DATE_OF_BIRTH</code>. | ||
*/ | ||
public final TableField<AuthorRecord, Date> DATE_OF_BIRTH = createField("DATE_OF_BIRTH", org.jooq.impl.SQLDataType.DATE, this, ""); | ||
|
||
/** | ||
* The column <code>PUBLIC.AUTHOR.YEAR_OF_BIRTH</code>. | ||
*/ | ||
public final TableField<AuthorRecord, Integer> YEAR_OF_BIRTH = createField("YEAR_OF_BIRTH", org.jooq.impl.SQLDataType.INTEGER, this, ""); | ||
|
||
/** | ||
* The column <code>PUBLIC.AUTHOR.DISTINGUISHED</code>. | ||
*/ | ||
public final TableField<AuthorRecord, Byte> DISTINGUISHED = createField("DISTINGUISHED", org.jooq.impl.SQLDataType.TINYINT, this, ""); | ||
|
||
/** | ||
* Create a <code>PUBLIC.AUTHOR</code> table reference | ||
*/ | ||
public Author() { | ||
this("AUTHOR", null); | ||
} | ||
|
||
/** | ||
* Create an aliased <code>PUBLIC.AUTHOR</code> table reference | ||
*/ | ||
public Author(String alias) { | ||
this(alias, AUTHOR); | ||
} | ||
|
||
private Author(String alias, Table<AuthorRecord> aliased) { | ||
this(alias, aliased, null); | ||
} | ||
|
||
private Author(String alias, Table<AuthorRecord> aliased, Field<?>[] parameters) { | ||
super(alias, Public.PUBLIC, aliased, parameters, ""); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public UniqueKey<AuthorRecord> getPrimaryKey() { | ||
return Keys.CONSTRAINT_7; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public List<UniqueKey<AuthorRecord>> getKeys() { | ||
return Arrays.<UniqueKey<AuthorRecord>>asList(Keys.CONSTRAINT_7); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public Author as(String alias) { | ||
return new Author(alias, this); | ||
} | ||
|
||
/** | ||
* Rename this table | ||
*/ | ||
public Author rename(String name) { | ||
return new Author(name, null); | ||
} | ||
} |
Oops, something went wrong.