Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can OpenJPA map a one-sided one-many association without a cross table?

0
Posted

Can OpenJPA map a one-sided one-many association without a cross table?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123