-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: lazy-loading with cascading entities
PostPosted: Sat Jun 09, 2007 10:39 am 
Newbie

Joined: Tue Mar 06, 2007 4:46 am
Posts: 7
Hello,
I've problems when using lazy-loading of one-to-many collections.

Is it possible to have a collection (set) which itselfs also has a collection?

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
  <class name="transact.BusinessFramework.BusinessLayer.Interface.dc_etyProject, transact.BusinessFramework.BusinessLayer.Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=399323deb3dc2693" table="tblProject">
    <id name="ID" column="ID" type="Int32">
      <generator class="native" />
    </id>
    <property name="ProjectName" type="String" length="100"/>
    <property name="ID_TargetPlatform" type="Int32"/>
    <property name="ID_Language" type="Int32"/>
    <property name="CompanyName" type="String" length="100"/>
    <property name="Copyright" type="String" length="100"/>
    <property name="ApplicationTitle" type="String" length="100"/>
    <property name="ApplicationNamespace" type="String" length="200"/>
    <property name="Version" type="String" length="20"/>
    <property name="Description" type="String" length="4000"/>
    <property name="OutputFolder" type="String" length="500"/>
    <property name="TimestampCreated" type="DateTime"/>
    <property name="TimestampChanged" type="DateTime"/>

    <set
      name="set_tblConnection"
      inverse="true"
      lazy="true"
      cascade="all">

      <key column="ID_Project"/>
      <one-to-many class="transact.BusinessFramework.BusinessLayer.Interface.dc_tblConnection, transact.BusinessFramework.BusinessLayer.Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=399323deb3dc2693"/>
    </set>

    <set
      name="set_etyRepositoryTypeFolder"
      inverse="true"
      lazy="true"
      cascade="all"
      order-by="RepositoryTypeFolder asc">

      <key column="ID_Project"/>
      <one-to-many class="transact.BusinessFramework.BusinessLayer.Interface.dc_etyRepositoryTypeFolder, transact.BusinessFramework.BusinessLayer.Interface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=399323deb3dc2693"/>
    </set>


The listing obove showes a mapping with two sets.

set_tblConnection is a simple set of rows.

set_etyRepositoryTypeFolder is a collection of entities with an one-to-many association.


Robert


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.