Joined: Fri Sep 07, 2007 11:21 am Posts: 1
|
|
Hello all.
I have the folloving question.
Let's suppose we have the following mapping file:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="nhibernate_test"
namespace="nhibernate_test">
<class name="CompanyEntity" table="gl_company">
<id name="CompanyNo" column="gl_company_no" unsaved-value="-1">
<generator class="native" />
</id>
<property name="Id" access="property">
<column name="id" />
</property>
<property name="Name" access="property">
<column name="name" />
</property>
<set
name="Comments" table="gl_company_comments"
cascade="all-delete-orphan"
lazy="true" inverse="false">
<key column="gl_company_no" />
<many-to-many class="AppCommentEntity" column="app_comment_no" />
</set>
</class>
<class name="AppCommentEntity" table="app_comments">
<id name="AppCommentNo" column="app_comment_no" unsaved-value="-1">
<generator class="native" />
</id>
<property name="CommentDate" access="property">
<column name="comment_date" />
</property>
<property name="CommentType" access="property">
<column name="comment_type" />
</property>
<property name="Comments" access="property">
<column name="comments" />
</property>
<property name="CreateDateTime" access="property">
<column name="create_date_time" />
</property>
<property name="CreateUserNo" access="property">
<column name="create_app_user_no" />
</property>
<property name="UpdateDateTime" access="property">
<column name="update_date_time" />
</property>
<property name="UpdateUserNo" access="property">
<column name="update_app_user_no" />
</property>
</class>
</hibernate-mapping>
To make the long maping file short, we have a CompanyEntity class that has a many-to-many set of AppCommentEntity classes.
My goal is to call the CRUD functions with the CompanyEntity class and add/delete/update AppCommentEntity classes using the Comments property of the company class. No problem so far. But now I want to get the AppCommentEntity classes paged and not lose the CRUD functions on the root entity and still be able to add/delete/update the child classes.
Is there any way of doing this?
|
|