Results 1 to 3 of 3
Thread: JPA Composite Primary Key
- 01-30-2009, 09:32 AM #1
Member
- Join Date
- Jan 2009
- Posts
- 2
- Rep Power
- 0
JPA Composite Primary Key
Hi,
I'm new and this is my first post. Sorry for my bad english, it isn't my first language :o .
I have a table 'A', 'B' and 'C'. And i want to have a table 'A_B_C_ASSIGNMENT', which contains the id from 'A', 'B' and 'C' as foreign key. The assignment table will not have an separate identity. The id from 'A' and 'B' will be used as unique primary key.
How can I build an entity which represents this case with JPA?
I've got a solution with @EmbeddedId and @Embeddable annotations. But if I say, that the 'A_B_C_ASSIGNMENT' table should be removed when 'A' will be removed (Set with 'A_B_C_ASSIGNMENT' in 'A' is set to 'cascade = CascadeType.ALL'), there will be an jdbc-batch-update exception, because the according dataset in 'A_B_C_ASSIGNMENT' table doesn't become deleted. It works, if i delete the dataset in 'A_B_C_ASSIGNMENT' manually before removing the 'A' dataset.
Thank You!
- 02-05-2009, 04:14 PM #2
I'm sorry I can't help, but I wanted to tell you that I at least looked at your post. I'm not familiar with JPA...
- 02-06-2009, 06:30 AM #3
Member
- Join Date
- Jan 2009
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
How to generate primary key in EJB
By naresh_m in forum Enterprise JavaBeans (EJB)Replies: 1Last Post: 07-17-2008, 09:41 AM -
Getting primary key information from Pervasive SQL
By rmaadil in forum JDBCReplies: 0Last Post: 05-14-2008, 09:46 AM -
Getting primary key information in Pervasive SQL
By rmaadil in forum JDBCReplies: 0Last Post: 05-14-2008, 07:18 AM -
JCombox DropDown is displayed on primary monitor when the box is in between two monit
By Kalpana.k in forum AWT / SwingReplies: 1Last Post: 05-01-2008, 03:19 PM -
how to determine the primary key
By osval in forum JDBCReplies: 1Last Post: 08-07-2007, 02:31 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks