|Calculated Primary Key [message #555800]
||Sat, 28 August 2010 22:03
| Mark Hoffmann
Registered: July 2009
I want to integrate pseudonymization / depseudonymization using JPA. Imagine a one to many relationship between a customer and many orders. The order entity should contain a foreign key of type string. This foreign key is calculated from a Java implementation using fields from the customer entity. This implementation creates the foreign key value from the three fields and extracts the three fields from a given foreign key value.
The customer entity will have a compound primary key class(firstname, lastname, birthdate). The problem is that the key in customer are in this example 3 fields and the reference in the order is one calculated value of this fields. Is there a hook which I could use in EclipseLink? Or do I have to extend EclipseLink? Is this barely possible?
I don't know how to solve this problem unless I want to use the convenient @OneToMany in the customer entity.
Powered by FUDForum
. Page generated in 0.02023 seconds