-->
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: Maps under a <join>
PostPosted: Fri Feb 04, 2005 8:23 am 
Newbie

Joined: Fri Feb 04, 2005 6:43 am
Posts: 2
Hibernate version: 3.0beta3

Hi.

The <join> element currently does not support a <map> element beneath it and I was wondering if there is a reason this is so. I have the following use case, under which I believe such an option would make sense:

I have a cms, where the users can dynamically add new mappings at runtime. The new mappings fall under a parent subclass (a generic "node") which can result in a very wide tree. For this I made the new mappings use a <join> with fetch="select", so I can use a discriminator instead of endless sql joins.

The users can define new types of content and they have an option for making the fields localized. Those fields are actually stored in an external table and fetched using a Map.

Currenlty, I have placed a <dynamic-component> under the <join> and place the maps in there, like this:

Code:
<subclass name="eg.dynanodes.News" discriminator-value="DYNA_NEWS">
   <join table="NODES_NEWS" fetch="select">
      <key column="UUID"/>
      <property name="date" type="java.util.Date" column="DATE"/>
      <dynamic-component name="i18n">
         <map name="title" table="NODES_NEWS_TITLE" lazy="false" cascade="all-delete-orphan">
            <key column="UUID"/>
            <index column="LANG_ID" type="integer"/>
            <element column="VALUE" type="string" length="128"/>
         </map>
      </dynamic-component>
   </join>
</subclass>


(Actually I dont have mappings anywhere, I never generate them in xml and instead manipulate the mappings at runtime, but this is what it would be like)

However it would be more intuitive if the <map> element could be placed directly under the <join>. I think it might be a useful feature (as well as other collections too)

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 04, 2005 8:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
I don't think so. You can place the <map> next to the join!


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.