-->
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.  [ 3 posts ] 
Author Message
 Post subject: ManyToMany Question
PostPosted: Tue Jun 03, 2008 3:36 pm 
Regular
Regular

Joined: Wed Apr 09, 2008 10:28 am
Posts: 52
Hi,

i have 2 Tables User and Authority both of them have an Integer id as PK.
So i have a JoinTable(User_Details) where i store those keys and can lookup the references when i need to. I want to add to this table 2 more fields one from User and another one from Authority is this possible? I somehow could not find any example which covers this.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 3:53 am 
Regular
Regular

Joined: Wed Apr 09, 2008 10:28 am
Posts: 52
ok solved it myself. Here an example in case someone else need it.
Code:
@JoinTable(name="",
        joinColumns={
            @JoinColumn(name="", referencedColumnName=""),
            @JoinColumn(name="", referencedColumnName="")
        },
        inverseJoinColumns=@JoinColumn(name=""))



Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 04, 2008 10:03 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Thanks for the update. It's always great to see solutions to problems!

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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