-->
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.  [ 2 posts ] 
Author Message
 Post subject: mapping relation with a <null> (dbnull) value
PostPosted: Fri Nov 11, 2005 11:18 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
I have a legacy table in which 3 columns are defined. (column names changed for ease).

MANAGER : not-nullable int
TEAMMANAGER : nullable int
TEAMMEMBER: string

If i'm a teammember, all 3 columns are filled. However, my teammanager does not have it's teammember column filled. And his manager has an empty teammanager column as well as an empty teammember column..

I'm trying to map these persons using <sub-classes>
I have defined a composite-ID with a nullableInt32

This actually works. I have a discriminator column and I can select these entities without problems.

However, I have <bag> relations with these types. They are mapped with 3 <column>s but nHibernate does not understand that it should do a nullability compare in the generated SQL.

Generated SQL maps the columns as follows:
[3160] - binding '1' to parameter: 0
[3160] - binding '' to parameter: 1
[3160] - binding null to parameter: 2
.... WHERE Manager=:p0 and TeamManager=:p1 and Teammember=:p2

the first parameter is fine, The second and third I do not get.
Possibly the third will work, I do not know. I can't see the exact SQL as it's sent (??)
But the second will not work for sure..

Is there some way to achieve what I want, or should I really create three seperate entities, with different composite-ID's ?? :x

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 22, 2005 6:22 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
-bump-

Could somebody give me some direction on this problem? :?:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.