Skip to content
Advertisement

Tag: jpa

How to copy object that has a list with BeanUtils?

I’m working on a multi maven modules and I want to copy from entity to model with BeanUtils, here what I tried: This is my entity (with getters/setter/noargs/allargs): and this is my model (DTO Model): This is the output I’m getting: The problem is that the fields get copied but the list does not it shows me an empty List.

JPA repository Boolean Query – return null pointer exception

I have Java springBoot project With repository that included boolean custom query. but the system run to null pointer exception apart from return “false”. this is the query: I called the method: and this is the error: Answer Your query is designed to return whatever entity (called CustomersVsCoupons from now on) is mapped to the table customer_vs_coupons, not a Boolean.

Java ORM vs multiple entities

I have a class Health Check – as part of the class I record how many parasites are seen (enum NONE, SOME, MANY) and also the location of the parasites (enum HEAD, FEET, BODY). Two ways this could be done: METHOD 1 Health Check Parasite Or I could have: METHOD 2 Would method 1 require @Entity on parasite class and

Caused by: java.lang.IllegalStateException: Query argument creationDateTime not found in the list of parameters provided during query execution

I am trying to cover the case where the :creationDateTime is Null to get the same result as the following query “SELECT o FROM ExtraNetOrder o”. I searched it on the internet and found the solution by adding IS NULL, but it does not work in my case. Currently I am getting the following error: Caused by: java.lang.IllegalStateException: Query argument

Combine JPA Query annotation with Oracle sample method

i am trying to pass a parameter into a JPA query Example code But i get an error because of the sample(:percentile). If i just hardcode a number in there it works but not with a param. Is there a way to escape the brackets or something similar? Thx Answer The error is on the following part Unfortunately it does

My Spring JPA queries do not work with H2

This query below does not work and it generates me an exception When I used the MySQL database, the query worked fine. But now that I am using the H2 database, it suddenly does not work. Why? How do I fix this? Answer It would be better to use JPA. If you still wanna use nativeQuery, use like this:

Advertisement