Hi guys,
I've got a "weird" scenario in an app I'm writting, and trying to get to grips on ow I can implement using nHibernate.
The scenario goes like this ... there is a Test. A Test is made up of a series of Testlets ( a Testlet is a set of pre-defined questions, with metadata ... ).
The thing ... while I'm running the test, the testlets that make it up are randomly selected from the database, according to the characteristics of the Test ( it's Level and type that is ... ).
What all this implies is that in the Testlet table in my DB, there shouldn't be a FK to the Test table. I was thinking that a custom in my pointing to a stored proc would do the job - however, when I export my mapping hbms schema to an empty DB, it still creates foreign keys in my Testlet table.
Here's my mapping for Test:
<class name="Test">
<id name="UID">
<generator class="guid" />
</id>
<property name="Type" />
<property name="Description" />
<bag name="Items" generic="true" inverse="false">
<key column="UID"/>
<one-to-many class="Testlet"/>
<loader query-ref="loadTestletByTestID"/>
</bag>
</class>
<sql-query name="loadTestletByTestID">
<load-collection alias="items" role ="Test.Items"/>
exec [TestletByTestID] ?
</sql-query>
Is there a way to get around that auto-created foreign key?
Thanks a lot, Angel