Hey, 

I am new to JOOQ and I love it so far. I plan to migrate a quarkus 
hibernate application to JOOQ to get more control over the queries executed 
against my postgres database.

I however don't know what happens in the following example with my 
generated ID field. It doesn't get mapped into my POJOS:

This is my user table:
create table if not exists "user"
(
id bigint primary key generated always as identity,
created_at timestamp with time zone default now() not null,
keycloak_id varchar(36) not null unique,
username varchar(255) not null unique
);

And this is my POJO:

data class User(
val id: Long? = null,
var keycloakId: String = "",
var createdAt: OffsetDateTime? = null,
var username: String = "",
)

And I have some logic to get a user by id:
fun loadUserById(id: Long): User {
with(db.dslContext) {
return select()
.from(USER).where(USER.ID.eq(id))
.fetchOne()?.into(User::class.java)
?: throw RuntimeException("User with $id not found")
}
}

This fetches the user and i can see that the id is being set in the record. 
But it doesn't get mapped to my User POJO, all other columns are mapped 
properly:

[image: pojo_mapping.png]

Any ideas what I am doing wrong? 


-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/31df1045-f6e9-49a2-9aa0-63a23b8bd218n%40googlegroups.com.

Reply via email to