Consider the following Java hierarchy: I want the whole hierarchy to be stored in a single table named file, except for SpecialOutFile which should ...
Consider the following Java hierarchy: I want the whole hierarchy to be stored in a single table named file, except for SpecialOutFile which should ...
Here is the main table: And the table which is ElementCollection in my case: When I do a query with a join fetch, I get Group with all its Membe ...
This example is modified and simplified, but resembles a real problem I have with legacy code that I am trying to fix. I have a MSSQL CAR table (wher ...
I have the followings at Java level: And the following tables in the DB: When I try to save a WordDoc, the Hibernate fails with the following er ...
enter image description here this img is user table and example tuple here, I want to use sql query "SELECT MAX(KEY_NAME) FROM USER;" and right here ...
I am using MSSQL server as DB and the method in the repository layer of my spring boot project: here cNoList may contain only 0 or some values. i w ...
In my spring boot project I have a Document class that has a bi-directional OneToOne relationship to an Invoice class, which share the same ID. Docum ...
I have a entity user with self dependency. When i Map this entity to DTO I have the problem of circular dependency. . User.class: UserMapper method ...
I am trying to learn JPA and Hibernate. When trying to use the mappedBy annotation to map a access card to an owner of it, the column wont create. I a ...
Lets say I have an entity like this, I want clone this entity, modified a few fields and then persist the new cloned entity in the database. What's ...
I am learning spring-boot and I have a connection to a database, I am trying to perform the following query. But it generates the following error a ...
I a trying to write below query in querydsl How can I join on array if ids I tried registering unnest function too But this is also not working ...
I have the following entity: And I'm trying to empty its database table, and insert new rows: ProductRepository is: And BatchRepository: T ...
I am using Spring Data JPA to get data from a MySQL database. I have this function adnotated with @Query in a repository Spring generates the SQL a ...
How to properly delete a record from a database in one query. For example, when an entity uses the primary key of the parent entity using the @MapsId ...
I have the following PostgreSQL function: I would like to call the function, and automatically map the result set into a List of TimeSlots: So I ...
I have a query like below that doesn't work. It throws IndexOutOfBoundsException: Index: 0, Size: 0 (sorry I can't post the whole stacktrace as it i ...
In Blaze Persistence with querydsl integration, it supports subquery in join statement. So I wonder how to combine projects with CTE entity in a join- ...
We are working on a spring boot library to generate and validate OTP. It uses database to store the OTP. We are using Spring Data JPA for Database op ...
So I have a SQL query like this, SELECT * FROM USERS.NAMES UN JOIN USERS.ADDRESS UA ON ADDRESS_TYPE IN ('{user_supplied_value_1}', '{user_sup ...