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: Bug in NHibernate.Mapping.Column's TypeIndex prop?
PostPosted: Fri Nov 02, 2007 9:32 am 
Beginner
Beginner

Joined: Tue Mar 27, 2007 4:54 am
Posts: 47
Hibernate version:
1.2

Hi there

I need to grab some info out of my hbm files, eg maximum allowed chars in data source's string columns (I'm regenerate the db scheme using my mapping files). I'm using the configuration object to loop through the properties and its column(s) at start up. Works like a charm.... when nested components are not used. The problem is that NHibernate.Mapping.Column's typeindex always is unique within a property, even though multiple columns points to the same nested component.

Eg
<class...>

<component name="Nested1">
<property name="Length100"
length="100"
not-null="true" />
<property name="nuffra"
column ="nuffraColumn"
type="int"/>
<component name="nested2">
<component name="nested3">
<property name="nuffra"
type="int"/>
<property name="Length300"
length="100"
not-null="true" />
</component>
</component>
</component >

</class>

[ObjNested1].Subtypes
...contains 3 types - the two properties and the nested component. Fine! As expected.

But! The the TypeIndex property of the column object above has the following values...
Length100: 0 - OK!
nuffraColumn: 1 - OK!
nuffra: 2 - OK! (or even better 0)
Length300: 3 - WRONG! Should be 2 (or even better 1)

This leads to misfunctionality of a Component Subtypes array. The index mismatch of the index of this array.

I'm not sure whether the nested properties should have an index seen from the root (2 and 2) or inside their own component (0 and 1). However - how it works now simply don't make sence.

I've solved this with an ugly work around right now, but as far as I see it - this is a bug.

I can send more info if needed.

Or I am simple missing something (probably :))?

Regards
Roger


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.