-->
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.  [ 4 posts ] 
Author Message
 Post subject: How can I assign a sequence to an @AssociationTable?
PostPosted: Wed Oct 05, 2005 11:06 am 
Newbie

Joined: Tue Sep 20, 2005 3:51 pm
Posts: 18
Location: Boston, MA
Hello all,
Does anyone know how I can assign a sequence to an @AssociationTable? I’m using Oracle9iR2 and the latest version of Hibernate. I just need to assign <MySequenceName>.nextVal to each id column of my join table.

I’ve mapped a @ManyToMany relationship and can read my objects perfectly, but have to resort to using triggers to persist newly created objects. The trigger is causing a problem with another trigger I need to add to fix a different issue.

I have full freedom to use EJB3 or an XML mapping if it gets the job done. I'm also not adverse to inserting custom SQL into the mapping. I'd appreciate any hibernate-related suggestions.

Thanks in advance,
Steven


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 07, 2005 5:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
@AssociationTable is deprecated and is now @JoinTable
This is not possible as per the spec.
In Hibernate this will be possible using an @IdBag or something equivalent, but I need to do it.
For the other cases (ie set lists, maps) an extra ID doesn't really make sense since a PK is well defined.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Anyone ever tackle this?
PostPosted: Tue Mar 21, 2006 3:04 pm 
Newbie

Joined: Wed Feb 23, 2005 11:57 am
Posts: 15
I am trying to represent an IdBag using annotations.
Is there some alternative method to have a sequence in an association table?

Thanks,
-gabe


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 25, 2006 9:14 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
there is an open bug for me to implement Id bags in annotations.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.