Apparently the @JoinTable is creating SQL similar to the following:

SELECT t0.*
FROM PROOF.ACCOUNTS t0,
PROOF.ACTIVITY t1,
PROOF.ACTIVITY t2
WHERE t0.ACCOUNT_ID = t1.ACCOUNT_ID (+)
AND t1.ACCOUNT_ID = t2.ACCOUNT_ID

Why openJPA is creating a join to the same table twice is beyond me. I
believe this is why I'm getting the OptimisticLockException.


So, I modified the annotations to the following:

@OneToMany(fetch=FetchType.EAGER,cascade=CascadeType.ALL,targetEntity=Activity.class)
@JoinColumn(name="ACCOUNT_ID", referencedColumnName="ACCOUNT_ID")
private Set<Activity> activities = new HashSet<Activity>();

Then I get the infamous: "You have supplied columns for ... but this mapping
cannot have columns in this context."

I think my relationship annotations are inaccurate. Still getting burned
here.


-----
Seth Jackson
-- 
View this message in context: 
http://n2.nabble.com/openjpa-1-2-2-Optimistic-Lock-Exception-tp4842528p4842849.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to