-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I tryed to use xd2 (plugins ver 1.0.2) hibernate plugin to map a deep
inheritance hirarchy with the union subclass strategy and recognized a bug.

Only the immediate children classes are mapped as union-subclass, the
children of the mapped child are not mapped.

Below you can find the fix for this bug.

Replace the file UnionSubclass.jelly in
src/plugin-hibernate/src/main/java/org/xdoclet/plugin/hibernate
directory with the attached file.


Kind regards,
M.Jerger
- --
Informatikbüro Jerger http://www.jerger.org
Fuchshaldeweg 15, D-72766 Reutlingen

fon: +49-7121-578913 mob: +49-178-8189878
- --
Vorstand von SENS e.V. http://www.SoftwareExperts.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDmsUIGizPrwyMK7YRAov8AKC1IWneBceR7T3UqRSJyTQmzsmcNgCfZ0gk
Sn/irBUJ7B3gEITKKnbmlbU=
=tkYs
-----END PGP SIGNATURE-----
<?xml version="1.0" encoding="UTF-8"?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml">
    <j:set var="class" value="${unionSubclass}"/>
    <j:set var="unionSubclassTag" value="${class.getTagByName('hibernate.union-subclass')}"/>

    <union-subclass name="${plugin.getFirstNonEmptyValue(unionSubclassTag.name_, class.fullyQualifiedName)}"
        entity-name="${unionSubclassTag.entityName}"
        proxy="${unionSubclassTag.proxy}"
        table="${unionSubclassTag.table}"
        schema="${unionSubclassTag.schema}"
        catalog="${unionSubclassTag.catalog}"
        subselect="${unionSubclassTag.subselect}"
        dynamic-update="${unionSubclassTag.dynamicUpdate}"
        dynamic-insert="${unionSubclassTag.dynamicInsert}"
        select-before-update="${unionSubclassTag.selectBeforeUpdate}"
        extends="${unionSubclassTag.extends}"
        lazy="${unionSubclassTag.lazy}"
        abstract="${unionSubclassTag.abstract}"
        persister="${unionSubclassTag.persister}"
        check="${unionSubclassTag.check}"
        batch-size="${unionSubclassTag.batchSize}"
        node="${unionSubclassTag.node}">

        <!-- process meta elements on class level -->
        <j:forEach var="metaTag" items="${class.getTagsByName('hibernate.meta')}">
            <j:import uri="/Meta.jelly" inherit="true"/>
        </j:forEach>
    
        <!-- process properties -->
        <j:forEach var="property" items="${plugin.getSubclassProperties(class)}">
            <j:import uri="/HibernateProperties.jelly" inherit="true"/>
        </j:forEach>
   
        <!-- union subclasses  -->
        <j:forEach var="unionSubclass" items="${plugin.getSubclasses(class,'hibernate.union-subclass')}">
            <j:import uri="/UnionSubclass.jelly" inherit="true"/>
        </j:forEach>

        <!-- process subselect -->
        <j:set var="subselectTag" value="${class.getTagByName('hibernate.subselect')}"/>
        <j:if test="${subselectTag != null}">
            <j:import uri="/Subselect.jelly" inherit="true"/>
        </j:if>

        <!-- process synchronize -->
        <j:forEach var="synchronizeTag" items="${class.getTagsByName('hibernate.synchronize')}">
            <j:import uri="/Synchronize.jelly" inherit="true"/>
        </j:forEach>

        <!-- process comment -->
        <j:if test="${unionSubclassTag.comment != null}">
            <comment>${unionSubclassTag.comment}</comment>
        </j:if>

        <!-- process loader -->
        <j:set var="loaderTag" value="${class.getTagByName('hibernate.loader')}"/>
        <j:if test="${loaderTag != null}">
            <j:import uri="/Loader.jelly" inherit="true"/>
        </j:if>

        <j:set var="sqlOperationEntity" value="${class}"/>
        <j:import uri="/SqlOperations.jelly" inherit="true"/>

        <j:import uri="/SqlDeleteAll.jelly" inherit="true"/>
    </union-subclass>
</j:jelly>

Reply via email to