Thanks for your help. Here it is again. It's at the bottom. It has no
elements other than the extent-class for AccountImpl.

    <class-descriptor class="com.microremedies.pm.persist.AccountImpl"
table="ACCOUNT" proxy="dynamic">
        <field-descriptor name="uid" column="uid" jdbc-type="BIGINT"
primarykey="true" autoincrement="true"/>
        <field-descriptor name="name" column="name"  jdbc-type="VARCHAR"/>
        <field-descriptor name="parentAccountID" column="parentAccountID"
jdbc-type="INTEGER" access="anonymous"/>
        <field-descriptor name="ojbConcreteClass" column="ojbConcreteClass"
jdbc-type="VARCHAR"/>
        <reference-descriptor name="parentAccount"
class-ref="com.microremedies.pm.persist.Account">
            <foreignkey field-ref="parentAccountID"/>
        </reference-descriptor>
        <collection-descriptor name="subAccounts"
element-class-ref="com.microremedies.pm.persist.Account">
            <inverse-foreignkey field-ref="parentAccountID"/>
        </collection-descriptor>
    </class-descriptor>
    <class-descriptor class="com.microremedies.pm.persist.Account"
table="ACCOUNT">
        <extent-class class-ref="com.microremedies.pm.persist.AccountImpl"/>
    </class-descriptor>

I was able to make it work by pointing the collection-descriptor and
reference-descriptor to AccountImpl instead of Account like below. Of course
I have to cast to Account though.

    <class-descriptor class="com.microremedies.pm.persist.AccountImpl"
table="ACCOUNT" proxy="dynamic">
        <field-descriptor name="uid" column="uid" jdbc-type="BIGINT"
primarykey="true" autoincrement="true"/>
        <field-descriptor name="name" column="name"  jdbc-type="VARCHAR"/>
        <field-descriptor name="parentAccountID" column="parentAccountID"
jdbc-type="INTEGER" access="anonymous"/>
        <field-descriptor name="ojbConcreteClass" column="ojbConcreteClass"
jdbc-type="VARCHAR"/>
        <reference-descriptor name="parentAccount"
class-ref="com.microremedies.pm.persist.AccountImpl">
            <foreignkey field-ref="parentAccountID"/>
        </reference-descriptor>
        <collection-descriptor name="subAccounts"
element-class-ref="com.microremedies.pm.persist.AccountImpl">
            <inverse-foreignkey field-ref="parentAccountID"/>
        </collection-descriptor>
    </class-descriptor>
    <class-descriptor class="com.microremedies.pm.persist.Account"
table="ACCOUNT">
        <extent-class class-ref="com.microremedies.pm.persist.AccountImpl"/>
    </class-descriptor>

I was also able to make it work by removing the interface from the
repository altoghether like this:

    <class-descriptor class="com.microremedies.pm.persist.AccountImpl"
table="ACCOUNT" proxy="dynamic">
        <field-descriptor name="uid" column="uid" jdbc-type="BIGINT"
primarykey="true" autoincrement="true"/>
        <field-descriptor name="name" column="name"  jdbc-type="VARCHAR"/>
        <field-descriptor name="parentAccountID" column="parentAccountID"
jdbc-type="INTEGER" access="anonymous"/>
        <field-descriptor name="ojbConcreteClass" column="ojbConcreteClass"
jdbc-type="VARCHAR"/>
        <reference-descriptor name="parentAccount"
class-ref="com.microremedies.pm.persist.AccountImpl">
            <foreignkey field-ref="parentAccountID"/>
        </reference-descriptor>
        <collection-descriptor name="subAccounts"
element-class-ref="com.microremedies.pm.persist.AccountImpl">
            <inverse-foreignkey field-ref="parentAccountID"/>
        </collection-descriptor>
    </class-descriptor>

I was also surprised to find that the Interface doesn't even have to declare
any methods and it still works! Now that I've spent 4 hours making it work,
I'm wondering how it's supposed to work or what best practice others have
found. All of these methods seem to require my client code to use
AccountImpl in some places but Account in others. Is that right?

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 19, 2003 9:14 AM
> To: [EMAIL PROTECTED]
> Subject: RE: dynamic proxy problem
>
>
> Hello,
>
> > -----Original Message-----
> > From: Ken Brewer [mailto:[EMAIL PROTECTED]
>
> >     <class-descriptor class="com.microremedies.pm.persist.AccountImpl"
> > table="ACCOUNT" proxy="dynamic">
> >         <field-descriptor name="uid" column="uid" jdbc-type="BIGINT"
> > primarykey="true" autoincrement="true"/>
> >         <field-descriptor name="name" column="name"
> > jdbc-type="VARCHAR"/>
> >         <field-descriptor name="parentAccountID"
> > column="parentAccountID"
> > jdbc-type="INTEGER" access="anonymous"/>
> >         <field-descriptor name="ojbConcreteClass"
> > column="ojbConcreteClass"
> > jdbc-type="VARCHAR"/>
> >         <reference-descriptor name="parentAccount"
> > class-ref="com.microremedies.pm.persist.Account">
>
> Your repository-snippet does not show the
> class-descriptor for com.microremedies.pm.persist.Account.
> I suppose this is the interface that AccountImpl, and I bet
> its class-descriptor does not have any field-descriptors.
>
> You may try to fix it by including field-descriptors
> for your primary key field uid into that class-descriptor,
> or, otherwise, by changing class-ref to "...AccountImpl".
>
> Olli
>
> ---------------------------------------------------------------------
> 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]

Reply via email to