-->
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.  [ 4 posts ] 
Author Message
 Post subject: On retrieval the String is getting truncated to 255 chars
PostPosted: Wed May 10, 2006 7:37 pm 
Newbie

Joined: Wed May 10, 2006 7:24 pm
Posts: 3
help!

My databaes field is varchar(2048) in length. Everything work excepting when I retrieve. The value of the string is truncated to 255 characters though the value in the database is more than 255 characters.

Is there any particulare settings that I need to do to retrieve fields that have more than 255 characters.

I tried adding the length, sql-type attributes to the properties/column tags. Still get the 255 characters max. Not sure how to proceed.

Hibernate version:
Hibernate 2.x

Mapping documents:
<property name="description">
<column name="DESCRIPTION" />
</property>

Name and version of the database you are using:
Sybsae 12.5


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 9:07 pm 
Regular
Regular

Joined: Mon Aug 22, 2005 1:11 pm
Posts: 50
Location: Pasadena, CA
try:

<property name="description">
<column name="DESCRIPTION" />
<type="string"/>
</property>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 12:45 am 
Newbie

Joined: Wed May 10, 2006 7:24 pm
Posts: 3
I tried your suggetion in hibernate 3.1 and 2.x both complains of invalid syntax. Expectation is <type name="description"/>

Mikee805 wrote:
try:

<property name="description">
<column name="DESCRIPTION" />
<type="string"/>
</property>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 1:53 am 
Newbie

Joined: Wed May 10, 2006 7:24 pm
Posts: 3
All right, found the solution.

This is nothing to do with Hibernate. I am using sybsae jconnect5.5.jar and looks like by default the data returned is only 255 characters for a string. To fix this add the "?JCONNECT_VERSION=6" to the connection URL.

Example : jdbc:sybase:Tds:hostname:3105?JCONNECT_VERSION=6

This solved my issue.


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