openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garpinc <garp...@yahoo.com>
Subject Attempt to set column xxx to two different values
Date Thu, 06 Sep 2012 00:26:46 GMT
I have a java class with 2 method names which are too long for db. To resolve
I put at @JoinColumn on the 2 getters with different names but i'm still
getting below exception. Can someone tell me to how to resolve?

	@OneToMany(targetEntity=ShowPerformanceCacheWrapper.class)
        @JoinColumn(name = "ShowPerformanceAssignmentOccur1")
	public Collection<ShowPerformance>
getShowPerformanceAssignmentOccursOnThisPerformance() {

	@OneToMany(targetEntity=ShowActPositionCacheWrapper.class)
        @JoinColumn(name = "ShowPerformanceAssignmentOccur2")
	public Collection<ShowActPosition>
getShowPerformanceAssignmentOccursOnThisPosition() {

Caused by: <openjpa-2.2.0-r422266:1244990 fatal user error>
org.apache.openjpa.persistence.InvalidStateException: Attempt to set column
"ShowPerformanceAssignment.SHOWPERFORMANCEASSIGNMENTOCCUR" to two different
values: (class java.lang.Long)"835,839", (class java.lang.Long)"890,556"
This can occur when you fail to set both sides of a two-sided relation
between objects, or when you map different fields to the same column, but
you do not keep the values of these fields in synch.
	at org.apache.openjpa.jdbc.sql.PrimaryRow.setObject(PrimaryRow.java:344)
	at org.apache.openjpa.jdbc.sql.RowImpl.flushJoinValues(RowImpl.java:294)
	at org.apache.openjpa.jdbc.sql.RowImpl.flushForeignKey(RowImpl.java:222)



--
View this message in context: http://openjpa.208410.n2.nabble.com/Attempt-to-set-column-xxx-to-two-different-values-tp7581031.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message