Skip to main content

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

Yes, this is correct.  Also ensure you use the Oracle9Platform (probably
default for your driver).  We don't currently have an annotation for the
XMLTypeMapping, you may wish to log a bug for that.


Magnus Heino wrote:
> 
> 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
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Oracle-XMLType%2C-JPA-and-EclipseLink-tp19569909p19607812.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top