-->
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: Add/Create a new Column into JoinTable
PostPosted: Tue May 27, 2008 3:59 pm 
Newbie

Joined: Tue May 27, 2008 3:46 pm
Posts: 5
Hi, there:

I'd like to know how to through annotation to add/create a new column into a join table so that the join table would have an additional column besides joined columns from other tables.

For example, the following annotation would give me a join table with column "SERVER_ID" and column "CLIENT_ID" in table "server_client". If I were to add/create column "CLIENT_STATUS" into this table through annotation (if possible), what would I do? If not possible through annotation, what other ways to accomplish this? Thank you very much in advance!

Ali

------------------------------------

@JoinTable(name = "SERVER_CLIENT",
joinColumns = @JoinColumn (name = "SERVER_ID"),
inverseJoinColumns = @JoinColumn (name = "CLIENT_ID"))


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 4:05 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
I think a very similar scenario to yours was discussed on the JavaRanch. Take a look at this thread:

http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=78&t=003773

I'm not sure if a definitive answer arrived, although it does appear that a solution was creatively put together here:

http://java-aap.blogspot.com/2006/04/hibernate-annotations-composite.html

Best of luck!

_________________
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.  [ 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.