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.