Hello everybody, I just installed the new 1.0.3
version of the plugins and noticed what seems to be a
problem, to me. All of a sudden it seems that the
hibernate plugin generates a wrong access attribute
(not requested) for ids and properties. E.g.:
/*
 * @hibernate.class table="CORRECTION"
 * @hibernate.discriminator column="TYPE"
 */
public abstract class OrderCorrectionSupport {
    /**
     * @hibernate.id generator-class="sequence"
     * @hibernate.generator-param name="sequence"
value="ORDER_CORRECTION_SEQ"
     */
    protected Long getId() {
        return id;
    }
    /**
     * @return The object that originated this
correction.
     * @hibernate.property column="RULE_ID"
     */
    public Rule getRule() {
        return rule;
    }
etc.etc.

just generated:
<hibernate-mapping>
  <class table="CORRECTION"
name="it.esselunga.ecommerce.services.promo.ordercorrection.OrderCorrectionSupport">
    <id access="method" name="id"><generator
class="sequence">
        <param
name="sequence">ORDER_CORRECTION_SEQ</param>
      </generator>
    </id>
    <discriminator column="TYPE"/>
    <property name="rule" access="method"
column="RULE_ID"/>
etc.etc.

This seems to be wrong, as the hibernate doc states
that the valid values for the access property are
"property" and "field" (I'm on Hibernate 2). In fact
Hibernate explodes upon startup:
net.sf.hibernate.MappingException: could not find
PropertyAccessor class: method

Needless to say, this thing worked as expected in
1.0.2. Am I doing something wrong or could it be a
bug? I'm calling xdoclet with the following:
    <property name="xdoclet.includes"
value="define-me!"/>
    <target name="xdoclet.hibernate"
description="creates hibernate hbm files starting from
java sources in the ${xdoclet.source} dir">
       <path id="xdoclet.task.classpath">
           <fileset dir="${dir.lib.xdoclet}"
includes="*.jar"/>
       </path>

       <taskdef name="xdoclet"
classname="org.xdoclet.ant.XDocletTask"
classpathref="xdoclet.task.classpath" />

       <xdoclet>
           <fileset dir="${xdoclet.source}"
includes="${xdoclet.includes}"/>
           <component
classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
destdir="${dir.src.common.hbm}" />
       </xdoclet>
   </target>

Thanks,
Davide Baroncelli.

Reply via email to