Skip to main content

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

Hi Sabine,

Having the object type converter defined within the basic is ok and you need only add the convert to plug the convert into the mapping, e.g.

            <basic name="gender">
                <convert>gender</convert>

                <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>

Cheers,
Guy

On 18/04/2013 6:26 PM, Heider, Sabine wrote:

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

 



_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

--

Oracle
Guy Pelletier

ORACLE Canada, 45 O'Connor Street Suite 400 Ottawa, Ontario Canada K1P 1A4

Green
            Oracle Oracle is committed to developing practices and products that help protect the environment


Back to the top