openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ravi P Palacherla <>
Subject Purpose of SubclassJoinDiscriminatorStrategy.getClassConditions()
Date Fri, 05 Feb 2010 18:44:47 GMT


What is the purpose of getClassConditions methog of
SubclassJoinDiscriminatorStrategy ?

All it does is to add 'IS NULL' condition to all the subclasses.

This is causing a problem in the following scenario:

MountainBike and RacingBike extends Bicycle. Bicycle extends Vehicle.

All are entities and Inheritance strategy is InheritanceType.JOINED on all
the above classes.
None of them has discrimatorycolumn.

I persist Bicycle.
After persisting, I try to retrieve Bicycle by em.find then it returns
ObjectNotFound exception.

Reason is because the query contains :

select <<fields of Bicylce and Vehice>> from Bicycle,vehicle where = <<id passed in find>> AND == AND IS NULL AND IS NULL.

"AND IS NULL AND IS NULL" is causing the
ObjectNotFound exception beacuse there are no rows in MountainBike and

The solution for this problem seems to be avoiding the call to
getClassConditions() of

Please help.

View this message in context:
Sent from the OpenJPA Developers mailing list archive at

View raw message