Skip to content
Advertisement

Tag: spring-data-jpa

Nested entities contains null after save

I have an entity with some nested entities like this with entity2 and entity3 like this: Both Entity2 and Entity3 have values stored in the database so when I’m doing an insert on MyEntity, I’m doing this: it works fine, the data are stored correctly in the DB with the correct foreign keys BUT… After insert I want to build

Kotlin CLOB to String

I have a function in Oracle that returns a CLOB. In Java I can use the following code to execute this function and fetch the result: Oracle function definition in my Repository class: Conversion to String: What’s the equivalent code in Kotlin or any other way to convert the Clob to String? Answer It’s absolutely legal use @Query annotation in

NamedQuery returning entities with null fields

defined entity with namedquery as SELECT mdl FROM tbl_slots mdl where mdl.test_date between :dt and :dt order by mdl.test_time asc if used * instead of mdl in query, JPA gives error unexpected token: * if mentioned the column names in select statement it returns entities with respective fields populated with expected values [{ “srNo”: 1, “testDate”: “2021-Dec-30”, “testTime”: “09:00-10:00”, },{

Make a POST with JPA with existing data

I have the following problem, the thing is that I have an entity: The thing is that this back is connected to an Oracle DB, in which I already have a few registered users, but these are entered through a Mockaroo script, and when I try to save a new user through a service Rest throws me this error: Of

Advertisement