[#3111] Support multiple Converters for the same <U> type in the code generator

This commit is contained in:
Lukas Eder 2014-05-05 15:14:42 +02:00
parent 591aa0f322
commit 55c3074739
14 changed files with 784 additions and 1 deletions

View File

@ -465,6 +465,22 @@
<dateAsTimestamp>false</dateAsTimestamp>
<unsignedTypes>true</unsignedTypes>
<customTypes>
<customType>
<name>3111_INVERSE</name>
<type>java.lang.Integer</type>
<converter>org.jooq.test._.converters.T_3111_InverseConverter</converter>
</customType>
<customType>
<name>3111_BOOL1</name>
<type>java.lang.Integer</type>
<converter>org.jooq.test._.converters.T_3111_Bool1Converter</converter>
</customType>
<customType>
<name>3111_BOOL2</name>
<type>java.lang.Integer</type>
<converter>org.jooq.test._.converters.T_3111_Bool2Converter</converter>
</customType>
<customType>
<name>B10</name>
<type>org.jooq.test._.converters.Boolean_10</type>
@ -497,6 +513,22 @@
</customTypes>
<forcedTypes>
<!-- [#3111] Several forced types should be able to map to the same U type -->
<forcedType>
<name>3111_INVERSE</name>
<expression>(?i:(.*?\.)?T_3111\.INVERSE)</expression>
</forcedType>
<forcedType>
<name>3111_BOOL1</name>
<expression>(?i:(.*?\.)?T_3111\.BOOL1)</expression>
</forcedType>
<forcedType>
<name>3111_BOOL2</name>
<expression>(?i:(.*?\.)?T_3111\.BOOL2)</expression>
</forcedType>
<forcedType>
<name>BOOLEAN</name>
<expression>(?i:(.*?.)?T_BOOLEANS.(VC|C|N)_BOOLEAN)</expression>

View File

@ -43,12 +43,14 @@ package org.jooq.test;
import static java.util.Arrays.asList;
import static org.jooq.conf.StatementType.STATIC_STATEMENT;
import static org.jooq.impl.DSL.field;
import static org.jooq.impl.DSL.inline;
import static org.jooq.impl.DSL.name;
import static org.jooq.impl.DSL.select;
import static org.jooq.impl.DSL.selectOne;
import static org.jooq.impl.DSL.val;
import static org.jooq.test.postgres.generatedclasses.Routines.fSearchBook;
import static org.jooq.test.postgres.generatedclasses.Tables.T_3111;
import static org.jooq.test.postgres.generatedclasses.Tables.T_639_NUMBERS_TABLE;
import static org.jooq.test.postgres.generatedclasses.Tables.T_725_LOB_TEST;
import static org.jooq.test.postgres.generatedclasses.Tables.T_785;
@ -94,6 +96,7 @@ import org.jooq.Name;
import org.jooq.Param;
import org.jooq.Record;
import org.jooq.Record1;
import org.jooq.Record3;
import org.jooq.Record5;
import org.jooq.Result;
import org.jooq.SQLDialect;
@ -131,6 +134,7 @@ import org.jooq.test.postgres.generatedclasses.tables.records.TIdentityRecord;
import org.jooq.test.postgres.generatedclasses.tables.records.TPgExtensionsRecord;
import org.jooq.test.postgres.generatedclasses.tables.records.TTriggersRecord;
import org.jooq.test.postgres.generatedclasses.tables.records.TUnsignedRecord;
import org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record;
import org.jooq.test.postgres.generatedclasses.tables.records.T_639NumbersTableRecord;
import org.jooq.test.postgres.generatedclasses.tables.records.T_725LobTestRecord;
import org.jooq.test.postgres.generatedclasses.tables.records.T_785Record;
@ -1224,4 +1228,55 @@ public class PostgresTest extends jOOQAbstractTest<
assertEquals(1, countries.get(3).length);
assertEquals(UCountry.Brazil, countries.get(3)[0]);
}
@Test
public void testPostgresMultipleConvertersForJavaLangInteger() {
try {
T_3111Record record;
record = create().newRecord(T_3111);
record.setId(1);
assertEquals(1, record.store());
record = create().newRecord(T_3111);
record.setId(2);
record.setInverse(0);
record.setBool1(0);
record.setBool2(0);
assertEquals(1, record.store());
record = create().newRecord(T_3111);
record.setId(3);
record.setInverse(1);
record.setBool1(1);
record.setBool2(-1);
assertEquals(1, record.store());
Result<Record3<Integer, Integer, Integer>> r1 =
create().select(T_3111.INVERSE, T_3111.BOOL1, T_3111.BOOL2)
.from(T_3111)
.orderBy(T_3111.ID)
.fetch();
assertEquals(3, r1.size());
assertEquals(asList(null, 0, 1), r1.getValues(T_3111.INVERSE));
assertEquals(asList(null, 0, 1), r1.getValues(T_3111.BOOL1));
assertEquals(asList(null, 0, -1), r1.getValues(T_3111.BOOL2));
// Check if actual data in database are the correct boolean values:
Result<?> r2 =
create().select(field("inverse"), field("bool1"), field("bool2"))
.from("t_3111")
.orderBy(field("id"))
.fetch();
assertEquals(3, r2.size());
assertEquals(asList(null, 0, -1), r2.getValues(0));
assertEquals(asList(null, false, true), r2.getValues(1));
assertEquals(asList(null, false, true), r2.getValues(2));
}
finally {
create().delete(T_3111).execute();
}
}
}

