Hello,

I couldn't find my specific question in the archives, so I am posting it 
here.  Please CC any reply as I am not subscribed.  I am using ojb-rc6 
with a postgreSQL database.

I have an object hierarchy implemented which uses the 
"one-table-per-class" approach along with join tables for collections.  
Everything works great, but after enabling dynamic proxies on the 
collections I am unable to identify the different class instances in the 
collection once they are loaded from the DB.

Example: Say I have three classes, Foo, Bar, and Baz.  The inheritance is 
such that Foo <- Bar <- Baz.  Now, I create an object with contains a 
collection of "Foo" objects which are populated by a mix of Foo, Bar and 
Baz objects.  This object is then serialize to the DB.

Here is an outline of how the mapping is structured:

<class-descriptor class="Foo" table="foo">
  <extent-class class-ref="Bar" />
  <extent-class class-ref="Baz" />
</class-descriptor>

<class-descriptor class="Bar" table="bar" />
  <extent-class class-ref="Baz" />
</class-descriptor>

<class-descriptor class="Baz" table="baz" />

<class-descriptor class="MyObject" table="myobj">
  <collection-descriptor  name = "foos"
           element-class-ref = "Foo"
           proxy             = "true"
           auto-retrieve     = "true"
           indirection-table = "myobj_foos"
  >
    <fk-pointing-to-this-class    column = "myobj_id"/>
    <fk-pointing-to-element-class column = "foo_id"/>
  </collection-descriptor>
</class-descriptor>

Now, if I load the saved object, the dynamic proxy object are all created 
as proxies to an object of type "Foo".  I can no longer reflect of the 
loaded data or use "instanceof" to identify objects.

So my question is: How can I get at the underlying object type using 
dynamic proxies?  Is there a standard way to deal with this case?

To be clear, everything works fine without using dynamic proxies.

Thank you in advnace,
-Lucas Scharenbroich


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to