The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [jooq]

jOOQ stands for Java Object Oriented Querying. jOOQ effectively combines complex SQL, typesafety, source code generation, active records, stored procedures, advanced data types, and Java in a fluent, intuitive DSL.

-1
votes
0answers
7 views

Converting Array data type element to String using DSL jooq

I have an table which has a ARRAY type data column (Athena Db) and I need to convert it into string in the JOOQ query . Could anyone please recommend if there is a delivered way to do this . Like ...
1
vote
1answer
17 views

Get aggregate sum of difference of two dates in JOOQ

I am using JOOQ for writing SQL in my java code.I have following query written into the PostgreSQL database:' Query: Fetches the total number of checked task and the total time taken to complete the ...
0
votes
1answer
36 views

JOOQ sbt 0.3.16 to 1.2.8 migration

How migrate JOOQ building and configuration from sbt 0.3.16 to sbt 1.2.8 The JOOQ build definition in 0.3.16 as below. val generateJOOQ = taskKey[Seq[File]]("Generate JooQ classes") val ...
1
vote
1answer
136 views

jOOQ generates a static method to call a function but no method to get it as field

I want to turn this SQL statement into a jOOQ select: select art_id, artnr, pa_bez.arttext(art_id, null, pa_param.text(10, 1)) text, from artikel; But I cannot use pa_bez.arttext ...
2
votes
1answer
27 views

Getting list of tables with jOOQ

I have been using the Schema.getTables() method in jOOQ to get the list of tables in my schema, but today I found out that method is returning the list of tables that existed when we executed jOOQ's ...
1
vote
1answer
124 views

Build up dynamic table joins in JOOQ

I am using JOOQ as a SQL builder tool to then execute in a jdbcTemplate. I need to dynamically add table joins to the from clause. At the moment I am doing it like this.. SelectJoinStep<?> ...
2
votes
1answer
26 views

Why aren't these database modifications rolled back despite the presence of an `@Transactional`?

