Skip to content
Advertisement

Tag: jooq

JOOQ MySQL DATETIME Type

I’m trying to generate this simple SQL with JOOQ and for some reason I can’t get it done. I want the following code to be generated for MySQL databases. I expected it to be something like Unfortunately, MySQLDataType is deprecated. JOOQ explicitly says to only use types declared in SQLDataType, but for some reason I can’t find any. I’ve already

One-to-many select in Jooq

I am trying out JOOQ and trying to select from 3 tables (Author, Books and Articles) using a join statement. The ERD is as follows: The query I have is the following: I also have a protobuf object as follows: (or any other pojo for that matter) which will hold all the entities (author details + list of books +

jOOQ can I fetch a join of two tables into the respective POJOs

In jOOQ if I want to fetch a row of a table into a jOOQ autogenerated POJOs I do, for instance: Now, suppose that I want to do a join between two tables, e.g. USER and ROLE, how can I fetch the result into the POJOs for these two tables? Answer Using nested collections With more recent versions of jOOQ,

jooq single query with one to many relationship

I have a table experiment and a table tags. There may be many tags for one experiment. schema: Is it possible to create a query with jooq which returns the experiments and the corresponding List of tags? something like Result<Record> where Record is a experimentRecord and a list of Tags, or a map<experimentRecord, List<TagRecord>. I also have a query which

jOOQ: Mocking DAO objects

jOOQ 3.5.0 I’m currently trying to write unit tests for a resource that is using jOOQs generated DAO objects. I’ve noticed one of the base classes (DAOImpl) in the DAO hierarchy has many final methods which makes it unfriendly to mock (I’m excluding byte code manipulators like Powermock as a solution). I’m currently using the MockConnection and MockDataProvider pattern to

SQLite 64bit integers recognized as ints in jooq

I have an SQLite database that I am using with jOOQ. When I use jOOQ’s code generation tool, it builds all of the table and record classes as expected. However, all of the SQLite INTEGER columns turn into java.lang.Integer fields in the generated code. The problem is that SQLite INTEGER’s can store up to a 64 bit signed integer, where

JOOQ pojos with one-to-many and many-to-many relations

I am struggling to understand how to handle pojos with one-to-many and many-to-many relationships with JOOQ. I store locations that are created by players (one-to-many relation). A location can hold multiple additional players who may visit it (many-to-many). The database layout comes down to the following: Within my java application, all these informations are stored within one pojo. Note that

How to use named parameter in plain sql with jooq

I’m using JOOQ with plain/raw SQL, so that means i’m not using any code generation or the fluid DSL thingy. The following code works: Now let’s say i have a query with multiple parameters like this: How do i use a named parameter with these types of queries? I’m thinking something like : But the above code doesn’t work (for

Advertisement