users@glassfish.java.net

Re: JPA and XMLType

From: <glassfish_at_javadesktop.org>
Date: Wed, 09 May 2007 18:12:14 PDT

Toplink Essentials does not support XMLType directly. I have had some limited success using Toplink session customizers and a Converter. I never got it working because there does not seem to be any way to get the Connection object from a Toplink Session object. You need a connection object to create the XMLType.

Note: Our entity classes use strings and I attempt to convert these to and from XMLType in the converter..

My previous thread on this topic can be found at http://forums.java.net/jive/thread.jspa?messageID=183102

If you want I can post some of the customizer/converter code but I think it is not really possible with Toplink the way it is currently is. You can vote on an issue to include support as a feature request: https://glassfish.dev.java.net/issues/show_bug.cgi?id=1719

You can work around the problem by creating a view that gets the clobval() of your xmltype column and then mapping your persistent entites to the view.

Cheers
Cameron
[Message sent by forum member 'cameronr' (cameronr)]

http://forums.java.net/jive/thread.jspa?messageID=216245