View File

@ -0,0 +1,77 @@
/**
* Copyright (c) 2009-2014, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* This work is dual-licensed
* - under the Apache Software License 2.0 (the "ASL")
* - under the jOOQ License and Maintenance Agreement (the "jOOQ License")
* =============================================================================
* You may choose which license applies to you:
*
* - If you're using this work with Open Source databases, you may choose
* either ASL or jOOQ License.
* - If you're using this work with at least one commercial database, you must
* choose jOOQ License
*
* For more information, please visit http://www.jooq.org/licenses
*
* Apache Software License 2.0:
* -----------------------------------------------------------------------------
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* jOOQ License and Maintenance Agreement:
* -----------------------------------------------------------------------------
* Data Geekery grants the Customer the non-exclusive, timely limited and
* non-transferable license to install and use the Software under the terms of
* the jOOQ License and Maintenance Agreement.
*
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License
* and Maintenance Agreement for more details: http://www.jooq.org/licensing
*/
package org.jooq.test._.converters;
import org.jooq.Converter;
/**
* A converter that converts boolean database columns into 1/0 Java values.
*
* @author Lukas Eder
*/
public class T_3111_Bool1Converter implements Converter<Boolean, Integer> {
/**
* Generated UID
*/
private static final long serialVersionUID = 7738949966475457017L;
@Override
public Integer from(Boolean t) {
return t == null ? null : t ? 1 : 0;
}
@Override
public Boolean to(Integer u) {
return u == null ? null : u == 1;
}
@Override
public Class<Boolean> fromType() {
return Boolean.class;
}
@Override
public Class<Integer> toType() {
return Integer.class;
}
}

View File

@ -0,0 +1,77 @@
/**
* Copyright (c) 2009-2014, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* This work is dual-licensed
* - under the Apache Software License 2.0 (the "ASL")
* - under the jOOQ License and Maintenance Agreement (the "jOOQ License")
* =============================================================================
* You may choose which license applies to you:
*
* - If you're using this work with Open Source databases, you may choose
* either ASL or jOOQ License.
* - If you're using this work with at least one commercial database, you must
* choose jOOQ License
*
* For more information, please visit http://www.jooq.org/licenses
*
* Apache Software License 2.0:
* -----------------------------------------------------------------------------
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* jOOQ License and Maintenance Agreement:
* -----------------------------------------------------------------------------
* Data Geekery grants the Customer the non-exclusive, timely limited and
* non-transferable license to install and use the Software under the terms of
* the jOOQ License and Maintenance Agreement.
*
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License
* and Maintenance Agreement for more details: http://www.jooq.org/licensing
*/
package org.jooq.test._.converters;
import org.jooq.Converter;
/**
* A converter that converts boolean database columns into -1/0 Java values.
*
* @author Lukas Eder
*/
public class T_3111_Bool2Converter implements Converter<Boolean, Integer> {
/**
* Generated UID
*/
private static final long serialVersionUID = -4817801645513273720L;
@Override
public Integer from(Boolean t) {
return t == null ? null : t ? -1 : 0;
}
@Override
public Boolean to(Integer u) {
return u == null ? null : u == -1;
}
@Override
public Class<Boolean> fromType() {
return Boolean.class;
}
@Override
public Class<Integer> toType() {
return Integer.class;
}
}

View File

@ -0,0 +1,71 @@
/**
* Copyright (c) 2009-2014, Data Geekery GmbH (http://www.datageekery.com)
* All rights reserved.
*
* This work is dual-licensed
* - under the Apache Software License 2.0 (the "ASL")
* - under the jOOQ License and Maintenance Agreement (the "jOOQ License")
* =============================================================================
* You may choose which license applies to you:
*
* - If you're using this work with Open Source databases, you may choose
* either ASL or jOOQ License.
* - If you're using this work with at least one commercial database, you must
* choose jOOQ License
*
* For more information, please visit http://www.jooq.org/licenses
*
* Apache Software License 2.0:
* -----------------------------------------------------------------------------
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* jOOQ License and Maintenance Agreement:
* -----------------------------------------------------------------------------
* Data Geekery grants the Customer the non-exclusive, timely limited and
* non-transferable license to install and use the Software under the terms of
* the jOOQ License and Maintenance Agreement.
*
* This library is distributed with a LIMITED WARRANTY. See the jOOQ License
* and Maintenance Agreement for more details: http://www.jooq.org/licensing
*/
package org.jooq.test._.converters;
import org.jooq.Converter;
public class T_3111_InverseConverter implements Converter<Integer, Integer> {
/**
* Generated UID
*/
private static final long serialVersionUID = 5022623086597770262L;
@Override
public Integer from(Integer t) {
return t == null ? null : -t;
}
@Override
public Integer to(Integer u) {
return from(u);
}
@Override
public Class<Integer> fromType() {
return Integer.class;
}
@Override
public Class<Integer> toType() {
return fromType();
}
}

View File

