Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Re: Oracle XMLType, JPA and EclipseLink


I added xdb.jar and xmlparserv2.jar to my classpath, and added a @Customizer to do this:

public class XmlDataCustomizer implements DescriptorCustomizer {

    public void customize(final ClassDescriptor descriptor) throws Exception {
        descriptor.removeMappingForAttributeName("xmlData");
        DirectToXMLTypeMapping mapping = new DirectToXMLTypeMapping();
        mapping.setAttributeName("xmlData");
        mapping.setFieldName("XMLDATA");
        descriptor.addMapping(mapping);
    }
}

And it all works.

Is this the recommended thing to do?

/Magnus Heino


On Fri, Sep 19, 2008 at 12:31 PM, Magnus Heino <magnus@xxxxxxxxx> wrote:

Hi.

Is there any magic that needs to be in place to have Oracle XMLType working with EclipseLink 1.0.1 and JPA?

My db column is defined as

XMLDATA XMLTYPE null

My mapping looks like:

@Column(columnDefinition = "XMLTYPE")
private String xmlData;

Everything works just as expected, is the size of xmlData is < 4k. Then i get ORA-01461. I guess its the String that makes it hit some varchar limit somewhere somehow? How can I make this work?

Thanks!

/Magnus Heino


Back to the top