-->
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: Mapping collections to database
PostPosted: Thu Jan 17, 2008 1:38 pm 
Newbie

Joined: Thu Jan 17, 2008 1:12 pm
Posts: 8
I am new hibernate user.I am using hibernate with Java Persistence API.
When i try to map a collection to the database . It automatically creates a second table for the collection.Is it supposed to happen that way??
Is there a way to stop it from creating it.


Top
 Profile  
 
 Post subject: Re: Mapping collections to database
PostPosted: Thu Jan 17, 2008 2:07 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
amar_hyd wrote:
I am new hibernate user.I am using hibernate with Java Persistence API.
When i try to map a collection to the database . It automatically creates a second table for the collection.Is it supposed to happen that way??
Is there a way to stop it from creating it.


Hibernate favors designing an association with a join table. That's actually not a bad idea at all. I am not sure how you can disable this because though. In certain cases however you will be able to put @JoinColumns, as in case of one-to-many, and that should (would) force hibernate to skip a join table.


Farzad-


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.