[jboss-user] [JBoss Tools] - how to invert reverse generated many-to-many annotations?

u j do-not-reply at jboss.com
Tue May 24 05:55:06 EDT 2011


u j [http://community.jboss.org/people/bcn] created the discussion

"how to invert reverse generated many-to-many annotations?"

To view the discussion, visit: http://community.jboss.org/message/606695#606695

--------------------------------------------------------------
I have the classical user, user-role and role tables and use the option "detect many to many tables".
Hibernate reverse engineering creates the getRoles method in the user class with mappedBy attribute and the getUsers method in the role class with the JoinTable attribute. Since this does not let me create users with cascade to the user-role table, the annotations should be the other way round. How can I achieve this with the tool? I run it many times, so I don't want to change the classes each time by hand.
How does Hibernate decide which is the leading table?

Thanks
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/606695#606695]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110524/142afe52/attachment.html 


More information about the jboss-user mailing list