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.  [ 3 posts ] 
Author Message
 Post subject: Problem with "is null" operator and "one-to-o
PostPosted: Fri Oct 01, 2004 4:26 pm 
Beginner
Beginner

Joined: Fri Nov 28, 2003 11:21 am
Posts: 49
Location: Buenos Aires, Argentina
Hi! I have 2 classes A, B with a one-to-one mapping. In the xml of class A, I put:
....
<one-to-one name="b" class="B"/>
....

then, in the xml of B, I put:
...
<one-to-one name="a" class="A" constrained="true"/>
...

when I excute this query:
...
List list = session.createQuery("from A a where a.b is null").list();
...

it returns all Objects 'a' where a.b isn't null and a.b is null when I just expected all Objects 'a' where a.b isn't null.
Any help?

[b]Hibernate version:[/b]
2.1.6
[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]
MS SQL Server 2000
[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 02, 2004 1:47 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Did you properly set up your id generator? If not read all of the reference manual, section 5.1.11 to learn how to do this.

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 03, 2004 12:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Read the FAQ please.


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

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.