-->
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: Oracle / chaine de caractere de longueur > 4000 / pb
PostPosted: Thu Apr 19, 2007 9:25 am 
Newbie

Joined: Fri Jan 05, 2007 12:21 pm
Posts: 9
Bonjour,
je dois stocker dans une colonne d'une table une String java d'un objet,
parfois cette string dépasse 4000 caractères et donc un mapping sur une colonne VARCHAR2 n'est plus possible.

Sur quoi mapper facilement cet attribut svp ? (je suis pas un pro d'oracle)

a+
Antoine


Top
 Profile  
 
 Post subject: Re: Oracle / chaine de caractere de longueur > 4000 / pb
PostPosted: Fri Apr 20, 2007 5:57 am 
Newbie

Joined: Sun Apr 15, 2007 2:29 pm
Posts: 7
Location: Montpellier
antoine.magnier wrote:
Sur quoi mapper facilement cet attribut svp ? (je suis pas un pro d'oracle)


Salut,

Il me semble que c'est plus une question Oracle. Lis l'article suivant, il te donnera peut-être des idées :

http://helyos.developpez.com/lob/#L1.1

Sylvain


Top
 Profile  
 
 Post subject: re
PostPosted: Fri Apr 20, 2007 10:33 am 
Newbie

Joined: Fri Jan 05, 2007 12:21 pm
Posts: 9
Bonjour,
j'ai trouvé tout seul la réponse au problème donc je vous la soumet au cas où des gens tombent dessus à nouveau.

Solution :

- maj hibernate (pas 100% que ce soit nécessaire mais il y a eu pas mal de fuites mémoires recement corrigées)
- maj du driver jdbc Oracle (très important) car ils ont debugué le support des standard jdbc au niveau de la gestion des CLOBs (or c'est ce qu'uilise hibernate ...)
- ajouter type="text" dans le mapping hibernate au niveau de l'attribut string qu'on doit mapper sur la colonne CLOB

(symptôme de la défaillance des versions précedentes du driver Oracle JDBC, si la String depassait 4000 caracteres l'insert ne passait pas)

Code:
<?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="cs.chequerose.beans">
   <class name="FeedbackLetter" table="FEEDBACKLETTER">
      <id name="id" column="IDFEEDBACKLETTER">
         <generator class="increment"/>
       <property column="ID_COMPTE" name="idCompte"/>
       <property column="IMMATNO" name="immatNo"/>
    <property column="LETTER_CONTENT" name="letterContent"  type="text"/
       <property column="LETTER_DATE" name="date"/>
       <property column="USERNAME" name="username"/>
     </class>
</hibernate-mapping>

voir property LETTER_CONTENT


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.