Digest for jooq-user@googlegroups.com - 9 updates in 3 topics

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Digest for jooq-user@googlegroups.com - 9 updates in 3 topics

http://groups.google.com/group/jooq-user/topics mailing list
"Thorsten Schöning" <[hidden email]>: Sep 18 07:57PM +0200

Hi all,
 
I have a lot of SELECTs in which I only query individual columns of
various tables, sometimes JOINed, sometimes not. In many of those
cases the queries result in types with pretty long generic definitions
of "RecordX<...>", like in the following example:
 
> [...]
> .where(REAL_ESTATE.DELETED.isFalse())
> [...]
 
I would like to reduce that "Record6"-stuff to some better named
custom type but don't understand how to do that without implementing
all those interfaces defined by "Record", which already have been
implemented by jOOQ. Neither RecordImpl, AbstractRecord or their
counterparts for rows are publicly accessible or can be extended.
 
Looking at things like "fetchInto" and "Record.into", I additionally
have the feeling that I would be able to reduce "Record6"-stuff only
in combination with actually fetching data. But I sometimes build
queries spanning multiple methods and would like to get that
"Record6"-stuff out of the way in those cases as well.
 
The nearest thing I found was the following, which reads like fetching
all columns of the tables part of the query in the end:
 
https://www.jooq.org/doc/latest/manual/sql-execution/fetching/record-vs-tablerecord/
 
What I would really like to do is simply creating a custom class or
interface with very little boilerplate like a CTOR only or such,
actually extending/implementing "Record6" and somehow reusing all the
already available implementation of jOOQ. Than I would like to tell
"select" that the indidvidual columns are actually of my custom
records type and use that from than on.
 
> [...]
> .where(REAL_ESTATE.DELETED.isFalse())
> [...]
 
Is something like that possible? Thanks!
 
Mit freundlichen Grüßen,
 
Thorsten Schöning
 
--
Thorsten Schöning E-Mail: [hidden email]
AM-SoFT IT-Systeme http://www.AM-SoFT.de/
 
Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04
 
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
Debapriya Patra <[hidden email]>: Sep 17 04:27PM -0700

Hi,
 
I have upgraded from jOOQ-3.11.8 => jOOQ-3.12.1 which is causing an issue
while generating/compiling one of jOOQ generated java class.
 
Its generating a field which is not getting compiled because method is no
more present in 3.12.1 . I am not clear how the class is generated with
that method .
 
*Java File Generated By Jooq*
 
/*
* This file is generated by jOOQ.
*/
package com.chegg.flipper_service.db.tables;
 
 
import com.chegg.flipper.service.PostgresJSONJsonNodeBinding;
import com.chegg.flipper_service.db.Public;
import com.chegg.flipper_service.db.enums.EndSessionReason;
import com.chegg.flipper_service.db.enums.SessionFilter;
import com.chegg.flipper_service.db.enums.SessionSide;
import com.chegg.flipper_service.db.tables.records.ScoringSessionRecord;
import com.fasterxml.jackson.databind.JsonNode;
 
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.UUID;
 
import javax.annotation.processing.Generated;
 
import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Row12;
import org.jooq.Schema;
import org.jooq.Table;
import org.jooq.TableField;
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.1"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ScoringSession extends TableImpl<ScoringSessionRecord> {
 
private static final long serialVersionUID = -871868814;
 
/**
* The reference instance of <code>public.scoring_session</code>
*/
public static final ScoringSession SCORING_SESSION = new ScoringSession();
 
/**
* The class holding records for this type
*/
@Override
public Class<ScoringSessionRecord> getRecordType() {
return ScoringSessionRecord.class;
}
 
/**
* The column <code>public.scoring_session.id</code>.
*/
public final TableField<ScoringSessionRecord, UUID> ID = createField(DSL.name("id"), org.jooq.impl.SQLDataType.UUID, this, "");
 
/**
* The column <code>public.scoring_session.created</code>.
*/
public final TableField<ScoringSessionRecord, Timestamp> CREATED = createField(DSL.name("created"), org.jooq.impl.SQLDataType.TIMESTAMP, this, "");
 
