[reactive/hibernate/panache/kotlin/postgres] While persisting data into SQL, all fields become null #34730
polymorph233
started this conversation in
Community
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
By coincidence, during hot reload it was possible to persist data within the SQL even if nullish fields violate the non-null contract in database side.
In the point of view of database, I got something similar to:
Here id are referenced to entries in other tables and it seems work perfectly.
But all fields belonging to the entity are null.
Another symptom is that, I have coded the logic to first check if an object with the same name is already in the database before inserting it. Since at each query a new object is created, with the same name, this shows in evidence that the fields are lost during persistence.
After a stopping and restart of quarkusdev, now the database just refuse to persist these entities full of nulls, which is quite expected by me. But I would like to know why these data got lost during persistence.
I am using reactive components of Quarkus, but this should not be relevant.
I am wondering if this could be happening because of the inheritance classes used for entity design as I used two abstract classes for the base of several specialized classes. Another guess is that this may come with how properties and fields are mapped from Kotlin to Java side.
Here is my query level code:
The abstract classes are like this:
And the concrete class like:
Beta Was this translation helpful? Give feedback.
All reactions