Written a short convenicence extension for Testcontainers: fun JdbcDatabaseContainer<*>.execute(query:DSLContext.()-> Query){ val connection = DriverManager.getConnection(this.getJdbcUrl(...
2
votes
1answer
27 views

org.jooq.exception.SQLDialectNotSupportedException: Type class java.net.Inet6Address is not supported in dialect DEFAULT

The static DSL function(s) for row() seem not to use the dialect used in the DSLContext. I'm using postgres with jooq to query my database. I have a Binder for use with java objects of type ...
1
vote
0answers
33 views

Issue with JOOQ json binding

I have an issue with converting postgresql jsonb I created Binding as was explained in tutorial : jooq tutorial Also please note I am not using codegen In my repo I have the following code Binding ...
1
vote
1answer
28 views

jooq use oracle text contains query

I am building a query using jooq and need to add a condition to where clause using oracle text.. So far I have a collection of conditions that I build up and use to build the query at the end... List&...
1
vote
1answer
30 views

Why do I get dates back one off when using JOOQ?

We are using jOOQ to talk to a MySQL database containing this table: CREATE TABLE daily_sessions ( session_id INT AUTO_INCREMENT NOT NULL, user_id VARCHAR(45) NULL, day date ...
1
vote
1answer
27 views

Jooq (java) - Type class org.jooq.impl.UnqualifiedName is not supported in dialect DEFAULT

Hello I am doing this in method public void update(Table table, String tableName){ ArrayList<Name> firstRowInDslFormat = new ArrayList<>(); for (Object value : table....
1
vote
1answer
225 views

ORM Who can generate script dynamically

So basically I was checking working of hibernate, as well evaluated ORMs JOOQ. JPA is main de-facto standard for all java based ORM implementations more or less. I am not saying they are not perfect ...
1
vote
1answer
22 views

How to Force all DATE columns to LocalDateTime in jOOQ generator?

I want to force all Oracle DATE columns to LocalDateTime. What I tried: <forcedType> <name>LOCALDATETIME</name> <userType>java.time.LocalDateTime</userType> ...
1
vote
2answers
44 views

What is the equivalent of hibernate's saveOrUpdate method in jooq?

I want to update row if it exists otherwise insert it. Is there any convenience method like hibernate's saveOrUpdate in jooq? Currently i am checking in database if it exists then run update query ...
2
votes
1answer
105 views

Generate DDL using jooq by using schema and table name

i want to generate DDL using schema and table name for any database.. Below is the code which I'm trying: DSLContext dSLContext = DSL.using(getPostgresqlDataSource().getConnection()); Queries ddl = ...
0
votes
1answer
30 views

Generating of query in wrong format

I have a problem with piece of code, which is generated (output) in wrong format and not requested form: I wanted generate query/sql with foreign key without "ALTER TABLE NameOfTab ADD" so I used ...
0
votes
2answers
24 views

How to write join fetch query with jooq?

Anyone knows how to write join fetch query with jooq ? my code : int oid=5; Select<?> selectQuery = DSL_CONTEXT.select().from(TABLE_A) .join(TABLE_B).on(TABLE_A.PID.eq(TABLE_B.ID)) ...
2
votes
2answers
20 views

How can I map a Result object of 2 records (many to one) into their respective record objects in jOOQ?

I have a table X and another one Y. I want to load a record from X which has a foreign key to Y so I perform a left join: X x = dslContext.select() .from(Tables.X) ....
1
vote
1answer
589 views

How to find status of records loaded when we forcefully intercepting batch execution by stopping mssql database

We are implementing connection or flush retry logic for database. Auto-commit=true; RetryPolicy retryPolicy = new RetryPolicy() .retryOn(DataAccessException.class) ....
0
votes
2answers
28 views

Jooq replace function

I see a strange behavior when i use JOOQ to generate my original SQL. CAST(addi.addke AS VARCHAR(10))||CAST(tlcst.tdsk AS VARCHAR(10))||date_format(DATE (rol.ntbd), '%Y%m%d')||replace(...
7
votes
2answers
61 views

Can I use JOOQ as an SQL parser?

Trying to parse a SELECT statement in Java. Was looking at several parsers and ran into JOOQ, which I know isn't an SQL parser (but a lot more than that), but was wondering if there is a way to use ...
2
votes
1answer
34 views

ForceType on check constraint or default value

I have columns in the database that look like: AKTIV VARCHAR2(1 char) default 'J' not null constraint AVCON_428946_AKTIV_000 check (AKTIV IN ('J', 'N')), How do I have to write the forcedType to ...
0
votes
1answer
29 views

jOOQ fetchResultSet not closing connection with Kotlin

I'm using Kotlin with HikariCP and jOOQ to query my database. I've come to realize that this code works as expected, fetching the rows and closing the connection afterwards: class CountriesService(...
1
vote
1answer
31 views

jOOQ fetch vs fetchResultSet and close connection in Kotlin

I'm using Kotlin with HikariCP and jOOQ to query my database. I've come to realize that this code works as expected, fetching the rows and closing the connection afterwards: class CountriesService(...
0
votes
0answers
29 views

Generated sources by JOOQ are not being compiled when skipping JOOQ

We use spring boot and Jooq together in our project, and we are setting a Gitlab CI/CD process with build, test, deploy phases. We found that Jooq can be a bit challenging when setting up the CI/CD ...
1
vote
0answers
27 views

Modify constraint name in ddl statement from jOOQ (3.11.7)

In MariaDB I have a table that looks as follows: CREATE TABLE `REFERENCE_MANAGEMENT_REQUESTS` ( .. stuff .. UNIQUE KEY `REFERENCE_MANAGEMENT_REQUESTS_key_UN` (`rmr_key`), .. more stuff .. ) ...
0
votes
1answer
29 views

jOOQ - join with nested subquery

Let's say I want to find out who wrote CLRS in a book db (tables BOOK, AUTHOR with a junction table BOOK_AUTHOR). SelectConditionStep<Record1<String>> query = create .select(...
2
votes
2answers
28 views

What happened to polymorphism for jOOQ-generated classes?

Let's take the query from my other question: SelectConditionStep<Record1<String>> query = create .select(AUTHOR.LASTNAME.as("AuthorName")) .from( ( ...
0
votes
1answer
25 views

Avoiding casts when narrowing jooq selects

Let's say I have a book database and I want to check whether the CLRS book has the correct authors. Assuming private static final String CLRS_title = "Introduction to Algorithms"; @Test ...
0
votes
0answers
38 views

How to pull correct JOOQ version with Spring Boot and Gradle?

So according to the gradle jooq plugin readme: Defining the jOOQ version when the Spring boot plugin is applied When applying the spring-boot-gradle-plugin, it is not sufficient to declared the ...
0
votes
1answer
16 views

Is there a jooq dialect for VoltDB

Is there a dialect for voltdb? This will definitely help in producing dynamic sql for testing perposes.
1
vote
1answer
36 views

How to fix jOOQ code generation tool error?

I'm using Spring Boot 2.1.1 with jOOQ codegen tool 3.11.7. I have a Java class configured to slightly modify class names derived from MySQL table names in pom.xml: <generator> <target> ...
1
vote
1answer
24 views

jOOQ: reusing / copying queries

In order to avoid re-creating the same part of a dynamic query over and over again, I was going to build the main part once and then reuse this part in different parts of the application. Since ...
0
votes
1answer
19 views

Creating a cross target date series with JOOQ

I am attempting to create a method that will return a date series of an arbitrary length that can then be used to generate a usage report grouped by hour/day/month. It is very important that this can ...
1
vote
1answer
24 views

jOOq :Using Spring and jOOq is there a way to hide sql statements in the stack traces

I'm using jOOq with spring on a project. What I'm seeing is that SQL statements are showing up in my stack traces and ultimately my logs. I've also seen this packaged in a rest response as well. I ...
1
vote
1answer
20 views

jOOQ: best way to get aliased fields (from #as(alias, aliasFunction))

I have to access the same table for multiple references from a "root" table. In order to do so, I'm creating aliases for these tables: protected final Table<XyzRecord> foo = Tables.XYZ.as("foo",...
0
votes
1answer
19 views

Accessing Postgres named CHECK CONSTRAINTS from jOOQ

I have defined a named check constraint in Postgres 10: constraint date_start_smaller_than_date_end check (date_start < date_end) I'm running the jOOQ 3.11.4 generator, but I cannot find any ...
0
votes
1answer
16 views

Need to have type-safety for more than 22 fields. Any workarounds?

Have 23 fields in a table.(Cannot avoid, don't want to normalize it more for performance reasons) Any workarounds to achieve type-safety for more than 22 fields using JOOQ?
0
votes
2answers
101 views

Jooq/SQL find average value for unique values in another column

I have a query to return various figures from a combination of tables. I am using jooq to run this query. final SiteSalesFigures siteSalesFigures = dsl.select( countDistinct(LINE.TRANSACTION_ID)...
0
votes
1answer
18 views

JOOQ for multiple profile

Recently I have started using jooq as db layer for my java projects. Here is my organization, we have different DB name for our application database (That's DevOps pipeline). Please consider the ...
1
vote
1answer
22 views

How to write proper boolean comparison for PostgreSQL in JOOQ

I have a table t with boolean column b. db.select(T.B).from(T).where(T.B.isTrue()).fetch(); db.select(T.B).from(T).where(T.B.eq(Boolean.TRUE)).fetch(); both these statements are translated to same ...
3
votes
1answer
42 views

Add mysql specific ROW_FORMAT=DYNAMIC to create table statement generated by jooq

I have an application which I need to backport to mysql 5.6. This application uses rather large composite keys which works fine on mysql 5.7 because innodb-large-prefix is enabled by default. I ...
1
vote
0answers
32 views

Lambda jooq wrong date from mysql

In AWS Lambda I am using jOOQ to read data from a MySql database. In a simple select query as follow I am reading a column whose type is 'date'. I tried searching for the solution, but no luck. ...
1
vote
0answers
38 views

Bulk/Batch update using PostgreSQL java

I am doing insertion/Updation into table using below command . insertResult = ((InsertReturningStep) ctx.insertInto(jOOQEntity, insertFields) .values(insertValue)....
2
votes
0answers
32 views

Jooq Loggerlistener query executed time inconsistency

I am using JOOQ with Postgres dialect to fire query from my spring boot app and the RDS is postgres. The query being fired is - select contents::jsonb #> '{columns,0}' from nebula.test where (id=...
2
votes
1answer
24 views

Filter a JOOQ generated table with a condition while maintaining type

I have generated a number of JOOQ classes from my database. I want to easily filter my tables by customer while maintaining the strong type of my tables. This is what I want to be able to do: // ...
0
votes
0answers
32 views

How represent Postgres TIMESTAMP WITHOUT ZONE in Jooq

I have a Scala application using Joda time lib which is connected to Postgres db and I want to use Jooq lib. I want to store my data with timestamp in UTC, but I do not know how to convert it in Jooq. ...
0
votes
1answer
31 views

Insert from several temporary tables

I want to rewrite the following query using jooq: with first_temp as ( select a.id as lie_id from first_table a where a.some_Field = 100160 ), second_temp as ( select b.id as ben_id from ...
2
votes
1answer
45 views

JOOQ MySQL TEXT DataType

I'm trying to generate this simple SQL with JOOQ and for some reason I can't get it done. CREATE TABLE T ( F TEXT ); I expected it to be something like dsl.createTable(name("T")) .column("F",...