Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] JPA test issue: object-type-converter orm mapping

Hi,

 

I had a look into the JPA tests org.eclipse.persistence.testing.tests.jpa.xml.advanced.EntityMappingsMultitenantJUnitTestCase.testCreateMafiaFamily* which fail on Sybase ASE.

It turned out that the mapping contained an ObjectTypeConverter for the Gender enum, which doesn’t work.

 

I wonder, though, whether the XML mapping file (eclipselink-xml-only-model/advanced-multitenant-entity-mappings.xml) is actually correct. This is the relevant section:

 

    <entity name="XMLMafioso" class="Mafioso">

        (...)

        <attributes>

            (...)

            <basic name="gender">

                <object-type-converter name="gender" data-type="String" object-type="Mafioso$Gender">

                    <conversion-value data-value="F" object-value="Female"/>

                    <conversion-value data-value="M" object-value="Male"/>

                </object-type-converter>

            </basic>

            (...)

        </attributes>

    </entity>

 

Is this a correct mapping? Or should it rather be:

 

    <object-type-converter name="gender" data-type="String" object-type="Mafioso$Gender">

        <conversion-value data-value="F" object-value="Female"/>

        <conversion-value data-value="M" object-value="Male"/>

    </object-type-converter>

 

    <entity name="XMLMafioso" class="Mafioso">

        (...)

        <attributes>

            (...)

            <basic name="gender">

                <convert>gender</convert>

            </basic>

            (...)

        </attributes>

    </entity>

 

? This is what I find in the documentation. With this mapping the test passes.

 

Should I simply change the mapping in the test to use the second option, or is the first mapping correct and there is rather an issue in the runtime?

 

Thanks and best regards,

Sabine

 

Sabine Heider

SAP AG I Dietmar-Hopp-Allee 16 I 69190 Walldorf I Germany

 

Pflichtangaben/Mandatory Disclosure Statements:

http://www.sap.com/company/legal/impressum.epx

 

Attachment: advanced-multitenant-entity-mappings.xml
Description: advanced-multitenant-entity-mappings.xml


Back to the top