[#2860] Added a Groovy example project

This commit is contained in:
Lukas Eder 2013-11-22 11:56:30 +01:00
parent 075730243c
commit 93f5254aec
17 changed files with 1334 additions and 0 deletions

10
jOOQ-groovy/.classpath Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="lib" path="lib/h2-1.3.170.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/jOOQ"/>
<classpathentry kind="output" path="bin"/>
</classpath>

1
jOOQ-groovy/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/bin

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<projectSuggestions/>

18
jOOQ-groovy/.project Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jOOQ-groovy</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
groovy.compiler.level=21

View File

@ -0,0 +1,29 @@
package org.jooq.groovy
import static org.jooq.impl.DSL.*
import static org.jooq.groovy.example.h2.Tables.*
import groovy.sql.Sql
import org.jooq.*
import org.jooq.impl.DSL
sql = Sql.newInstance(
'jdbc:h2:~/scala-test', 'sa', '', 'org.h2.Driver')
a = T_AUTHOR.as("a")
b = T_BOOK.as("b")
DSL.using(sql.connection)
.select(a.FIRST_NAME, a.LAST_NAME, b.TITLE)
.from(a)
.join(b).on(a.ID.eq(b.AUTHOR_ID))
.fetchInto ({
r -> println(
"${r.getValue(a.FIRST_NAME)} " +
"${r.getValue(a.LAST_NAME)} " +
"has written ${r.getValue(b.TITLE)}"
)
} as RecordHandler)

View File

@ -0,0 +1,49 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2;
/**
* This class is generated by jOOQ.
*
* A class modelling foreign key relationships between tables of the <code>PUBLIC</code>
* schema
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Keys {
// -------------------------------------------------------------------------
// IDENTITY definitions
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
// UNIQUE and PRIMARY KEY definitions
// -------------------------------------------------------------------------
public static final org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TAuthorRecord> PK_T_AUTHOR = UniqueKeys0.PK_T_AUTHOR;
public static final org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TBookRecord> PK_T_BOOK = UniqueKeys0.PK_T_BOOK;
// -------------------------------------------------------------------------
// FOREIGN KEY definitions
// -------------------------------------------------------------------------
public static final org.jooq.ForeignKey<org.jooq.groovy.example.h2.tables.records.TBookRecord, org.jooq.groovy.example.h2.tables.records.TAuthorRecord> FK_T_BOOK_AUTHOR_ID = ForeignKeys0.FK_T_BOOK_AUTHOR_ID;
public static final org.jooq.ForeignKey<org.jooq.groovy.example.h2.tables.records.TBookRecord, org.jooq.groovy.example.h2.tables.records.TAuthorRecord> FK_T_BOOK_CO_AUTHOR_ID = ForeignKeys0.FK_T_BOOK_CO_AUTHOR_ID;
// -------------------------------------------------------------------------
// [#1459] distribute members to avoid static initialisers > 64kb
// -------------------------------------------------------------------------
private static class UniqueKeys0 extends org.jooq.impl.AbstractKeys {
public static final org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TAuthorRecord> PK_T_AUTHOR = createUniqueKey(org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR, org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR.ID);
public static final org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TBookRecord> PK_T_BOOK = createUniqueKey(org.jooq.groovy.example.h2.tables.TBook.T_BOOK, org.jooq.groovy.example.h2.tables.TBook.T_BOOK.ID);
}
private static class ForeignKeys0 extends org.jooq.impl.AbstractKeys {
public static final org.jooq.ForeignKey<org.jooq.groovy.example.h2.tables.records.TBookRecord, org.jooq.groovy.example.h2.tables.records.TAuthorRecord> FK_T_BOOK_AUTHOR_ID = createForeignKey(org.jooq.groovy.example.h2.Keys.PK_T_AUTHOR, org.jooq.groovy.example.h2.tables.TBook.T_BOOK, org.jooq.groovy.example.h2.tables.TBook.T_BOOK.AUTHOR_ID);
public static final org.jooq.ForeignKey<org.jooq.groovy.example.h2.tables.records.TBookRecord, org.jooq.groovy.example.h2.tables.records.TAuthorRecord> FK_T_BOOK_CO_AUTHOR_ID = createForeignKey(org.jooq.groovy.example.h2.Keys.PK_T_AUTHOR, org.jooq.groovy.example.h2.tables.TBook.T_BOOK, org.jooq.groovy.example.h2.tables.TBook.T_BOOK.CO_AUTHOR_ID);
}
}

View File

@ -0,0 +1,52 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Public extends org.jooq.impl.SchemaImpl {
private static final long serialVersionUID = 2038761574;
/**
* The singleton instance of <code>PUBLIC</code>
*/
public static final Public PUBLIC = new Public();
/**
* No further instances allowed
*/
private Public() {
super("PUBLIC");
}
@Override
public final java.util.List<org.jooq.Sequence<?>> getSequences() {
java.util.List result = new java.util.ArrayList();
result.addAll(getSequences0());
return result;
}
private final java.util.List<org.jooq.Sequence<?>> getSequences0() {
return java.util.Arrays.<org.jooq.Sequence<?>>asList(
org.jooq.groovy.example.h2.Sequences.S_AUTHOR_ID);
}
@Override
public final java.util.List<org.jooq.Table<?>> getTables() {
java.util.List result = new java.util.ArrayList();
result.addAll(getTables0());
return result;
}
private final java.util.List<org.jooq.Table<?>> getTables0() {
return java.util.Arrays.<org.jooq.Table<?>>asList(
org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR,
org.jooq.groovy.example.h2.tables.TBook.T_BOOK);
}
}

