-->
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: value collections table
PostPosted: Fri Jan 30, 2004 11:59 am 
Beginner
Beginner

Joined: Fri Oct 24, 2003 10:45 am
Posts: 22
Hi guys,

Would be really grateful for any advice.
In my mappings I have a couple of dozens of constructions like this:

<bag name="reasons" cascade="all" table="reason" lazy="true">
<key column="alert_id"/>
<element column="reason_text" type="string"/>
</bag>

It means I have to have a couple of dozens of tables to store elements of value collections which is not perfect. I would rather have just one table to store all the collections.

I know that the simplest way of doing that is to use classes and declare <one-to-many> instead of <element> and use table-per-hierarchy structure for those classes.

Is there a way do implement that without having those classes?

Thanks,
Andrey


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 2:10 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
the one-to-many won't solve you problem.
You may have the same key id for different entities and thus mixing elements between maps.

_________________
Emmanuel


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.