-->
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: Why uses a collection with composite-element only Maps?
PostPosted: Fri Oct 26, 2007 5:58 am 
Newbie

Joined: Mon Sep 10, 2007 9:30 am
Posts: 12
Hello,

Hibernate version: 3.2.5.ga

I use a collection of dependent objects with :

Code:
<class entity-name="PARENT" table="PARENT">
  <tuplizer entity-mode="dynamic-map" class="MyTuplizer"/>
...
  <map name="childs"
         table="CHILDS"
         cascade="save-update,delete">
    <key>
      <column name="PARENT_ID"/>
    </key>
    <map-key column="CHILD_NAME" type="string"/>
    <composite-element class="ChildClass">
      <property name="id"     column="CHILD_ID"       type="long"    not-null="true" />
      <property name="string" column="CHILDE_ATTRIBUTE"  type="string" />
    </composite-element>
  </map>
...
</class>


I use my own tuplizer to map the child attributes as plain attributes of the parent. This works good.
Now my problem:
The setting class="ChildClass" has to be set but seems to be ignored. Inside of the Setter of the tuplizer the returned object is only a HashMap with "id" and "string". This makes it complicated to implement. Why is a HashMap returned and not the ChildClass?

I would like to implement the ChildClass as a POJO without the Map-interface and use this?

regards


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.