here´s the .hbm files for the upper level class
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Business.Data.Evaluations,Business" table="Evaluations">
<id name="IdEvaluation" column="idEvaluation" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<bag name="QuestionsList" inverse="true" lazy="true" >
<key column="idEvaluation" />
<one-to-many class="Business.Data.Questions,Business" />
</bag>
<property column="title" type="String" name="title" not-null="true" length="50" />
<property column="tDisponible" type="Int32" name="TDisponible" />
<property column="tAviso" type="Int32" name="TAviso" />
<property column="puntaje" type="Int32" name="Puntaje" />
</class>
</hibernate-mapping>
and the Questions mapping:Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Business.Data.Questions,Business" table="Questions">
<id name="IdQuestion" column="idQuestion" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<bag name="AnswersList" inverse="true" lazy="true" >
<key column="idQuestion" />
<one-to-many class="Business.Data.Answers,Business" />
</bag>
<many-to-one name="IdEvaluation" column="idEvaluation" class="Business.Data.Evaluations,Business" />
<many-to-one name="IdCategoria" column="idCategoria" class="Business.Data.Categorias,Business" />
<property column="nQuestion" type="String" name="NQuestion" not-null="true" length="255" />
<property column="activa" type="Boolean" name="Activa" not-null="true" />
</class>
</hibernate-mapping>
here's the mapping for the AnswersCode:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Business.Data.Answers,Business" table="Answers">
<id name="IdAnswer" column="idAnswer" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<many-to-one name="IdQuestion" column="idQuestion" class="Business.Data.Questions,Business" />
<property column="nAnswer" type="String" name="NAnswer" not-null="true" length="255" />
<property column="valid" type="Boolean" name="Valid" not-null="true" />
</class>
</hibernate-mapping>
i need to "Save as..." (clone except by the id) an upper lever class Evaluations and with this all the related Questions and all the Answers for these related questions.
Tks again!