Relative Content

Tag Archive for javahibernate

Migrate Custom Function to Hibernate 6

I’m migrating from Hibernate 5 to Hibernate 6 and I have couple problems with Custom Functions.
I have Custom function SINGLE_COLUMN_FROM_JSON_TABLE which is registered in two dialects Oracle and H2.

Hibernate Entity Mapping With Transient

I call a REST API and receive some JSON back (example below). I am using Jackson to convert the JSON to POJOs successfully, but I’m having troubles figuring out how to save ALL of the created entities to the DB using Hibernate. My code is successfully saving announcementData entity to the DB. I’m not sure how to handle announcementExternalIDs as there is nothing to save to the DB, but it contains lists of data that does need saved (announcementCustomerIDs, announcementOfficeIDs, and announcementPositionIDs).

Load sub-entity depending on field with Hibernate

I’ve got an entity that is identified by an uniqueIdentifier and version, using both in an @Embeddable primary key. To identify which version is currently “active”, there is also a boolean flag with that name (the rule is that only one row with a given uniqueIdentifier may have the active flag set).

Hibernate Parent Child Issue

I am trying to figure out how to save all my entities by saving just the parent entity. I know how to save the parent only, but need to also persist the children. My odd issue is I have a custom class (AnnouncementExternalIds) that does not have a DB table.