To make it clearer, I would like to have a query like this:
"from SomeEntityBean b WHERE b.parent.discriminatorColumn = :discriminatorValue"
I'm also looking for this functionality - anyone???
assuming that you mean with hibernate...
You can add a read-only property to your hbm mapping file with the column attribute set to the same name as the discriminator column.
Yes, I actually figured out this rather simple (and obvious!) workaround just after I posted - thanks for the info.
In most cases you don't need this property, all you have to do is "find-select" on the sub-class. We needed to use it when we had a collectioin of parent class objects that contain mix of sub-classes items and we needed to select objects of one sub-class.