I’d like to achieve the following schema:
Table A:
a_id
(other columns)
Table B:
b_id
(other columns)
Table C:
c_id
(other columns)
Table D:
a_id_fk
b_id_fk
c_id_fk
I would like to know how to create entity D. All the keys a_id_fk, b_id_fk and c_id_fk in Table D form a composite primary key.
Thanks
It models a ternary association. In order to use it you need a map. JPA 1.0 does not support Map so if you want to use you need Hibernate because its Map suppport. It is something like
Notice each key is a B and each value is a C entity. In practice, it binds A and C through a B entity.
Or if you do not want a Map you can model a entity ABC according to
regards,