-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problème de limitation de String à 255 caractères
PostPosted: Tue Jun 05, 2007 12:03 pm 
Newbie

Joined: Thu Feb 15, 2007 11:50 am
Posts: 3
Hibernate version:
3.1

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="ui.forms.patchnotes">
<class name="PatchNoteBean" table="patch_notes">
<id name="id" type="int">
<column name="id" sql-type="integer" not-null="true"/>
<generator class="assigned"/>
</id>
<property name="version" column="versionNumber"/>
<property name="date"/>
<property name="content" type="java.lang.String">
<column name="description" not-null="false" length="500" sql-type="VARCHAR"/>
</property>
</class>
</hibernate-mapping>

Name and version of the database you are using:
Sybase 12.5.0.3

Code SQL de la table

CREATE TABLE dbo.patch_notes
(
id int DEFAULT 1 NOT NULL,
date datetime NOT NULL,
versionNumber varchar(20) NOT NULL,
description varchar(500) NOT NULL,
CONSTRAINT rca_accoun_1315315522
PRIMARY KEY NONCLUSTERED (id)
)

Problème
Quand je sauvegarde un objet de la classe PatchNoteBean avec un champ "content" de plus de 255 caractères, il est sauvegardé correctement en base. En revanche quand j'essaye de le récupérer via une requète par exemple, le champ "content" est limité à 255 caractères.

Je ne comprend pas pourquoi et je n'ai rien trouvé dans la doc à ce sujet.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 11, 2007 3:07 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Je ne connais pas Sybase, mais avec Oracle par exemple, il me semble que la différence entre varchar et varchar2 est justement la longueur de champs, limitée à 255 pour varchar. Ce ne serait pas la même chose avec Sybase ?

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


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