Adrian Sampaleanu wrote:
I'm trying to use the latest 1.3 snapshot from CVS and attempting to use
the @hibernate.key tag (I'd like to follow the depracation warnings and
move away from the @hibernate.collection-* tags). I want to specify
additional column details with a @hibernate.column tag, but that
generates a mapping file where all elements of the mapping have an inner
column element with the name "WORK_ITEM_ID".

This is the javadoc:

    /**
     * @hibernate.list table="DEPENDENTS"
     *                 cascade="save-update"
     *                 lazy="true"
     * @hibernate.key column="WORK_ITEM_ID"
     * @hibernate.column name="WORK_ITEM_ID"
     *                   length="32"
     * @hibernate.index column="LIST_INDEX"
     * @hibernate.many-to-many
class="com.tirawireless.common.model.work.AbstractWorkItem"
     *                         column="DEPENDENT_WORKITEM_ID"
     */

and this is the generated output mapping:

<list name="dependentsInternal" table="DEPENDENTS" lazy="true"
        cascade="save-update">

        <key column="WORK_ITEM_ID">
                <column name="WORK_ITEM_ID" length="32" />
        </key>

        <index column="LIST_INDEX">
                <column name="WORK_ITEM_ID" length="32" />
        </index>

        <many-to-many
        
class="com.tirawireless.common.model.work.AbstractWorkItem"
                column="DEPENDENT_WORKITEM_ID">
                <column name="WORK_ITEM_ID" length="32" />
        </many-to-many>
</list>

Is this a known issue? In the documentation generated from the snapshot,
the @hibernate.key column attribute says this: "The name of the foreign
key column. This may also be specified by nested @hibernate.column
tag(s)". What exactly does "nested" hibernate.column mean? How should I
specify some column specifics for just one column?


Adrian, I've committed a fix that may work for you, if you grab the latest CVS snapshot. I'm not sure what exactly you're trying to generate, but here's an example that should generate the column element only within the key:

    /**
     * @hibernate.list table="DEPENDENTS"
     *                 cascade="save-update"
     *                 lazy="true"
     * @hibernate.key column="WORK_ITEM_ID"
     *                element-id="workItemKey"
     * @hibernate.column name="WORK_ITEM_ID"
     *                   length="32"
     *                   parent-element="workItemKey"
     * @hibernate.index column="LIST_INDEX"
     * @hibernate.many-to-many
class="com.tirawireless.common.model.work.AbstractWorkItem"
     *                         column="DEPENDENT_WORKITEM_ID"
     */

The two important additions are the "element-id" and "parent-element" attributes.

Paul



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
xdoclet-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to