/**
* The column <code>public.scoring_session.updated</code>.
*/
public final TableField<ScoringSessionRecord, Timestamp> UPDATED = createField(DSL.name("updated"), org.jooq.impl.SQLDataType.TIMESTAMP, this, "");
 
/**
* The column <code>public.scoring_session.deck_id</code>.
*/
public final TableField<ScoringSessionRecord, UUID> DECK_ID = createField(DSL.name("deck_id"), org.jooq.impl.SQLDataType.UUID, this, "");
 
/**
* The column <code>public.scoring_session.session_size</code>.
*/
public final TableField<ScoringSessionRecord, Integer> SESSION_SIZE = createField(DSL.name("session_size"), org.jooq.impl.SQLDataType.INTEGER, this, "");
 
/**
* The column <code>public.scoring_session.session_filter</code>.
*/
public final TableField<ScoringSessionRecord, SessionFilter> SESSION_FILTER = createField(DSL.name("session_filter"), org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType(com.chegg.flipper_service.db.enums.SessionFilter.class), this, "");
 
/**
* The column <code>public.scoring_session.session_side</code>.
*/
public final TableField<ScoringSessionRecord, SessionSide> SESSION_SIDE = createField(DSL.name("session_side"), org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType(com.chegg.flipper_service.db.enums.SessionSide.class), this, "");
 
/**
* The column <code>public.scoring_session.card_score</code>.
*/
public final TableField<ScoringSessionRecord, JsonNode> CARD_SCORE = createField(DSL.name("card_score"), org.jooq.impl.SQLDataType.JSONB, this, "", new PostgresJSONJsonNodeBinding());
 
/**
* The column <code>public.scoring_session.end_session</code>.
*/
public final TableField<ScoringSessionRecord, Boolean> END_SESSION = createField(DSL.name("end_session"), org.jooq.impl.SQLDataType.BOOLEAN, this, "");
 
/**
* The column <code>public.scoring_session.user_id</code>.
*/
public final TableField<ScoringSessionRecord, UUID> USER_ID = createField(DSL.name("user_id"), org.jooq.impl.SQLDataType.UUID, this, "");
 
/**
* The column <code>public.scoring_session.percentage</code>.
*/
public final TableField<ScoringSessionRecord, BigDecimal> PERCENTAGE = createField(DSL.name("percentage"), org.jooq.impl.SQLDataType.NUMERIC(5, 2), this, "");
 
/**
* The column <code>public.scoring_session.reason</code>.
*/
public final TableField<ScoringSessionRecord, EndSessionReason> REASON = createField(DSL.name("reason"), org.jooq.impl.SQLDataType.VARCHAR.asEnumDataType(com.chegg.flipper_service.db.enums.EndSessionReason.class), this, "");
 
/**
* Create a <code>public.scoring_session</code> table reference
*/
public ScoringSession() {
this(DSL.name("scoring_session"), null);
}
 
/**
* Create an aliased <code>public.scoring_session</code> table reference
*/
public ScoringSession(String alias) {
this(DSL.name(alias), SCORING_SESSION);
}
 
/**
* Create an aliased <code>public.scoring_session</code> table reference
*/
public ScoringSession(Name alias) {
this(alias, SCORING_SESSION);
}
 
private ScoringSession(Name alias, Table<ScoringSessionRecord> aliased) {
this(alias, aliased, null);
}
 
private ScoringSession(Name alias, Table<ScoringSessionRecord> aliased, Field<?>[] parameters) {
super(alias, null, aliased, parameters, DSL.comment(""));
}
 
public <O extends Record> ScoringSession(Table<O> child, ForeignKey<O, ScoringSessionRecord> key) {
super(child, key, SCORING_SESSION);
}
 
@Override
public Schema getSchema() {
return Public.PUBLIC;
}
 
@Override
public ScoringSession as(String alias) {
return new ScoringSession(DSL.name(alias), this);
}
 
@Override
public ScoringSession as(Name alias) {
return new ScoringSession(alias, this);
}
 
