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
|