@ -70,6 +70,7 @@ DROP TABLE IF EXISTS t_inheritance_1_2/
DROP TABLE IF EXISTS t_inheritance_1_1/
DROP TABLE IF EXISTS t_inheritance_1/
DROP TABLE IF EXISTS t_2781/
DROP TABLE IF EXISTS t_3111/
DROP TYPE IF EXISTS u_address_type/
DROP TYPE IF EXISTS u_street_type/
@ -116,6 +117,16 @@ CREATE TYPE u_address_type AS (
)
/
CREATE TABLE t_3111 (
id int,
inverse int,
bool1 boolean,
bool2 boolean,
CONSTRAINT pk_t_3111 PRIMARY KEY (id)
)
/
CREATE TABLE t_2781 (
org text,
jooq text

View File

@ -25,6 +25,7 @@ public class Keys {
// UNIQUE and PRIMARY KEY definitions
// -------------------------------------------------------------------------
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> PK_T_3111 = UniqueKeys0.PK_T_3111;
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_639NumbersTableRecord> PK_T_639_NUMBERS_TABLE = UniqueKeys0.PK_T_639_NUMBERS_TABLE;
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_725LobTestRecord> PK_T_725_LOB_TEST = UniqueKeys0.PK_T_725_LOB_TEST;
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.TArraysRecord> PK_T_ARRAYS = UniqueKeys0.PK_T_ARRAYS;
@ -77,6 +78,7 @@ public class Keys {
}
private static class UniqueKeys0 extends org.jooq.impl.AbstractKeys {
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> PK_T_3111 = createUniqueKey(org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111, org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111.ID);
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_639NumbersTableRecord> PK_T_639_NUMBERS_TABLE = createUniqueKey(org.jooq.test.postgres.generatedclasses.tables.T_639NumbersTable.T_639_NUMBERS_TABLE, org.jooq.test.postgres.generatedclasses.tables.T_639NumbersTable.T_639_NUMBERS_TABLE.ID);
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_725LobTestRecord> PK_T_725_LOB_TEST = createUniqueKey(org.jooq.test.postgres.generatedclasses.tables.T_725LobTest.T_725_LOB_TEST, org.jooq.test.postgres.generatedclasses.tables.T_725LobTest.T_725_LOB_TEST.ID);
public static final org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.TArraysRecord> PK_T_ARRAYS = createUniqueKey(org.jooq.test.postgres.generatedclasses.tables.TArrays.T_ARRAYS, org.jooq.test.postgres.generatedclasses.tables.TArrays.T_ARRAYS.ID);

View File

@ -9,7 +9,7 @@ package org.jooq.test.postgres.generatedclasses;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Public extends org.jooq.impl.SchemaImpl {
private static final long serialVersionUID = -424292889;
private static final long serialVersionUID = 1407093112;
/**
* The singleton instance of <code>public</code>
@ -45,6 +45,7 @@ public class Public extends org.jooq.impl.SchemaImpl {
private final java.util.List<org.jooq.Table<?>> getTables0() {
return java.util.Arrays.<org.jooq.Table<?>>asList(
org.jooq.test.postgres.generatedclasses.tables.T_2781.T_2781,
org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111,
org.jooq.test.postgres.generatedclasses.tables.T_639NumbersTable.T_639_NUMBERS_TABLE,
org.jooq.test.postgres.generatedclasses.tables.T_725LobTest.T_725_LOB_TEST,
org.jooq.test.postgres.generatedclasses.tables.T_785.T_785,

View File

@ -16,6 +16,11 @@ public class Tables {
*/
public static final org.jooq.test.postgres.generatedclasses.tables.T_2781 T_2781 = org.jooq.test.postgres.generatedclasses.tables.T_2781.T_2781;
/**
* The table public.t_3111
*/
public static final org.jooq.test.postgres.generatedclasses.tables.T_3111 T_3111 = org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111;
/**
* The table public.t_639_numbers_table
*/

View File

@ -0,0 +1,99 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.test.postgres.generatedclasses.tables;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class T_3111 extends org.jooq.impl.TableImpl<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> {
private static final long serialVersionUID = -768298040;
/**
* The singleton instance of <code>public.t_3111</code>
*/
public static final org.jooq.test.postgres.generatedclasses.tables.T_3111 T_3111 = new org.jooq.test.postgres.generatedclasses.tables.T_3111();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> getRecordType() {
return org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record.class;
}
/**
* The column <code>public.t_3111.id</code>.
*/
public final org.jooq.TableField<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record, java.lang.Integer> ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>public.t_3111.inverse</code>.
*/
public final org.jooq.TableField<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record, java.lang.Integer> INVERSE = createField("inverse", org.jooq.impl.SQLDataType.INTEGER, this, "", new org.jooq.test._.converters.T_3111_InverseConverter());
/**
* The column <code>public.t_3111.bool1</code>.
*/
public final org.jooq.TableField<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record, java.lang.Integer> BOOL1 = createField("bool1", org.jooq.impl.SQLDataType.BOOLEAN, this, "", new org.jooq.test._.converters.T_3111_Bool1Converter());
/**
* The column <code>public.t_3111.bool2</code>.
*/
public final org.jooq.TableField<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record, java.lang.Integer> BOOL2 = createField("bool2", org.jooq.impl.SQLDataType.BOOLEAN, this, "", new org.jooq.test._.converters.T_3111_Bool2Converter());
/**
* Create a <code>public.t_3111</code> table reference
*/
public T_3111() {
this("t_3111", null);
}
/**
* Create an aliased <code>public.t_3111</code> table reference
*/
public T_3111(java.lang.String alias) {
this(alias, org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111);
}
private T_3111(java.lang.String alias, org.jooq.Table<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> aliased) {
this(alias, aliased, null);
}
private T_3111(java.lang.String alias, org.jooq.Table<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> aliased, org.jooq.Field<?>[] parameters) {
super(alias, org.jooq.test.postgres.generatedclasses.Public.PUBLIC, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> getPrimaryKey() {
return org.jooq.test.postgres.generatedclasses.Keys.PK_T_3111;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record>>asList(org.jooq.test.postgres.generatedclasses.Keys.PK_T_3111);
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.test.postgres.generatedclasses.tables.T_3111 as(java.lang.String alias) {
return new org.jooq.test.postgres.generatedclasses.tables.T_3111(alias, this);
}
/**
* Rename this table
*/
public org.jooq.test.postgres.generatedclasses.tables.T_3111 rename(java.lang.String name) {
return new org.jooq.test.postgres.generatedclasses.tables.T_3111(name, null);
}
}

View File

@ -0,0 +1,31 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.test.postgres.generatedclasses.tables.interfaces;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public interface IT_3111 extends java.io.Serializable {
/**
* Getter for <code>public.t_3111.id</code>.
*/
public java.lang.Integer getId();
/**
* Getter for <code>public.t_3111.inverse</code>.
*/
public java.lang.Integer getInverse();
/**
* Getter for <code>public.t_3111.bool1</code>.
*/
public java.lang.Integer getBool1();
/**
* Getter for <code>public.t_3111.bool2</code>.
*/
public java.lang.Integer getBool2();
}

View File

@ -0,0 +1,50 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.test.postgres.generatedclasses.tables.pojos;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class T_3111 implements org.jooq.test.postgres.generatedclasses.tables.interfaces.IT_3111 {
private static final long serialVersionUID = 731898893;
private final java.lang.Integer id;
private final java.lang.Integer inverse;
private final java.lang.Integer bool1;
private final java.lang.Integer bool2;
public T_3111(
java.lang.Integer id,
java.lang.Integer inverse,
java.lang.Integer bool1,
java.lang.Integer bool2
) {
this.id = id;
this.inverse = inverse;
this.bool1 = bool1;
this.bool2 = bool2;
}
@Override
public java.lang.Integer getId() {
return this.id;
}
@Override
public java.lang.Integer getInverse() {
return this.inverse;
}
@Override
public java.lang.Integer getBool1() {
return this.bool1;
}
@Override
public java.lang.Integer getBool2() {
return this.bool2;
}
}

View File

@ -0,0 +1,240 @@
/**
* This class is generated by jOOQ
*/
package org.jooq.test.postgres.generatedclasses.tables.records;
/**
* This class is generated by jOOQ.
*/
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class T_3111Record extends org.jooq.impl.UpdatableRecordImpl<org.jooq.test.postgres.generatedclasses.tables.records.T_3111Record> implements org.jooq.Record4<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer>, org.jooq.test.postgres.generatedclasses.tables.interfaces.IT_3111 {
private static final long serialVersionUID = -1992016764;
/**
* Setter for <code>public.t_3111.id</code>.
*/
public T_3111Record setId(java.lang.Integer value) {
setValue(0, value);
return this;
}
/**
* Getter for <code>public.t_3111.id</code>.
*/
@Override
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>public.t_3111.inverse</code>.
*/
public T_3111Record setInverse(java.lang.Integer value) {
setValue(1, value);
return this;
}
/**
* Getter for <code>public.t_3111.inverse</code>.
*/
@Override
public java.lang.Integer getInverse() {
return (java.lang.Integer) getValue(1);
}
/**
* Setter for <code>public.t_3111.bool1</code>.
*/
public T_3111Record setBool1(java.lang.Integer value) {
setValue(2, value);
return this;
}
/**
* Getter for <code>public.t_3111.bool1</code>.
*/
@Override
public java.lang.Integer getBool1() {
return (java.lang.Integer) getValue(2);
}
/**
* Setter for <code>public.t_3111.bool2</code>.
*/
public T_3111Record setBool2(java.lang.Integer value) {
setValue(3, value);
return this;
}
/**
* Getter for <code>public.t_3111.bool2</code>.
*/
@Override
public java.lang.Integer getBool2() {
return (java.lang.Integer) getValue(3);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record4 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer> fieldsRow() {
return (org.jooq.Row4) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row4<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer> valuesRow() {
return (org.jooq.Row4) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111.ID;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field2() {
return org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111.INVERSE;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field3() {
return org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111.BOOL1;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field4() {
return org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111.BOOL2;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value2() {
return getInverse();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value3() {
return getBool1();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value4() {
return getBool2();
}
/**
* {@inheritDoc}
*/
@Override
public T_3111Record value1(java.lang.Integer value) {
setId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public T_3111Record value2(java.lang.Integer value) {
setInverse(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public T_3111Record value3(java.lang.Integer value) {
setBool1(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public T_3111Record value4(java.lang.Integer value) {
setBool2(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public T_3111Record values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.lang.Integer value4) {
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached T_3111Record
*/
public T_3111Record() {
super(org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111);
}
/**
* Create a detached, initialised T_3111Record
*/
public T_3111Record(java.lang.Integer id, java.lang.Integer inverse, java.lang.Integer bool1, java.lang.Integer bool2) {
super(org.jooq.test.postgres.generatedclasses.tables.T_3111.T_3111);
setValue(0, id);
setValue(1, inverse);
setValue(2, bool1);
setValue(3, bool2);
}
}

View File

@ -28,6 +28,23 @@
<dateAsTimestamp>false</dateAsTimestamp>
<unsignedTypes>true</unsignedTypes>
<customTypes>
<customType>
<name>3111_INVERSE</name>
<type>java.lang.Integer</type>
<converter>org.jooq.test._.converters.T_3111_InverseConverter</converter>
</customType>
<customType>
<name>3111_BOOL1</name>
<type>java.lang.Integer</type>
<converter>org.jooq.test._.converters.T_3111_Bool1Converter</converter>
</customType>
<customType>
<name>3111_BOOL2</name>
<type>java.lang.Integer</type>
<converter>org.jooq.test._.converters.T_3111_Bool2Converter</converter>
</customType>
<customType>
<name>B10</name>
<type>org.jooq.test._.converters.Boolean_10</type>
@ -60,6 +77,21 @@
</customTypes>
<forcedTypes>
<!-- [#3111] Several forced types should be able to map to the same U type -->
<forcedType>
<name>3111_INVERSE</name>
<expression>(?i:(.*?\.)?T_3111\.INVERSE)</expression>
</forcedType>
<forcedType>
<name>3111_BOOL1</name>
<expression>(?i:(.*?\.)?T_3111\.BOOL1)</expression>
</forcedType>
<forcedType>
<name>3111_BOOL2</name>
<expression>(?i:(.*?\.)?T_3111\.BOOL2)</expression>
</forcedType>
<forcedType>
<name>BOOLEAN</name>
<expression>(?i:(.*?.)?T_BOOLEANS.(VC|C|N)_BOOLEAN)</expression>