Skip to content

Tag: jpa

Convert to DTO from join selection

I have these two tables And I am using this query to get the results So far this is the only way I could retrieve the results and actually use them later. To use them I am using this code currently But using it that way seems odd to me. Is there a better way to directly map the result

Querying using class in Spring

i’m trying to do this query List<Product> findProductByCategory_CategoryNameAndPriceBetween(String category, double min, double max); but the return of the query is an empty list. What am I doing wrong? I also tried without the underscore between Category and Category Name. This are the class cate…

JPA Converter with contains query

I’m having some trouble with a particular query in my Spring Boot application. I’m using Spring’s built-in text encryption in order to encrypt text in my database I have an entity called BookRecord And a title encryption converter which looks like this I’m trying to search the database…

JPA Hibernate Annotation Issue

I have three Entities i’m modeling and am having issues with the associated annotations. I basically have a class that I intend on returning to the caller, a nested listed of Project’s and the Project can contain a nested list of Endpoint’s. It’s a top-level has-a one-to-many, then the…

Create and use database function with JPA

I want to create and immediatly use a database function in a single sql call. As an example, the following works fine in PostgreSQL SQL Editor : But when i try to use it with JPA : I get the following error : How could i make this work ? Answer You’re trying to execute two queries at once. You