[hibernate-dev] MetadataSourceProcessor and associations

Gail Badner gbadner at redhat.com
Wed Jan 23 14:13:48 EST 2013


Is it possible for an entity containing one side of an association be mapped using annotations and the entity containing the opposite side of the association be mapped using an hbm mapping?

For example, suppose Order has annotations:

@OneToMany( mappedby="order" )
List<OrderLine> Order.orderLines

OrderLine is mapped using hbm.xml with:

<many-to-one name="order"/>

If annotations are processed first, then, IIUC, when Order.orderLines is processed, the mapping for OrderLine won't be found (via chasing) because the AnnotationMetadataSourceProcessorImpl does not have the source for the OrderLine mapping. As a result, the OrderLine EntityBinding will not be able to be built until HbmMetadataSourceProcessorImpl is processed.

If so, this poses a fundamental problem with entity "chasing" as it is implemented now, since the associated entity would not be processed by the same MetadataSourceProcessor.

Am I missing something here?

Thanks,
Gail


More information about the hibernate-dev mailing list