-->
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 with multiple possible SQL Types
PostPosted: Wed Dec 16, 2015 9:30 am 
Newbie

Joined: Wed Dec 16, 2015 8:09 am
Posts: 14
I'm writing a UserType that can possibly support multiple JDBC types. The types supported depend on the version of the JDBC driver the application uses. If the driver version is <= JDBC 4.1 then a custom vendor type is used. If the driver version is >= JDBC 4.2 a standard type is used.

My code currently looks like this:
Code:
  public int[] sqlTypes() {
    return new int []{Types.FOO, VendorTypes.FOO};
  }


This doesn't work because Hibernate then expects two columns. If possible I'd like to avoid having to write a UserType for every driver version. Is there a better way to do this?


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.