Hi Joe, If you use the "super" reference descriptor as a mapping strategy to map a single class to multiple joined tables *and* you want the subclass to be an extent of the super class (for querying purposes), the primary key must be unique within the extent. This means that you cannot use a shared id field for the join.
This is one area of OJB that is often confused. Often people want to mirror the java inheritance hierarchy with extents and "super" joined tables. You should realize that these three concepts are separate and can vary and do carry restrictions. Java Inheritance Hierarchy != Extent Domain != Mapping Strategy Hope this helps. Wally -----Original Message----- From: Joseph Elliott [mailto:[EMAIL PROTECTED] Sent: Thursday, December 11, 2003 6:24 PM To: [EMAIL PROTECTED] Subject: criteria queries w/ superclass mappings? hi. i have a base class and a subclass with corresponding fields mapped to separate tables (with the "super" reference-descriptor). everything seems happy when i query against the super class or when i query against the subclass by the shared 'id' column. but when i attempt to query against the subclass using an attribute living in the superclass table things fail, and i can see that the generated sql is attempting to select only from the subclass table. out of curiosity i attempted a QueryByExample, but this resulted in no 'where' clause at all and my entire table being returned instead of the single row i wanted. is there something i'm missing, or recommended different approach? thanks much, - joe --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
