Dear nhibs,
I am getting this exception:
Object with id: 253651 was not of the specified subclass:
Businesslayer.AdministratorMessage (loading object was of wrong class
[Businesslayer.CustomerMessage])
Conversation has two lists of Messages: AdministratorMessages and
CustomerMessages
<class name="Conversation>
<set name="CustomerMessages" cascade="all-delete-orphan"
access="field.camelcase" fetch="join" inverse="true">
<key foreign-key="FK_Conversation_CustomerMessages"
column="ConversationID" />
<one-to-many class="CustomerMessage" />
</set>
<set name="AdministratorMessages" cascade="all-delete-orphan"
access="field.camelcase" fetch="join" inverse="true">
<key foreign-key="FK_Conversation_AdministratorMessages"
column="ConversationID" />
<one-to-many class="AdministratorMessage" />
</set>
</class>
Messages are +- mapped like this:
<class name="Message" table="`Message`" lazy="true">
<discriminator column="MessageType" type="String" />
<property name="Content" type="String" access="field.camelcase">
<column name="MessageContent" length="1048576" />
</property>
<many-to-one not-null="true" name="Conversation" column="ConversationID"
/>
<subclass name="AdministratorMessage"
discriminator-value="AdministratorMessage">
<many-to-one name="Creator" column="AdministratorCreatorID" />
</subclass>
<subclass name="CustomerMessage," discriminator-value="CustomerMessage">
<many-to-one name="Creator" column="CustomerCreatorID" />
</subclass>
</class>
I can persist these messages just fine, but cannot retrieve them (above
error message). What is wrong?
Thanks!
--
Jan
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---