Discussion:
[nhusers] Compilation Error
Siva Prasad Nath
2017-12-28 15:28:21 UTC
Permalink
Below is my .hbm.ml file contents.
wmis_service_master is parent table. other one is child table.Child table
has composite key(id+ctr).

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping assembly="wmis.app" namespace="wmis.app.Models"
xmlns="urn:nhibernate-mapping-2.2">
<class name="wmis_service_master" table="wmis_service_master" >
<cache usage="read-write" />
<id name="sm_id" column="sm_id" type="Int32">
<generator class="native" />
</id>
<property name="sm_svc_date" />
<property name="sm_veh_num" />
<property name="sm_svc_type" />
<property name="sm_client_id" />
<property name="sm_client_type" />
<property name="sm_author" />
<property name="sm_creation_date" />
<property name="sm_oil" />
<property name="sm_mileage" />
<set name="ServiceDetails" cascade="all" inverse="true">
<key column="sm_id"/>
<one-to-many class="wmis_service_detail"/>
</set>

</class>
<class name="wmis_service_detail" table="wmis_service_detail" >
<cache usage="read-write" />
<id name="sd_svc_ctr" column="sd_svc_ctr" type="Int32">
<generator class="native" />
</id>
<property name="sd_svc_required" />
<many-to-one name="ServiceDet" class="wmis_service_master"
column="sd_svc_no" />
</class>
</hibernate-mapping>
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
Gunnar Liljas
2017-12-28 15:49:43 UTC
Permalink
And the error?
Post by Siva Prasad Nath
Below is my .hbm.ml file contents.
wmis_service_master is parent table. other one is child table.Child table
has composite key(id+ctr).
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping assembly="wmis.app" namespace="wmis.app.Models"
xmlns="urn:nhibernate-mapping-2.2">
<class name="wmis_service_master" table="wmis_service_master" >
<cache usage="read-write" />
<id name="sm_id" column="sm_id" type="Int32">
<generator class="native" />
</id>
<property name="sm_svc_date" />
<property name="sm_veh_num" />
<property name="sm_svc_type" />
<property name="sm_client_id" />
<property name="sm_client_type" />
<property name="sm_author" />
<property name="sm_creation_date" />
<property name="sm_oil" />
<property name="sm_mileage" />
<set name="ServiceDetails" cascade="all" inverse="true">
<key column="sm_id"/>
<one-to-many class="wmis_service_detail"/>
</set>
</class>
<class name="wmis_service_detail" table="wmis_service_detail" >
<cache usage="read-write" />
<id name="sd_svc_ctr" column="sd_svc_ctr" type="Int32">
<generator class="native" />
</id>
<property name="sd_svc_required" />
<many-to-one name="ServiceDet" class="wmis_service_master"
column="sd_svc_no" />
</class>
</hibernate-mapping>
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
Siva Prasad Nath
2017-12-28 17:07:52 UTC
Permalink
Thanks for your response.
public virtual IList<wmis_service_detail> ServiceDetails { get; set; }
public virtual wmis_service_master ServiceDet { get; set; }
After adding above in the class it works fine. Do I need to do anything
else?
Post by Gunnar Liljas
And the error?
Post by Siva Prasad Nath
Below is my .hbm.ml file contents.
wmis_service_master is parent table. other one is child table.Child table
has composite key(id+ctr).
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping assembly="wmis.app" namespace="wmis.app.Models"
xmlns="urn:nhibernate-mapping-2.2">
<class name="wmis_service_master" table="wmis_service_master" >
<cache usage="read-write" />
<id name="sm_id" column="sm_id" type="Int32">
<generator class="native" />
</id>
<property name="sm_svc_date" />
<property name="sm_veh_num" />
<property name="sm_svc_type" />
<property name="sm_client_id" />
<property name="sm_client_type" />
<property name="sm_author" />
<property name="sm_creation_date" />
<property name="sm_oil" />
<property name="sm_mileage" />
<set name="ServiceDetails" cascade="all" inverse="true">
<key column="sm_id"/>
<one-to-many class="wmis_service_detail"/>
</set>
</class>
<class name="wmis_service_detail" table="wmis_service_detail" >
<cache usage="read-write" />
<id name="sd_svc_ctr" column="sd_svc_ctr" type="Int32">
<generator class="native" />
</id>
<property name="sd_svc_required" />
<many-to-one name="ServiceDet" class="wmis_service_master"
column="sd_svc_no" />
</class>
</hibernate-mapping>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an
<javascript:>.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
Gunnar Liljas
2017-12-28 18:25:42 UTC
Permalink
I don't think so.

/G
Post by Siva Prasad Nath
Thanks for your response.
public virtual IList<wmis_service_detail> ServiceDetails { get; set; }
public virtual wmis_service_master ServiceDet { get; set; }
After adding above in the class it works fine. Do I need to do anything
else?
Post by Gunnar Liljas
And the error?
Post by Siva Prasad Nath
Below is my .hbm.ml file contents.
wmis_service_master is parent table. other one is child table.Child
table has composite key(id+ctr).
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping assembly="wmis.app" namespace="wmis.app.Models"
xmlns="urn:nhibernate-mapping-2.2">
<class name="wmis_service_master" table="wmis_service_master" >
<cache usage="read-write" />
<id name="sm_id" column="sm_id" type="Int32">
<generator class="native" />
</id>
<property name="sm_svc_date" />
<property name="sm_veh_num" />
<property name="sm_svc_type" />
<property name="sm_client_id" />
<property name="sm_client_type" />
<property name="sm_author" />
<property name="sm_creation_date" />
<property name="sm_oil" />
<property name="sm_mileage" />
<set name="ServiceDetails" cascade="all" inverse="true">
<key column="sm_id"/>
<one-to-many class="wmis_service_detail"/>
</set>
</class>
<class name="wmis_service_detail" table="wmis_service_detail" >
<cache usage="read-write" />
<id name="sd_svc_ctr" column="sd_svc_ctr" type="Int32">
<generator class="native" />
</id>
<property name="sd_svc_required" />
<many-to-one name="ServiceDet" class="wmis_service_master"
column="sd_svc_no" />
</class>
</hibernate-mapping>
--
You received this message because you are subscribed to the Google
Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
Loading...