-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to *not map* a UserType for different Persistence Unit?
PostPosted: Fri Feb 08, 2008 4:53 pm 
Beginner
Beginner

Joined: Fri Jan 26, 2007 3:16 pm
Posts: 24
Hi, I've mapped Oracle's spatial type as per the nice advice here: http://www.hibernate.org/402.html.

This seems to work great for Oracle Spatial, but I have a completely different persistence unit that I use for unit testing with HSQL-DB, which obviously is not going to support the special UserType.

I'm using JPA annotations, and the field in particular looks like this:

Code:
    /** Maps to SDO_GEOM in oracle spatial database */
    @org.hibernate.annotations.Type(type = "JGeometryType")
    @Column(name = "GEOM", nullable = false, updatable = false)
    private final JGeometry geom;


My question is: is there some way to *not map* this or map the type differently (as VARBINARY) for the HSQL-DB persistence unit?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 09, 2008 7:46 am 
Beginner
Beginner

Joined: Thu Jun 07, 2007 2:38 am
Posts: 28
Location: Italy, Rome
You use annotations to map. If you want to be more flexible you can use Hibernate xml mapping files.

What could work might be to duplicate your mapping from annotations in xml files, setup a configuration which only use mapping files.


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

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.