-->
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.  [ 2 posts ] 
Author Message
 Post subject: Dynamic-component with a bag of dynamic-class
PostPosted: Wed Feb 23, 2005 10:05 pm 
Newbie

Joined: Tue Jan 18, 2005 10:41 pm
Posts: 15
I am trying to implement a dynamic component that has a bag of dynamic classes.

My mapping (stripped to the minimum) looks like

Code:
<dynamic-component  name="fields">
          
   <bag name="multi" inverse="true">
      <key column="clientno"  />
      <one-to-many class="EntityMT" />
   </bag>
</dynamic-component>

<dynamic-class entity-name="EntityMT">
   <composite-id name="clientNo" class = "inform.orm.entity.ClientNo" >
      <key-property name="clientNo"/>
   </composite-id>
  <property name="description" column="description" type="string"/              
</dynamic-class>


Everthing appears to work when I load the component from the database. There is now a Map which contains a key element pair with a key of “multi” and a list as a element.

When I access the list the following SQL runs correctly selecting the required rows from the data base
Code:
select multi0_.clientno as clientno__, multi0_.clientNo as clientNo__, multi0_.clientNo as clientNo0_, multi0_.description as descript2_17_0 from EntityMT multi0_ where multi0_.clientno=?


The list contains the correct number of elements, but all the elements point to the same map. This map represents the first row of data. Where are the other rows of data?

I missing something?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 24, 2005 5:09 pm 
Newbie

Joined: Tue Jan 18, 2005 10:41 pm
Posts: 15
Yes I was.
I needed a better composite ID object.

Code:
<dynamic-class entity-name="EntityMT">
  <composite-id name="clientNo" class  "inform.orm.entity.ClientNoRowID" >
    <key-property name="clientNo" access="field"/>
    <key-property name="id" access="field" column="rowindex"/>
  </composite-id>
  <property name="description" column="description" type="string"/>
</dynamic-class>


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

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.