/**
* Rename this table
*/
@Override
public ScoringSession rename(String name) {
return new ScoringSession(DSL.name(name), null);
}
 
/**
* Rename this table
*/
@Override
public ScoringSession rename(Name name) {
return new ScoringSession(name, null);
}
 
// -------------------------------------------------------------------------
// Row12 type methods
// -------------------------------------------------------------------------
 
@Override
public Row12<UUID, Timestamp, Timestamp, UUID, Integer, SessionFilter, SessionSide, JsonNode, Boolean, UUID, BigDecimal, EndSessionReason> fieldsRow() {
return (Row12) super.fieldsRow();
}
}
 
 
*Compile Error For the field*
 
/**
* The column <code>public.scoring_session.card_score</code>.
*/
public final TableField<ScoringSessionRecord, JsonNode> CARD_SCORE = createField(DSL.name("card_score"), org.jooq.impl.SQLDataType.JSONB, this, "", new PostgresJSONJsonNodeBinding());
 
 
*Jooq Generated Log With Compile Error*
 
Ente> Task :generateDbJooqSchemaSource
Sep 17, 2019 3:34:56 PM org.jooq.tools.JooqLogger info
INFO: Initialising properties :
/Users/dpatra/Downloads/FTCodeBase/FlipperService/flipper-service/build/tmp/generateDbJooqSchemaSource/config.xml
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jooq.tools.reflect.Reflect
(file:/Users/dpatra/.gradle/caches/modules-2/files-2.1/org.jooq/jooq/3.12.1/e781f264e17756c3f372d72ec29c7049cc65473c/jooq-3.12.1.jar)
to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)
WARNING: Please consider reporting this to the maintainers of
org.jooq.tools.reflect.Reflect
WARNING: Use --illegal-access=warn to enable warnings of further illegal
reflective access operations
WARNING: All illegal access operations will be denied in a future release
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: No <inputCatalog/> was provided. Generating ALL available catalogs
instead.
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: License parameters
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: ----------------------------------------------------------
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: Thank you for using jOOQ and jOOQ's code generator
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO:
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: Database parameters
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: ----------------------------------------------------------
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: dialect : POSTGRES
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: URL : jdbc:postgresql://localhost:5432/flipper
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: target dir : build/src/generated/java
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: target package : com.chegg.flipper_service.db
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: includes : [.*]
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: excludes :
[BATCH_.*|API_OUTPUT_.*|DATABASECHANGELOG.*]
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: includeExcludeColumns : false
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: ----------------------------------------------------------
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO:
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: JavaGenerator parameters
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: ----------------------------------------------------------
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: annotations (generated): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: annotations (JPA: any) : false
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: annotations (JPA: version):
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: annotations (validation): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on attributes : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on catalogs : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on columns : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on keys : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on links : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on packages : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on parameters : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on queues : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on routines : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on schemas : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on sequences : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on tables : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: comments on udts : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: daos : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: deprecated code : false
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (any): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (catalogs): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (keys): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (links): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (queues): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (routines): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (schemas): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (sequences): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (tables): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: global references (udts): true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: indexes : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: instance fields : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: interfaces : false
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: interfaces (immutable) : false
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: javadoc : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: keys : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: links : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: pojos : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: pojos (immutable) : false
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: queues : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: records : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: routines : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: sequences : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: table-valued functions : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: tables : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: udts : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: relations : true
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: ----------------------------------------------------------
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO:
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: Generation remarks
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: ----------------------------------------------------------
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO:
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: ----------------------------------------------------------
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO: Generating catalogs : Total: 1
Sep 17, 2019 3:34:57 PM org.jooq.tools.JooqLogger info
INFO:
 
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@ @@ @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@
@@@@@@@@@@@@@@@@ @@ @@ @@@@@@@@@@
@@@@@@@@@@ @@@@ @@ @@ @@@@@@@@@@
@@@@@@@@@@ @@ @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@ @@ @@@@@@@@@@
Knut Wannheden <[hidden email]>: Sep 18 08:07AM +0200

Hi Deba,
 
