-->
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: ManyToAny treated as ManyToMany
PostPosted: Thu Dec 10, 2009 12:26 pm 
Regular
Regular

Joined: Thu Dec 10, 2009 10:53 am
Posts: 50
I am trying to setup a ManyToAny association like so:

Code:
   @ManyToAny(fetch = FetchType.EAGER, metaColumn = @Column(name = "Other_targetType"))
   @Cascade( value = { org.hibernate.annotations.CascadeType.ALL } )
   @AnyMetaDef(idType = "string", metaType = "string", metaValues = {})
   @JoinTable(name = "AA_Objekt_istTeilVon")
   public java.util.Set<B> getB() {
      return b;
   }


The Proplem is that Hibernate seems to ignore the statement and use plain old ManyToMany.

The abstract class B is on top of a large inheritance hieararchy with the TABLE_PER_CLASS strategy.
If we use ManyToMany for this association the resulting SQL statement to retrieve an associated object of class B is very large.

That's why we want to use ManyToAny to circumvent the union of all of B's subclasses.


When we use ManyToMany and ManyToAny we get a join table with two id columns.
We would like to have another column "Other_targetType" to eleminate the huge union.

Do you have any ideas?

Thanks,
Tim


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.