-->
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: No persister for: java.lang.Boolean...
PostPosted: Tue Dec 09, 2003 10:32 am 
Newbie

Joined: Wed Dec 03, 2003 8:34 am
Posts: 4
Hi !

I have a problem with mapping boolean...

I use hibernate 2.0.3 with postgres 7.2

When i do this

session.save(utilisateur);

i get this exception :
(that'is strange because there isn't any boolean in Utilisateur just in Document...)

INFO: Query language substitutions: {no='N', true=1, yes='Y', false=0}
net.sf.hibernate.MappingException: No persister for: java.lang.Boolean
at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:420)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2302)
at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2309)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1195)
at net.sf.hibernate.engine.Cascades$3.cascade(Cascades.java:88)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:258)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:341)
at net.sf.hibernate.impl.SessionImpl.doUpdate(SessionImpl.java:1299)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1206)
at net.sf.hibernate.engine.Cascades$3.cascade(Cascades.java:88)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:258)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:341)
at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:693)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:605)
at metier.TestMetier.main(TestMetier.java:24)

here is my hbm file

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

<hibernate-mapping default-cascade="save-update">

<class name="metier.AyantDroit" table="AYANTDROIT">
<id name="idAyantDroit" column="ayantDroit_id" type="int" unsaved-value="0">
<generator class="hilo"/>
</id>
<many-to-one name="groupe" class="metier.Groupe" column="groupe_id" />
<many-to-one name="utilisateur" class="metier.Utilisateur" column="utilisateur_id"/>
</class>

<class name="metier.Utilisateur" table="UTILISATEUR">
<id name="idUtilisateur" column="utilisateur_id" type="int" unsaved-value="0">
<generator class="hilo"/>
</id>
<property name="nom" type="string" not-null="false"/>
<property name="prenom" type="string" not-null="false"/>
<property name="password" type="string" not-null="false"/>
<property name="adresseMail" type="string" not-null="false"/>
<many-to-one name="ayantDroit" class="metier.AyantDroit" column="ayantDroit_id" />
</class>

<class name="metier.Groupe" table="GROUPE">
<id name="idGroupe" column="groupe_id" type="int" unsaved-value="0">
<generator class="hilo"/>
</id>
<property name="nom" type="string" not-null="false"/>
<property name="description" type="string" not-null="false"/>

<many-to-one name="ayantDroit" class="metier.AyantDroit" column="ayantDroit_id" />
<set name="utilisateurs" lazy="true" table="GROUPEUTILISATEURS">
<key column="groupe_id"/>
<many-to-many class="metier.Utilisateur" column="utilisateur_id"/>
</set>
</class>

<class name="metier.Document" table="DOCUMENT">
<id name="idDoc" column="doc_id" type="int" unsaved-value="0">
<generator class="hilo"/>
</id>
<property name="AValider" type="boolean" not-null="true"/>
<property name="versionne" type="boolean" not-null="true"/>
<property name="etat" type="int" not-null="true"/>
<property name="numVersion" type="string" not-null="false"/>
<property name="pathFichier" type="string" not-null="false"/>
<property name="nomFichier" type="string" not-null="false"/>
<property name="titre" type="string" not-null="true"/>
<property name="dateCreation" type="date" not-null="true"/>
<property name="emplacement" type="string" not-null="false"/>
<property name="resume" type="string" not-null="true"/>
<property name="type" type="string" not-null="false"/>
<property name="motsCles" type="string" not-null="false"/>
<property name="nomFichierSurDisque" type="string" not-null="false"/>
<property name="reference" type="string" not-null="false"/>
<property name="cheminDossier" type="string" not-null="false"/>

<many-to-one name="precedent" class="metier.Document" column="precedent_id"/>
<many-to-one name="proprietaire" class="metier.Utilisateur" column="prop_id"/>
<set name="ayantsDroit" lazy="true" table="GROUPEPUBLICATION">
<key column="doc_id"/>
<many-to-many class="metier.AyantDroit" column="ayantDroit_id"/>
</set>
</class>
</hibernate-mapping>

thanks for help

Pierre-Marin[b]undefined


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 09, 2003 12:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Document is saved because it's cascaded from Utilisateur
Code:
<hibernate-mapping default-cascade="save-update">

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 05, 2004 12:25 pm 
Beginner
Beginner

Joined: Fri Oct 24, 2003 10:45 am
Posts: 22
Emmanuel,

I have the same problem.... I understand why Document is saved but I don't understand why it can not find persister for Boolean....

Thanks!


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.