JPA Composite Primary Key
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.