As you can see your CARD_SCORE field uses the new JSONB data type (new in
jOOQ 3.12) and as a consequence you need to change the generic type
parameters and implementation of PostgresJSONJsonNodeBinding to match that.
I suggest you take a look at https://github.com/jOOQ/jOOQ/issues/9195 where
this question was recently discussed.
 
Hope this helps,
Knut
 
On Wed, Sep 18, 2019 at 1:27 AM Debapriya Patra <[hidden email]>
wrote:
 
Lukas Eder <[hidden email]>: Sep 18 09:57AM +0200

I do wonder if this change of introducing the new org.jooq.JSON(B) types
was a bit too "harsh" for existing jOOQ users. What remedies would be
possible? We cannot customise compilation errors here...
 
On Wed, Sep 18, 2019 at 8:07 AM Knut Wannheden <[hidden email]>
wrote:
 
Debapriya Patra <[hidden email]>: Sep 18 07:40AM -0700

Hi,
 
I am little confused here.
 
This is what is my JsonBinder is.
 
package com.chegg.flipper.service;
 
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import org.jooq.*;
import org.jooq.conf.ParamType;
import org.jooq.impl.DSL;
 
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Types;
import java.util.Objects;
 
import static org.jooq.tools.Convert.convert;
 
public class PostgresJSONGsonBinding implements Binding<Object, JsonElement>z {
 
// The converter does all the work
@Override
public Converter<Object, JsonElement> converter() {
return new Converter<Object, JsonElement>() {
@Override
public JsonElement from(Object t) {
return t == null ? JsonNull.INSTANCE : new Gson().fromJson("" + t, JsonElement.class);
}
 
@Override
public Object to(JsonElement u) {
return u == null || u == JsonNull.INSTANCE ? null : new Gson().toJson(u);
}
 
@Override
public Class<Object> fromType() {
return Object.class;
}
 
@Override
public Class<JsonElement> toType() {
return JsonElement.class;
}
};
}
 
// Rending a bind variable for the binding context's value and casting it to the json type
@Override
public void sql(BindingSQLContext<JsonElement> ctx) throws SQLException {
// Depending on how you generate your SQL, you may need to explicitly distinguish
// between jOOQ generating bind variables or inlined literals.
if (ctx.render().paramType() == ParamType.INLINED)
ctx.render().visit(DSL.inline(ctx.convert(converter()).value())).sql("::json");
else
ctx.render().sql("?::json");
}
 
// Registering VARCHAR types for JDBC CallableStatement OUT parameters
@Override
public void register(BindingRegisterContext<JsonElement> ctx) throws SQLException {
ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR);
}
 
// Converting the JsonElement to a String value and setting that on a JDBC PreparedStatement
@Override
public void set(BindingSetStatementContext<JsonElement> ctx) throws SQLException {
ctx.statement().setString(ctx.index(), Objects.toString(ctx.convert(converter()).value(), null));
}
 
// Getting a String value from a JDBC ResultSet and converting that to a JsonElement
@Override
public void get(BindingGetResultSetContext<JsonElement> ctx) throws SQLException {
ctx.convert(converter()).value(ctx.resultSet().getString(ctx.index()));
}
 
// Getting a String value from a JDBC CallableStatement and converting that to a JsonElement
@Override
public void get(BindingGetStatementContext<JsonElement> ctx) throws SQLException {
ctx.convert(converter()).value(ctx.statement().getString(ctx.index()));
}
 
// Setting a value on a JDBC SQLOutput (useful for Oracle OBJECT types)
@Override
public void set(BindingSetSQLOutputContext<JsonElement> ctx) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
 
// Getting a value from a JDBC SQLInput (useful for Oracle OBJECT types)
@Override
public void get(BindingGetSQLInputContext<JsonElement> ctx) throws SQLException {
throw new SQLFeatureNotSupportedException();
}
}
 
 
What changes you are expecting me to do here ?
 
Thanks,
Deba
 
 
On Wednesday, September 18, 2019 at 12:57:34 AM UTC-7, Lukas Eder wrote:
Lukas Eder <[hidden email]>: Sep 18 05:00PM +0200

Mainly, replace java.lang.Object references by org.jooq.JSONB, and fix code
that does not compile by wrapping / unwrapping the JSON string from the
JSONB class.
 
I hope this helps,
Lukas
 
On Wed, Sep 18, 2019 at 4:40 PM Debapriya Patra <[hidden email]>
wrote:
 
Debapriya Patra <[hidden email]>: Sep 18 08:34AM -0700

Thank You Lukas !! It worked for me
 
On Wednesday, September 18, 2019 at 8:01:11 AM UTC-7, Lukas Eder wrote:
"Jens Teglhus Møller" <[hidden email]>: Sep 18 07:03AM -0700

Hi Lukas
 
Thanks for your answer. I managed to get it to build with your suggested
dependency changes.
 
But it did not affect the resulting table names. In the example I would
expect the entity SampleTable to become SAMPLE_TABLE (it does when creating
the database through a spring boot application) but it ends up as
SAMPLETABLE.
 
When running maven build build with -X flag i get the following interesting
output:
 
[DEBUG] Executing query : select
"INFORMATION_SCHEMA"."TABLES"."TABLE_SCHEMA",
"INFORMATION_SCHEMA"."TABLES"."TABLE_NAME",
"INFORMATION_SCHEMA"."TABLES"."REMARKS" from "INFORMATION_SCHEMA"."TABLES"
where "INFORMATION_SCHEMA"."TABLES"."TABLE_SCHEMA" in (cast(? as varchar))
order by "INFORMATION_SCHEMA"."TABLES"."TABLE_SCHEMA",
"INFORMATION_SCHEMA"."TABLES"."TABLE_NAME"
[DEBUG] -> with bind values : select
"INFORMATION_SCHEMA"."TABLES"."TABLE_SCHEMA",
"INFORMATION_SCHEMA"."TABLES"."TABLE_NAME",
"INFORMATION_SCHEMA"."TABLES"."REMARKS" from "INFORMATION_SCHEMA"."TABLES"
where "INFORMATION_SCHEMA"."TABLES"."TABLE_SCHEMA" in ('PUBLIC') order by
"INFORMATION_SCHEMA"."TABLES"."TABLE_SCHEMA",
"INFORMATION_SCHEMA"."TABLES"."TABLE_NAME"
[DEBUG] Fetched result : +------------+------------+-------+
[DEBUG] : |TABLE_SCHEMA|TABLE_NAME |REMARKS|
[DEBUG] : +------------+------------+-------+
[DEBUG] : |PUBLIC |SAMPLETABLE | |
[DEBUG] : |PUBLIC |SAMPLE_TABLE| |
[DEBUG] : +------------+------------+-------+
[DEBUG] Fetched row(s) : 2
[DEBUG] Include : Including PUBLIC.SAMPLETABLE because of
pattern .*
[WARNING] Ambiguous type name : The object SAMPLE_TABLE generates a
type jooqexample.jooqmodel.tables.SampleTable which conflicts with the
existing type jooqexample.jooqmodel.tables.Sampletable on some operating
systems. Use a custom generator strategy to disambiguate the types.
[DEBUG] Exclude : Excluding PUBLIC.SAMPLE_TABLE because of
filter org.jooq.codegen.JavaGenerator$AvoidAmbiguousClassesFilter@48a46b0f
[INFO] Tables fetched : 2 (1 included, 1 excluded)
 
Any clues as to why hibernate creates both SAMPLETABLE & SAMPLE_TABLE?
 
Best regards Jens
 
On Tuesday, September 17, 2019 at 10:57:16 AM UTC+2, Jens Teglhus Møller
wrote:
Lukas Eder <[hidden email]>: Sep 18 05:33PM +0200

Well, one thing that can be said here is that you have two hibernates on
the classpath, which you can see when you run "mvn dependency:tree
-Dverbose"
 
- org.hibernate:hibernate-core:jar:5.3.10.Final
- org.hibernate:hibernate-core:jar:5.4.2.Final
 
Perhaps that helps?
 
On Wed, Sep 18, 2019 at 4:03 PM Jens Teglhus Møller <[hidden email]>
wrote:
 
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to [hidden email].