Hi,
This is first time I am using Nhibernet.
This is how I have defined my xml file
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhib ernate-mapping-2.2" default-lazy="false">
<class name="myVRM.Dat aLayer.vrmCusto mAttributes, vrmDataLayer" table="Dept_Cus tomAttr_Option_ D">
<id name="OptionID" column="OptionI D" type="Int32" unsaved-value="0">
<generator class="identity " />
</id>
<!-- Map properties I'd like to persist/fetch, assume column = propery name, and type is determined by reflection -->
<property name="CustomAtt ributeID"/>
<property name="DeptID"/>
<property name="OptionTyp e"/>
<property name="OptionID"/>
<property name="OptionVal ue"/>
<property name="Caption"/>
<property name="HelpText"/>
</class>
</hibernate-mapping>
Now my problem is when I am trying to enter a new record in table it does not takes the optionid as part of insert query and it fails.
Now if i remove the Id property from xml it gives me error because that is a mandotary field.
Please help me how to resolve this issue
This is first time I am using Nhibernet.
This is how I have defined my xml file
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhib ernate-mapping-2.2" default-lazy="false">
<class name="myVRM.Dat aLayer.vrmCusto mAttributes, vrmDataLayer" table="Dept_Cus tomAttr_Option_ D">
<id name="OptionID" column="OptionI D" type="Int32" unsaved-value="0">
<generator class="identity " />
</id>
<!-- Map properties I'd like to persist/fetch, assume column = propery name, and type is determined by reflection -->
<property name="CustomAtt ributeID"/>
<property name="DeptID"/>
<property name="OptionTyp e"/>
<property name="OptionID"/>
<property name="OptionVal ue"/>
<property name="Caption"/>
<property name="HelpText"/>
</class>
</hibernate-mapping>
Now my problem is when I am trying to enter a new record in table it does not takes the optionid as part of insert query and it fails.
Now if i remove the Id property from xml it gives me error because that is a mandotary field.
Please help me how to resolve this issue
Comment