"referenced-column-name" in orm.xml Throws EclipseLink-7222 ValidationException (Doc ID 1594020.1)

Last updated on OCTOBER 31, 2013

Applies to:

Oracle TopLink - Version 12.1.1.0 to 12.1.1.0 [Release 12c]
Information in this document applies to any platform.

Symptoms

The issue occurs when a relation between two tables (such as a composite primary key) is specified in orm.xml with two tables that are related by a column with the same name.

In this scenario orm.xml parsing fails as it appears it cannot properly parse the line, for example:

 which throws the exception, for example:

Exception Description: Predeployment of PersistenceUnit [rd1] failed.

Internal Exception: Exception [EclipseLink-7222] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ValidationException

Exception Description: An incomplete @PrimaryKeyJoinColumns was specified on the annotated element [class someapp.app.appdom.domain.rd1.From]. When specifying @PrimaryKeyJoinColumns for an entity that has a composite primary key, a @PrimaryKeyJoinColumn must be specified for each primary key join column using the @PrimaryKeyJoinColumns. Both the name and the referencedColumnName elements must be specified in each such @PrimaryKeyJoinColumn.

at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:127

 

If this line is commented out the exception is not thrown. Also the exception is not thrown when using annotation instead of specifiying in orm.xml

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms