-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate select NULL values query
PostPosted: Thu Oct 21, 2004 9:03 pm 
Beginner
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.