Hi,

I use a table per subclass startegy for mapping the following
inheritance structure;

AbstractPropertyDefinition - ListPropertyDefinition
                                       - RangePropertyDefinition

I noticed when issue the following statement:
session.CreateCriteria<AbstractPropertyDefinition>
().List<AbstractPropertyDefinition>();

nHibernate issues an update before actually selecting. I wonder why he
is updating the joined-subclass properties before fetching them?

Regards
Yoeri


        <class name="AbstractPropertyDefinition" abstract="true"
table="propertydefinitions" lazy="false">
                <id name="ID" column="PropertyDefinition_ID" type="int">
                        <generator class="native"></generator>
                </id>
                <many-to-one name="Label" class="Translation"
column="LabelTranslation_ID" cascade="all" />
                <property name="Target" column="Target" type="int"></property>
                <joined-subclass table="listpropertydefinitions"
name="ListPropertyDefinition" lazy="false">
                        <key column="PropertyDefinition_ID"/>
                        <property name="Type" column="Type" 
type="int"></property>
                        <bag name="Items" inverse="true" lazy="true" 
cascade="save-update">
                                <key column="ListPropertyDefinition_ID"/>
                                <one-to-many 
class="ListPropertyItemDefinition"/>
                        </bag>
                </joined-subclass>
                <joined-subclass table="rangepropertydefinitions"
name="RangePropertyDefinition" lazy="false">
                        <key column="PropertyDefinition_ID"/>
                        <property name="Type" column="Type" 
type="int"></property>
                </joined-subclass>
        </class>
-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.


Reply via email to