.
If I use the field in the attribute 'name' of the 'parent' elemente of de 'composite-element' into the 'bag' many-to-may if throws an exception saying that the property wasn't found.
NHibernate.PropertyNotFoundException:
{"Could not find a setter for property 'objClass1' in class 'Class1'"}
{"Could not find a setter for property 'objClass2' in class 'Class2'"}
It should try to set the field and is trying to set the property!!!
Hibernate version: 1.2RC1
Mapping documents:
Class1 mapping:
Code:
<?xml version='1.0' encoding='utf-8' ?>
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.2' default-access='field' >
<class name='Class1' table='class1' lazy='false'>
<id name='pkClass1' column='pkClass1' type='String' length='15' >
<generator class='assigned'/>
</id>
<property name='name1' column='name1' type='String' />
<bag name='relation' cascade='all' lazy='true' inverse='true' table='tbl_relation' >
<key column='pkClass1' />
<composite-element class='ClassRelation' >
<parent name='objClass1' />
<many-to-one name='objClass2' column='pkClass2' class='Class2' not-null='true' />
<property name='date' column='date' type='DateTime' not-null='true' />
</composite-element>
</bag>
</class>
</hibernate-mapping>
Class2 mapping:
Code:
<?xml version='1.0' encoding='utf-8'?>
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.2' default-access='field' >
<class name='Class2' table='class2' lazy='false'>
<id name='pkClass2' column='pkClass2' type='Int32' unsaved-value='0' >
<generator class='native' >
<param name='sequence'>seq_class2_pk</param>
</generator>
</id>
<property name='name2' column='name2' type='String' />
<bag name='relation' cascade='all' lazy='true' table='tbl_relation' >
<key column='pkClass2' />
<composite-element class='ClassRelation' >
<parent name='objClass2' />
<many-to-one name='objClass1' column='pkClass1' class='Class1' not-null='true' />
<property name='date' column='date' type='DateTime' not-null='true' />
</composite-element>
</bag>
</class>
</hibernate-mapping>
Relation class 'ClassRelation' mapping:
Code:
<?xml version='1.0' encoding='utf-8' ?>
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.2' default-access='field' >
<class name='ClassRelation' table='tbl_relation' lazy='false'>
<composite-id>
<key-many-to-one name='objClass1' column='pkClass1' class='Class1' />
<key-many-to-one name='objClass2' column='pkClass2' class='Class2' />
</composite-id>
<property name='date' column='date' type='DateTime' not-null='true' />
</class>
</hibernate-mapping>
Name and version of the database you are using: Firebird 1.5