Can OpenJPA map a one-sided one-many association without a cross table?
Yes. Standard JPA specification use a cross table to map one-sided one-to-many relation without a mappedBy inverse side. Often, you would like to create a one-to-many association based on an inverse foreign key (logical or actual) in the table of the related type. OpenJPA supports this mapping via @ElementJoinColumn annotation. The following example will map the collection of LineItem of a Subscription via a foreign key of LINEITEM table referring to primary key of SUBSCRIPTION table.
Related Questions
- Im running dual monitors on my PC. Is there any way to drag Map, Table, News and Profile screens from the primary monitor to the secondary monitor?
- Im running dual monitors on my PC. Is there any way to drag Map, Table, News and Profile screens from the primary monitor to the secondary monitor?
- Why are there red exclamation marks beside the layers in my maps table of contents?
- Why are there red exclamation marks beside the layers in my maps table of contents?
- What is this cross hair button in the upper right corner of the map doing?
- Can OpenJPA map a one-sided one-many association without a cross table?