Title: Incorrect functionality when mapping @hibernate.component

Hi,

Consider following scenario:

Class A {

       

        /**

         * @hibernate.component prefix="ClassB_"

         */

        B getB()

}

Class B {

        /**

         * @hibernate.component prefix="ClassC_"

         */

        C getC()       

        /**

         * @hibernate.property

         * @hibernate.column name = "property"

         */

        P getAnyProperty()

}

Class C {

        /**

         * @hibernate.property

         * @hibernate.column name = "property"

         */

        P getAnyProperty()     

}

In that case mapping file contents have to be:

    ...

    <component name="b">

        <component name="c">           

        <property name="anyProperty">

               <column name="ClassB_ClassC_anyProperty"/>

        </property>       

        </component>

       

        <property name="anyProperty">

            <column name="ClassB_anyProperty"/>

        </property>       

    </component>

    …

But in fact it is:

    ...

    <component name="b">

        <component name="c">           

        <property name="anyProperty">

               <column name="ClassC_anyProperty"/>

        </property>       

        </component>

       

        <property name="anyProperty">

            <column name="anyProperty"/>

        </property>       

    </component>

    …

I think that the problem is that when inner (2-ond level) component is generated, it overrides previous prefix setting, instead of concatenating.

Thanks a lot!

Michael.

Reply via email to