-->
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.  [ 3 posts ] 
Author Message
 Post subject: Problem when binding Sybase text data type
PostPosted: Tue Mar 02, 2010 7:10 am 
Beginner
Beginner

Joined: Mon Mar 01, 2010 12:24 pm
Posts: 22
Hi everyone,

I saw in topic https://forum.hibernate.org/viewtopic.php?f=1&t=964454&start=0 that text data type of Sybase cannot be null. The workaround is to set to empty the value. But in my case, I really need to use null values. So is it possible to change text type to another one without changing hibernate mapping but by modifying at runtime the hibernate configuration object? I tried with binary field but I still gets the "JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 2005" exception.
Code:
Iterator<Table> tables = (Iterator<Table>) config.getTableMappings();
while (tables.hasNext()) {
   Table table = tables.next();
   Iterator<Column> columns = table.getColumnIterator();
   while (columns.hasNext()) {
      Column column = columns.next();
      Value value = column.getValue();
      if (value.getType().getClass().getName().equals(TextType.class.getName())) {
         column.setSqlType("IMAGE");
       }
   }
}

Has anyone an idea?
Note: I cannot change my hibernate version (3.2.6ga)

Regards,
Matthieu


Top
 Profile  
 
 Post subject: Re: Problem when binding Sybase text data type
PostPosted: Wed Mar 31, 2010 9:37 am 
Beginner
Beginner

Joined: Mon Mar 01, 2010 12:24 pm
Posts: 22
Anybody has an idea to avoid this following exception?
JZ006: Caught IOException: java.io.IOException: JZ0SL: Unsupported SQL type 2005" exception


Top
 Profile  
 
 Post subject: Re: Problem when binding Sybase text data type
PostPosted: Thu Jun 10, 2010 11:12 am 
Newbie

Joined: Thu Feb 12, 2009 12:44 pm
Posts: 4
Hi,

Can't you use an empty text as "null" value ? Or some special value (eg '<null /l>') ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.