Beginner |
|
Joined: Thu Sep 23, 2004 6:03 am Posts: 27
|
Hibernate version:1.2
Name and version of the database you are using: MySQL
Simple question: I have a table with where a certain attribute can be set to null. I want to write a hibernate query to return all the null listed items in the table. The MySQL code is
SELECT *
FROM `rights_type`
WHERE parent_rights_type_id
IS NULL
The HQL I'm trying to write is like this
List rightsTypes = getHibernateTemplate().find("from RightsType rt where rt.childOf is null");
I get Lazy Initialisation errors from JUNIT when I try to run this, is the code I written correct? I have tried implementing this with lazy set to both true and false with the same result
Thanks
|
|