Forums Register Login

Hibernate criteria in many-to-one mapping.

+Pie Number of slices to send: Send
I am using criteria to select some records from DB with restrictions on it. I have one table say A & its pojo A.java, its field mapped with other table B. (many-to-one).
When i use criteria with restriction, the id (which is the primary key of ) of other class is mapped in the property field. But when i give some other variable from B.java, it gives "could not resolve property" excepion.
Why this happens?

here is the code:



+Pie Number of slices to send: Send
the properties "updatedUserId.officerName" & "logSheet.status" are not being resolved!
+Pie Number of slices to send: Send
hi harshad ,

try using this :

+Pie Number of slices to send: Send
Hi harshad ,

try using alias.

here's an example
+Pie Number of slices to send: Send
here's another way

Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6184 times.
Similar Threads
Hibernate Search using Criteria with OR condition.
Invalid field value for field- Date
getting focused jtextfield in exteds jPanel
isNotNull & isNotEmpty Hibernate
How to get the all results using HQL
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:17:21.