View File

@ -0,0 +1,20 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2;
/**
* This class is generated by jOOQ.
*
* Convenience access to all sequences in PUBLIC
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Sequences {
/**
* The sequence <code>PUBLIC.S_AUTHOR_ID</code>
*/
public static final org.jooq.Sequence<java.lang.Long> S_AUTHOR_ID = new org.jooq.impl.SequenceImpl<java.lang.Long>("S_AUTHOR_ID", org.jooq.groovy.example.h2.Public.PUBLIC, org.jooq.impl.SQLDataType.BIGINT);
}

View File

@ -0,0 +1,25 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2;
/**
* This class is generated by jOOQ.
*
* Convenience access to all tables in PUBLIC
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Tables {
/**
* The table PUBLIC.T_AUTHOR
*/
public static final org.jooq.groovy.example.h2.tables.TAuthor T_AUTHOR = org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR;
/**
* The table PUBLIC.T_BOOK
*/
public static final org.jooq.groovy.example.h2.tables.TBook T_BOOK = org.jooq.groovy.example.h2.tables.TBook.T_BOOK;
}

View File

@ -0,0 +1,96 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2.tables;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TAuthor extends org.jooq.impl.TableImpl<org.jooq.groovy.example.h2.tables.records.TAuthorRecord> {
private static final long serialVersionUID = 1565954972;
/**
* The singleton instance of <code>PUBLIC.T_AUTHOR</code>
*/
public static final org.jooq.groovy.example.h2.tables.TAuthor T_AUTHOR = new org.jooq.groovy.example.h2.tables.TAuthor();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<org.jooq.groovy.example.h2.tables.records.TAuthorRecord> getRecordType() {
return org.jooq.groovy.example.h2.tables.records.TAuthorRecord.class;
}
/**
* The column <code>PUBLIC.T_AUTHOR.ID</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TAuthorRecord, java.lang.Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this);
/**
* The column <code>PUBLIC.T_AUTHOR.FIRST_NAME</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TAuthorRecord, java.lang.String> FIRST_NAME = createField("FIRST_NAME", org.jooq.impl.SQLDataType.VARCHAR.length(50), this);
/**
* The column <code>PUBLIC.T_AUTHOR.LAST_NAME</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TAuthorRecord, java.lang.String> LAST_NAME = createField("LAST_NAME", org.jooq.impl.SQLDataType.VARCHAR.length(50).nullable(false), this);
/**
* The column <code>PUBLIC.T_AUTHOR.DATE_OF_BIRTH</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TAuthorRecord, java.sql.Timestamp> DATE_OF_BIRTH = createField("DATE_OF_BIRTH", org.jooq.impl.SQLDataType.TIMESTAMP, this);
/**
* The column <code>PUBLIC.T_AUTHOR.YEAR_OF_BIRTH</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TAuthorRecord, java.lang.Integer> YEAR_OF_BIRTH = createField("YEAR_OF_BIRTH", org.jooq.impl.SQLDataType.INTEGER, this);
/**
* The column <code>PUBLIC.T_AUTHOR.ADDRESS</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TAuthorRecord, java.lang.String> ADDRESS = createField("ADDRESS", org.jooq.impl.SQLDataType.VARCHAR.length(50), this);
/**
* Create a <code>PUBLIC.T_AUTHOR</code> table reference
*/
public TAuthor() {
super("T_AUTHOR", org.jooq.groovy.example.h2.Public.PUBLIC);
}
/**
* Create an aliased <code>PUBLIC.T_AUTHOR</code> table reference
*/
public TAuthor(java.lang.String alias) {
super(alias, org.jooq.groovy.example.h2.Public.PUBLIC, org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR);
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TAuthorRecord> getPrimaryKey() {
return org.jooq.groovy.example.h2.Keys.PK_T_AUTHOR;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TAuthorRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TAuthorRecord>>asList(org.jooq.groovy.example.h2.Keys.PK_T_AUTHOR);
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.groovy.example.h2.tables.TAuthor as(java.lang.String alias) {
return new org.jooq.groovy.example.h2.tables.TAuthor(alias);
}
}

View File

@ -0,0 +1,129 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2.tables;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TBook extends org.jooq.impl.TableImpl<org.jooq.groovy.example.h2.tables.records.TBookRecord> {
private static final long serialVersionUID = 1194523510;
/**
* The singleton instance of <code>PUBLIC.T_BOOK</code>
*/
public static final org.jooq.groovy.example.h2.tables.TBook T_BOOK = new org.jooq.groovy.example.h2.tables.TBook();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<org.jooq.groovy.example.h2.tables.records.TBookRecord> getRecordType() {
return org.jooq.groovy.example.h2.tables.records.TBookRecord.class;
}
/**
* The column <code>PUBLIC.T_BOOK.ID</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.Integer> ID = createField("ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this);
/**
* The column <code>PUBLIC.T_BOOK.AUTHOR_ID</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.Integer> AUTHOR_ID = createField("AUTHOR_ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this);
/**
* The column <code>PUBLIC.T_BOOK.CO_AUTHOR_ID</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.Integer> CO_AUTHOR_ID = createField("CO_AUTHOR_ID", org.jooq.impl.SQLDataType.INTEGER, this);
/**
* The column <code>PUBLIC.T_BOOK.DETAILS_ID</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.Integer> DETAILS_ID = createField("DETAILS_ID", org.jooq.impl.SQLDataType.INTEGER, this);
/**
* The column <code>PUBLIC.T_BOOK.TITLE</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.String> TITLE = createField("TITLE", org.jooq.impl.SQLDataType.VARCHAR.length(400).nullable(false), this);
/**
* The column <code>PUBLIC.T_BOOK.PUBLISHED_IN</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.Integer> PUBLISHED_IN = createField("PUBLISHED_IN", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this);
/**
* The column <code>PUBLIC.T_BOOK.LANGUAGE_ID</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.Integer> LANGUAGE_ID = createField("LANGUAGE_ID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this);
/**
* The column <code>PUBLIC.T_BOOK.CONTENT_TEXT</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.String> CONTENT_TEXT = createField("CONTENT_TEXT", org.jooq.impl.SQLDataType.CLOB.length(2147483647), this);
/**
* The column <code>PUBLIC.T_BOOK.CONTENT_PDF</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, byte[]> CONTENT_PDF = createField("CONTENT_PDF", org.jooq.impl.SQLDataType.BLOB.length(2147483647), this);
/**
* The column <code>PUBLIC.T_BOOK.REC_VERSION</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.lang.Integer> REC_VERSION = createField("REC_VERSION", org.jooq.impl.SQLDataType.INTEGER, this);
/**
* The column <code>PUBLIC.T_BOOK.REC_TIMESTAMP</code>.
*/
public final org.jooq.TableField<org.jooq.groovy.example.h2.tables.records.TBookRecord, java.sql.Timestamp> REC_TIMESTAMP = createField("REC_TIMESTAMP", org.jooq.impl.SQLDataType.TIMESTAMP, this);
/**
* Create a <code>PUBLIC.T_BOOK</code> table reference
*/
public TBook() {
super("T_BOOK", org.jooq.groovy.example.h2.Public.PUBLIC);
}
/**
* Create an aliased <code>PUBLIC.T_BOOK</code> table reference
*/
public TBook(java.lang.String alias) {
super(alias, org.jooq.groovy.example.h2.Public.PUBLIC, org.jooq.groovy.example.h2.tables.TBook.T_BOOK);
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TBookRecord> getPrimaryKey() {
return org.jooq.groovy.example.h2.Keys.PK_T_BOOK;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TBookRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<org.jooq.groovy.example.h2.tables.records.TBookRecord>>asList(org.jooq.groovy.example.h2.Keys.PK_T_BOOK);
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.ForeignKey<org.jooq.groovy.example.h2.tables.records.TBookRecord, ?>> getReferences() {
return java.util.Arrays.<org.jooq.ForeignKey<org.jooq.groovy.example.h2.tables.records.TBookRecord, ?>>asList(org.jooq.groovy.example.h2.Keys.FK_T_BOOK_AUTHOR_ID, org.jooq.groovy.example.h2.Keys.FK_T_BOOK_CO_AUTHOR_ID);
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.groovy.example.h2.tables.TBook as(java.lang.String alias) {
return new org.jooq.groovy.example.h2.tables.TBook(alias);
}
}

View File

@ -0,0 +1,88 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2.tables.pojos;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TAuthor implements java.io.Serializable {
private static final long serialVersionUID = 1333576897;
private java.lang.Integer id;
private java.lang.String firstName;
private java.lang.String lastName;
private java.sql.Timestamp dateOfBirth;
private java.lang.Integer yearOfBirth;
private java.lang.String address;
public TAuthor() {}
public TAuthor(
java.lang.Integer id,
java.lang.String firstName,
java.lang.String lastName,
java.sql.Timestamp dateOfBirth,
java.lang.Integer yearOfBirth,
java.lang.String address
) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
this.dateOfBirth = dateOfBirth;
this.yearOfBirth = yearOfBirth;
this.address = address;
}
public java.lang.Integer getId() {
return this.id;
}
public void setId(java.lang.Integer id) {
this.id = id;
}
public java.lang.String getFirstName() {
return this.firstName;
}
public void setFirstName(java.lang.String firstName) {
this.firstName = firstName;
}
public java.lang.String getLastName() {
return this.lastName;
}
public void setLastName(java.lang.String lastName) {
this.lastName = lastName;
}
public java.sql.Timestamp getDateOfBirth() {
return this.dateOfBirth;
}
public void setDateOfBirth(java.sql.Timestamp dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public java.lang.Integer getYearOfBirth() {
return this.yearOfBirth;
}
public void setYearOfBirth(java.lang.Integer yearOfBirth) {
this.yearOfBirth = yearOfBirth;
}
public java.lang.String getAddress() {
return this.address;
}
public void setAddress(java.lang.String address) {
this.address = address;
}
}

View File

@ -0,0 +1,143 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2.tables.pojos;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TBook implements java.io.Serializable {
private static final long serialVersionUID = -1404736907;
private java.lang.Integer id;
private java.lang.Integer authorId;
private java.lang.Integer coAuthorId;
private java.lang.Integer detailsId;
private java.lang.String title;
private java.lang.Integer publishedIn;
private java.lang.Integer languageId;
private java.lang.String contentText;
private byte[] contentPdf;
private java.lang.Integer recVersion;
private java.sql.Timestamp recTimestamp;
public TBook() {}
public TBook(
java.lang.Integer id,
java.lang.Integer authorId,
java.lang.Integer coAuthorId,
java.lang.Integer detailsId,
java.lang.String title,
java.lang.Integer publishedIn,
java.lang.Integer languageId,
java.lang.String contentText,
byte[] contentPdf,
java.lang.Integer recVersion,
java.sql.Timestamp recTimestamp
) {
this.id = id;
this.authorId = authorId;
this.coAuthorId = coAuthorId;
this.detailsId = detailsId;
this.title = title;
this.publishedIn = publishedIn;
this.languageId = languageId;
this.contentText = contentText;
this.contentPdf = contentPdf;
this.recVersion = recVersion;
this.recTimestamp = recTimestamp;
}
public java.lang.Integer getId() {
return this.id;
}
public void setId(java.lang.Integer id) {
this.id = id;
}
public java.lang.Integer getAuthorId() {
return this.authorId;
}
public void setAuthorId(java.lang.Integer authorId) {
this.authorId = authorId;
}
public java.lang.Integer getCoAuthorId() {
return this.coAuthorId;
}
public void setCoAuthorId(java.lang.Integer coAuthorId) {
this.coAuthorId = coAuthorId;
}
public java.lang.Integer getDetailsId() {
return this.detailsId;
}
public void setDetailsId(java.lang.Integer detailsId) {
this.detailsId = detailsId;
}
public java.lang.String getTitle() {
return this.title;
}
public void setTitle(java.lang.String title) {
this.title = title;
}
public java.lang.Integer getPublishedIn() {
return this.publishedIn;
}
public void setPublishedIn(java.lang.Integer publishedIn) {
this.publishedIn = publishedIn;
}
public java.lang.Integer getLanguageId() {
return this.languageId;
}
public void setLanguageId(java.lang.Integer languageId) {
this.languageId = languageId;
}
public java.lang.String getContentText() {
return this.contentText;
}
public void setContentText(java.lang.String contentText) {
this.contentText = contentText;
}
public byte[] getContentPdf() {
return this.contentPdf;
}
public void setContentPdf(byte[] contentPdf) {
this.contentPdf = contentPdf;
}
public java.lang.Integer getRecVersion() {
return this.recVersion;
}
public void setRecVersion(java.lang.Integer recVersion) {
this.recVersion = recVersion;
}
public java.sql.Timestamp getRecTimestamp() {
return this.recTimestamp;
}
public void setRecTimestamp(java.sql.Timestamp recTimestamp) {
this.recTimestamp = recTimestamp;
}
}

View File

@ -0,0 +1,252 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2.tables.records;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TAuthorRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.groovy.example.h2.tables.records.TAuthorRecord> implements org.jooq.Record6<java.lang.Integer, java.lang.String, java.lang.String, java.sql.Timestamp, java.lang.Integer, java.lang.String> {
private static final long serialVersionUID = -315637049;
/**
* Setter for <code>PUBLIC.T_AUTHOR.ID</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>PUBLIC.T_AUTHOR.ID</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>PUBLIC.T_AUTHOR.FIRST_NAME</code>.
*/
public void setFirstName(java.lang.String value) {
setValue(1, value);
}
/**
* Getter for <code>PUBLIC.T_AUTHOR.FIRST_NAME</code>.
*/
public java.lang.String getFirstName() {
return (java.lang.String) getValue(1);
}
/**
* Setter for <code>PUBLIC.T_AUTHOR.LAST_NAME</code>.
*/
public void setLastName(java.lang.String value) {
setValue(2, value);
}
/**
* Getter for <code>PUBLIC.T_AUTHOR.LAST_NAME</code>.
*/
public java.lang.String getLastName() {
return (java.lang.String) getValue(2);
}
/**
* Setter for <code>PUBLIC.T_AUTHOR.DATE_OF_BIRTH</code>.
*/
public void setDateOfBirth(java.sql.Timestamp value) {
setValue(3, value);
}
/**
* Getter for <code>PUBLIC.T_AUTHOR.DATE_OF_BIRTH</code>.
*/
public java.sql.Timestamp getDateOfBirth() {
return (java.sql.Timestamp) getValue(3);
}
/**
* Setter for <code>PUBLIC.T_AUTHOR.YEAR_OF_BIRTH</code>.
*/
public void setYearOfBirth(java.lang.Integer value) {
setValue(4, value);
}
/**
* Getter for <code>PUBLIC.T_AUTHOR.YEAR_OF_BIRTH</code>.
*/
public java.lang.Integer getYearOfBirth() {
return (java.lang.Integer) getValue(4);
}
/**
* Setter for <code>PUBLIC.T_AUTHOR.ADDRESS</code>.
*/
public void setAddress(java.lang.String value) {
setValue(5, value);
}
/**
* Getter for <code>PUBLIC.T_AUTHOR.ADDRESS</code>.
*/
public java.lang.String getAddress() {
return (java.lang.String) getValue(5);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record6 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row6<java.lang.Integer, java.lang.String, java.lang.String, java.sql.Timestamp, java.lang.Integer, java.lang.String> fieldsRow() {
return (org.jooq.Row6) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row6<java.lang.Integer, java.lang.String, java.lang.String, java.sql.Timestamp, java.lang.Integer, java.lang.String> valuesRow() {
return (org.jooq.Row6) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR.ID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field2() {
return org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR.FIRST_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field3() {
return org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR.LAST_NAME;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Timestamp> field4() {
return org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR.DATE_OF_BIRTH;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field5() {
return org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR.YEAR_OF_BIRTH;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field6() {
return org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR.ADDRESS;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value2() {
return getFirstName();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value3() {
return getLastName();
}
/**
* {@inheritDoc}
*/
@Override
public java.sql.Timestamp value4() {
return getDateOfBirth();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value5() {
return getYearOfBirth();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value6() {
return getAddress();
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached TAuthorRecord
*/
public TAuthorRecord() {
super(org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR);
}
/**
* Create a detached, initialised TAuthorRecord
*/
public TAuthorRecord(java.lang.Integer id, java.lang.String firstName, java.lang.String lastName, java.sql.Timestamp dateOfBirth, java.lang.Integer yearOfBirth, java.lang.String address) {
super(org.jooq.groovy.example.h2.tables.TAuthor.T_AUTHOR);
setValue(0, id);
setValue(1, firstName);
setValue(2, lastName);
setValue(3, dateOfBirth);
setValue(4, yearOfBirth);
setValue(5, address);
}
}

View File

@ -0,0 +1,407 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.groovy.example.h2.tables.records;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.2.1" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class TBookRecord extends org.jooq.impl.UpdatableRecordImpl<org.jooq.groovy.example.h2.tables.records.TBookRecord> implements org.jooq.Record11<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String, byte[], java.lang.Integer, java.sql.Timestamp> {
private static final long serialVersionUID = 439492631;
/**
* Setter for <code>PUBLIC.T_BOOK.ID</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.ID</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>PUBLIC.T_BOOK.AUTHOR_ID</code>.
*/
public void setAuthorId(java.lang.Integer value) {
setValue(1, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.AUTHOR_ID</code>.
*/
public java.lang.Integer getAuthorId() {
return (java.lang.Integer) getValue(1);
}
/**
* Setter for <code>PUBLIC.T_BOOK.CO_AUTHOR_ID</code>.
*/
public void setCoAuthorId(java.lang.Integer value) {
setValue(2, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.CO_AUTHOR_ID</code>.
*/
public java.lang.Integer getCoAuthorId() {
return (java.lang.Integer) getValue(2);
}
/**
* Setter for <code>PUBLIC.T_BOOK.DETAILS_ID</code>.
*/
public void setDetailsId(java.lang.Integer value) {
setValue(3, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.DETAILS_ID</code>.
*/
public java.lang.Integer getDetailsId() {
return (java.lang.Integer) getValue(3);
}
/**
* Setter for <code>PUBLIC.T_BOOK.TITLE</code>.
*/
public void setTitle(java.lang.String value) {
setValue(4, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.TITLE</code>.
*/
public java.lang.String getTitle() {
return (java.lang.String) getValue(4);
}
/**
* Setter for <code>PUBLIC.T_BOOK.PUBLISHED_IN</code>.
*/
public void setPublishedIn(java.lang.Integer value) {
setValue(5, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.PUBLISHED_IN</code>.
*/
public java.lang.Integer getPublishedIn() {
return (java.lang.Integer) getValue(5);
}
/**
* Setter for <code>PUBLIC.T_BOOK.LANGUAGE_ID</code>.
*/
public void setLanguageId(java.lang.Integer value) {
setValue(6, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.LANGUAGE_ID</code>.
*/
public java.lang.Integer getLanguageId() {
return (java.lang.Integer) getValue(6);
}
/**
* Setter for <code>PUBLIC.T_BOOK.CONTENT_TEXT</code>.
*/
public void setContentText(java.lang.String value) {
setValue(7, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.CONTENT_TEXT</code>.
*/
public java.lang.String getContentText() {
return (java.lang.String) getValue(7);
}
/**
* Setter for <code>PUBLIC.T_BOOK.CONTENT_PDF</code>.
*/
public void setContentPdf(byte[] value) {
setValue(8, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.CONTENT_PDF</code>.
*/
public byte[] getContentPdf() {
return (byte[]) getValue(8);
}
/**
* Setter for <code>PUBLIC.T_BOOK.REC_VERSION</code>.
*/
public void setRecVersion(java.lang.Integer value) {
setValue(9, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.REC_VERSION</code>.
*/
public java.lang.Integer getRecVersion() {
return (java.lang.Integer) getValue(9);
}
/**
* Setter for <code>PUBLIC.T_BOOK.REC_TIMESTAMP</code>.
*/
public void setRecTimestamp(java.sql.Timestamp value) {
setValue(10, value);
}
/**
* Getter for <code>PUBLIC.T_BOOK.REC_TIMESTAMP</code>.
*/
public java.sql.Timestamp getRecTimestamp() {
return (java.sql.Timestamp) getValue(10);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record11 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row11<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String, byte[], java.lang.Integer, java.sql.Timestamp> fieldsRow() {
return (org.jooq.Row11) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row11<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.String, byte[], java.lang.Integer, java.sql.Timestamp> valuesRow() {
return (org.jooq.Row11) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.ID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field2() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.AUTHOR_ID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field3() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.CO_AUTHOR_ID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field4() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.DETAILS_ID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field5() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.TITLE;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field6() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.PUBLISHED_IN;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field7() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.LANGUAGE_ID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field8() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.CONTENT_TEXT;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<byte[]> field9() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.CONTENT_PDF;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field10() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.REC_VERSION;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Timestamp> field11() {
return org.jooq.groovy.example.h2.tables.TBook.T_BOOK.REC_TIMESTAMP;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value2() {
return getAuthorId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value3() {
return getCoAuthorId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value4() {
return getDetailsId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value5() {
return getTitle();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value6() {
return getPublishedIn();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value7() {
return getLanguageId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.String value8() {
return getContentText();
}
/**
* {@inheritDoc}
*/
@Override
public byte[] value9() {
return getContentPdf();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value10() {
return getRecVersion();
}
/**
* {@inheritDoc}
*/
@Override
public java.sql.Timestamp value11() {
return getRecTimestamp();
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached TBookRecord
*/
public TBookRecord() {
super(org.jooq.groovy.example.h2.tables.TBook.T_BOOK);
}
/**
* Create a detached, initialised TBookRecord
*/
public TBookRecord(java.lang.Integer id, java.lang.Integer authorId, java.lang.Integer coAuthorId, java.lang.Integer detailsId, java.lang.String title, java.lang.Integer publishedIn, java.lang.Integer languageId, java.lang.String contentText, byte[] contentPdf, java.lang.Integer recVersion, java.sql.Timestamp recTimestamp) {
super(org.jooq.groovy.example.h2.tables.TBook.T_BOOK);
setValue(0, id);
setValue(1, authorId);
setValue(2, coAuthorId);
setValue(3, detailsId);
setValue(4, title);
setValue(5, publishedIn);
setValue(6, languageId);
setValue(7, contentText);
setValue(8, contentPdf);
setValue(9, recVersion);
setValue(10, recTimestamp);
}
}