Note that there are some explanatory texts on larger screens.

plurals
  1. POThe element 'class' in namespace 'urn:nhibernate-mapping-2.2' has invalid child element 'id'
    primarykey
    data
    text
    <p>I'm newbie with Nhibernate. Hope I can find the answer here. This is my class:</p> <pre><code>public class PaymentAudit : EntityBase&lt;int&gt;, IAggregateRoot { public PaymentAudit() { } public System.Guid PaymentStateId { get; set; } public System.DateTime DateStamp { get; set; } public Payment Trn { get; set; } public PaymentSaga PaymentSaga { get; set; } public ProcessState ProcessState { get; set; } public PublishState PublishState { get; set; } public System.Nullable&lt;short&gt; ChgCount { get; set; } public string UserName { get; set; } protected override void Validate() { } } </code></pre> <p>This is my mapping:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Praweda.Interface.Framework.Model.Payment" assembly="Praweda.Interface.Framework.Model"&gt; &lt;class name="PaymentAudit" table="PaymentAudit" lazy="false" &gt; &lt;composite-id&gt; &lt;key-property name="PaymentStateId" column="PaymentStateId" /&gt; &lt;key-property name="DateStamp" column="DateStamp" /&gt; &lt;key-property name="ProcessState" column="ProcessState" /&gt; &lt;/composite-id&gt; &lt;id name="PaymentState"&gt; &lt;generator class="identity" /&gt; &lt;column name="PaymentStateId" sql-type="uniqueidentifier" not-null="true" /&gt; &lt;/id&gt; &lt;id name="ProcessState"&gt; &lt;generator class="identity" /&gt; &lt;column name="ProcessState" sql-type="varchar" not-null="true" /&gt; &lt;/id&gt; &lt;id name="DateStamp"&gt; &lt;generator class="identity" /&gt; &lt;column name="DateStamp" sql-type="datetime" not-null="true" /&gt; &lt;/id&gt; &lt;many-to-one insert="false" update="false" lazy="false" name="PaymentStateId"&gt; &lt;column name="PaymentStateId" sql-type="uniqueidentifier" not-null="true" /&gt; &lt;/many-to-one&gt; &lt;property name="PaymentStateId"&gt; &lt;column name="PaymentStateId" sql-type="uniqueidentifier" not-null="true" /&gt; &lt;/property&gt; &lt;many-to-one insert="false" update="false" lazy="false" name="ProcessState"&gt; &lt;column name="ProcessState" sql-type="varchar" not-null="true" /&gt; &lt;/many-to-one&gt; &lt;property name="ProcessState"&gt; &lt;column name="ProcessState" sql-type="varchar" not-null="true" /&gt; &lt;/property&gt; &lt;many-to-one insert="false" update="false" lazy="false" name="PublishState"&gt; &lt;column name="PublishState" sql-type="varchar" not-null="false" /&gt; &lt;/many-to-one&gt; &lt;property name="PublishState"&gt; &lt;column name="PublishState" sql-type="varchar" not-null="false" /&gt; &lt;/property&gt; &lt;many-to-one insert="false" update="false" lazy="false" name="Trn"&gt; &lt;column name="Trn" sql-type="varchar" not-null="false" /&gt; &lt;/many-to-one&gt; &lt;property name="Trn"&gt; &lt;column name="Trn" sql-type="varchar" not-null="false" /&gt; &lt;/property&gt; &lt;property name="ChgCount"&gt; &lt;column name="ChgCount" sql-type="smallint" not-null="false" /&gt; &lt;/property&gt; &lt;property name="UserName"&gt; &lt;column name="UserName" sql-type="nvarchar" not-null="false" /&gt; &lt;/property&gt; &lt;/class&gt; &lt;/hibernate-mapping&gt; </code></pre> <p>When I'm trying to add the repository assembly in session factory, here's the code</p> <pre><code> Configuration config = new Configuration(); config.AddAssembly("MyProject.Nhibernate.Repository"); log4net.Config.XmlConfigurator.Configure(); config.Configure(); _sessionFactory = config.BuildSessionFactory(); </code></pre> <p>give me error : The element 'class' in namespace 'urn:nhibernate-mapping-2.2' has invalid child element 'id' in namespace 'urn:nhibernate-mapping-2.2'.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload