-->
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: Can SybaseAnywhere dialect map text to LONGVARCHAR
PostPosted: Mon Mar 27, 2006 2:52 pm 
Beginner
Beginner

Joined: Fri Oct 15, 2004 4:54 pm
Posts: 32
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.3

Name and version of the database you are using: Sybase SQLAnywhere 9 and Oracle 9

SybaseAnywhere does not support java.sql.Types.CLOB. attempts to use this will throw an exception in both sybase-supported jdbc drivers. instead it wants to use java.sql.LONGVARCHAR

i need to support both oracle and SybaseAnywhere dialects. so i'd like to have the SybaseAnywhere dialect map hibernate type 'text' to java.sql.Types.LONGVARCHAR, vice java.sql.Types.CLOB, which is what oracle (and most every other database) wants.

if i go into org.hibernate.types.TextType and change getSqlType() to return java.sql.Types.LONGVARCHAR, sybaseAnywhere is happy and saves the data. but then i have a sybaseAnywhere-specific TextType, no good.

i can see lots of maps in Dialect and TypeNames and TypeFactory, but i can't grok which pieces consult which other pieces when trying to map a hibernate type to a java.sql.Types type (in my case, "text" to LONGVARCHAR, if i haven't said it enough already). i just can't follow the link from the things i think i can set in the dialect:
registerColumnType( java.sql.Types, "hibType" );
registerHibernateType( java.sql.Types, "hibType" );
into getting TextType to map to Types.LONGVARCHAR for this one dialect. i don't see a LongvarcharType either, but i could certainly have one that extended TextType and only overrode the one method. oh yeah. but i'd still have trouble finding the link between the dialect and linking 'text' to this new type.


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.