Hi
I am completely befuddled by this problem: I have a list of strings in my DOM that I want to persist. The other properties get saved, but the list is silently dropped.
My schema looks like this:
Code:
<class name="CVAS.Primitives.Question, Primitives" table="Questions">
<id name="ID">
<generator class="native" />
</id>
<property name="Template" />
<property name="Prompt" not-null="true" />
<property name="Sequence" />
<many-to-one name="QuestionSet" class="CVAS.Primitives.QuestionSet, Primitives" column="QuestionSet" />
</class>
<joined-subclass name="CVAS.Primitives.CategoricalQuestion, Primitives" extends="CVAS.Primitives.Question, Primitives" table="CategoricalQuestions">
<key column="QuestionID" />
<list name="OptionsList" table="CategoricalOptions">
<key column="QuestionID" />
<index column="QuestionSequence" />
<element column="Value" type="string" not-null="true" />
</list>
</joined-subclass>
The relevant log looks like this
Code:
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - saving [CVAS.Primitives.CategoricalQuestion#<null>]
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Impl.SessionImpl [(null)] <(null)> - executing insertions
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Impl.WrapVisitor [(null)] <(null)> - Wrapped collection in role: CVAS.Primitives.CategoricalQuestion.OptionsList
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Persister.NormalizedEntityPersister [(null)] <(null)> - Inserting entity: CVAS.Primitives.CategoricalQuestion (native id)
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Opened new IDbCommand, open IDbCommands :1
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Building an IDbCommand object for the SqlString: INSERT INTO dbo.Questions (QuestionSet, Prompt, Template, Sequence) VALUES (:QuestionSet, :Prompt, :Template, :Sequence); select SCOPE_IDENTITY()
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Type.Int64Type [(null)] <(null)> - binding '1' to parameter: 0
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Type.StringType [(null)] <(null)> - binding 'True or false?' to parameter: 1
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Type.StringType [(null)] <(null)> - binding 'CVAS.WebUI.Question_MultipleChoice' to parameter: 2
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.Type.Int32Type [(null)] <(null)> - binding '1' to parameter: 3
2005-12-20 13:53:59,824 [5472] DEBUG NHibernate.SQL [(null)] <(null)> - INSERT INTO dbo.Questions (QuestionSet, Prompt, Template, Sequence) VALUES (@p0, @p1, @p2, @p3); select SCOPE_IDENTITY()
2005-12-20 13:53:59,834 [5472] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Opened Reader, open Readers :1
2005-12-20 13:53:59,834 [5472] DEBUG NHibernate.Persister.AbstractEntityPersister [(null)] <(null)> - Natively generated identity: 1
2005-12-20 13:53:59,834 [5472] DEBUG NHibernate.Driver.NHybridDataReader [(null)] <(null)> - running NHybridDataReader.Dispose()
2005-12-20 13:53:59,834 [5472] DEBUG NHibernate.Impl.BatcherImpl [(null)] <(null)> - Closed Reader, open Readers :0
What happens after the collection is wrapped? Nothing seems to get saved in the database. I tried adding a cascade attribute on the list, but that didn't help.
What am I missing?
Gene