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: Hibernate/JPA
PostPosted: Fri May 09, 2008 3:09 am 
Regular
Regular

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

im kinda testing arround with this stuff and have 2 questions which i didn't find an answer yet.
My first quetsion is how can i tell with annotation that i have 2 primary keys in my class for e.g. in SQL:

Code:
..
PRIMARY KEY (ID,NR)
...


my second question is a suggestion from me and im not sure if im going in a wrong direction with it. I really like how you can use hibernate with jpa to fill up a collection in a onetomany relation (e.g. fetch=FetchType.EAGER).

Now i tought it would be great if i could tell it somehow when i do remove() or add() an obj on this collection he will also do a update on the database. Is there a way to make this ?


Top
 Profile  
 
 Post subject: answers
PostPosted: Sun May 11, 2008 8:42 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
Read about primary key classes in the JEE tutorial:
http://java.sun.com/javaee/5/docs/tutorial/doc/bnbqa.html
There are several options, depending on your data model.


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.