> -----Original Message-----
> From: BURT, RANDALL (CONTRACTOR) [mailto:[EMAIL PROTECTED] 
>
> You would need to add one more field-descriptor for the 
> parentId field like so:
> 
> <field-descriptor id="3" name="parentId" column="parentId" 
> jdbc-type="INTEGER"/>

ah, an oversight on my part ...  makes sense.  Anonymous field would
save me the trouble of writing parentId accessors? (not that that's a
big deal)

> 
> > I'm not entirely sure what the inverse-foreignkey element means.
> 
> The inverse-foreignkey element tells OJB the property(s) of 
> the element-class-ref that "points" to elements of this class.

Ok, so here's what I have now:


<class-descriptor
    class="business.Category"
    table="categories"
 
sequence-manager="org.apache.ojb.broker.util.sequence.SequenceManagerNex
tValImpl"
    >

    <field-descriptor id="1"
        name="id"
        column="categoryId"
        jdbc-type="INTEGER"
        primarykey="true"
        autoincrement="true"
        />
    <field-descriptor id="2"
        name="name"
        column="NAME"
        jdbc-type="VARCHAR"
        />

    <field-descriptor id="3"
        name="parentId"
        column="parentId"
        jdbc-type="INTEGER"/>

    <reference-descriptor
        name="parent"
        class-ref="business.Category">
            <foreignkey field-ref="parentId"/>
    </reference-descriptor>

    <collection-descriptor
        name="subCategories"
        element-class-ref="business.Category"
        auto-delete="true"
        >
        <inverse-foreignkey field-ref="parentId"/>
    </collection-descriptor>

</class-descriptor>

Wondering if this is right ... it's untested until I figure out how to
test it :)

Thanks,

Dave





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

Reply via email to