openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Spiro (Commented) (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2054) Constant join fails
Date Fri, 30 Sep 2011 16:28:45 GMT


Michael Spiro commented on OPENJPA-2054:

A stack trace for this error:

<openjpa-2.1.0-r422266:1071316 fatal user error> org.apache.openjpa.persistence.ArgumentException:
"com.xxxxx.Xxx" defines a target of """1""" for join column "col_name", but that target does
not exist in table "dbname.tablename".
FailedObject: com.xxxxx.Xxxx@2f63e9a1 [java.lang.String]
	at org.apache.openjpa.jdbc.meta.MappingInfo.mergeJoinColumn(
	at org.apache.openjpa.jdbc.meta.MappingInfo.createJoins(
	at org.apache.openjpa.jdbc.meta.MappingInfo.createForeignKey(
	at org.apache.openjpa.jdbc.meta.FieldMappingInfo.getJoin(
	at org.apache.openjpa.jdbc.meta.FieldMappingInfo.getJoin(
	at org.apache.openjpa.jdbc.meta.FieldMapping.mapJoin(
	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(
	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(
	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveMapping(
	at org.apache.openjpa.meta.ClassMetaData.resolve(
	at org.apache.openjpa.meta.MetaDataRepository.processBuffer(
	at org.apache.openjpa.meta.MetaDataRepository.resolveMapping(
	at org.apache.openjpa.meta.MetaDataRepository.resolve(
	at org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(
	at org.apache.openjpa.kernel.AttachManager.attach(
	at org.apache.openjpa.kernel.AttachManager.attach(
	at org.apache.openjpa.kernel.BrokerImpl.attach(
	at org.apache.openjpa.kernel.DelegatingBroker.attach(
	at org.apache.openjpa.persistence.EntityManagerImpl.merge(

> Constant join fails
> -------------------
>                 Key: OPENJPA-2054
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.1.0
>            Reporter: Michael Spiro
>              Labels: Constant, join
> According to the documentation (Part 3, chapter 7, paragraph 6), join criteria can be
defined so that a column in the source or target table must have some constant value. The
constant value should be specified in the attribute "referencedColumnName" of the @JoinColumn
annotation. If the constant is a string then its value should be enclosed first in single
quotes and then in double quotes like this:
> @JoinColumn(name="table.column", referencedColumnName="'value'")
> A numeric constant value needs just a single pair of double quotes:
> @JoinColumn(name="table.column", referencedColumnName="2")
> However a practical test shows that both options produce an error.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message