-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: UserType using Oracle's XMLType defaulting to CLOB for tests
PostPosted: Wed Jun 13, 2012 4:27 am 
Beginner
Beginner

Joined: Mon Jul 05, 2004 9:29 am
Posts: 38
Hi,

I would like to know if there's some way to abstract how a UserType is created based on some information pulled from SessionImplementor.

My usecase is the following: I would like to store some XML data in an Oracle's XMLType column in production but would like to fallback using CLOB for testing purposes (HSQL, H2).

To store the XML, I need 2 custom UserTypes (one using Oracle's XMLType and another one using CLOBS) but how would I tell Hibernate which one to use without changing anything in my configuration files (persistence.xml as I'm using hibernate-entitymanager) and mappings?

Maybe there's some way I'm not aware of that would let met instantiate the right UserType based on the SessionImplementor. Instead of specifying the UserType I want to use, it would be nice to specify a UserTypeFactory which would have a "UserType create(SessionImplementor)" method.

There could be another solution: SessionImplementor extends LobCreationContext, maybe there could be some sort of XMLCreationContext which would take care of storing XML.

Regards,

Xavier


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.