Hi,
I have an object which has an ISet defined for it, I believe I have all the mapping correct but when I create a new instance of the object the ISet is null, meaning I cannot populate it. This is strange as other object which have sets initialise an empty ISet on creation.
If I load the collection from the database it loads the ISet fine, which again is strange.
Does anyone have any ideas, why this could be happening?
Thanks for any help,
Kev
My set is declared in the object as follows:
<set name="WinnerAmounts" table="QuizWinnerAmount" generic="true" cascade="all-delete-orphan" inverse="true" lazy="true"> <key column="QuizID"/> <one-to-many class="Models.QuizWinnerAmount, Models"/> </set>
The corresponding object, which belongs to the set is defined as follows, this has a composite key:
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="Models.QuizWinnerAmount, Models" table="QuizWinnerAmount"> <composite-id unsaved-value="any"> <key-many-to-one name="Quiz" column="QuizID" class="Models.Quiz, Models" lazy="proxy"></key-many-to-one> <key-property name="WinnerPlace" type="Byte"></key-property> </composite-id> <property name="Percentage" type="Decimal" not-null="true"></property> <property name="MaximumAmount" type="Decimal" not-null="true"></property> </class> </hibernate-mapping>
Thanks for any help again.
Kev
|