-->
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: Unknown entity class
PostPosted: Sun Sep 02, 2007 4:07 pm 
Newbie

Joined: Thu May 25, 2006 4:22 pm
Posts: 9
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 1.2.0

Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="PPEA.Donnees.Groupe, PPEA.Donnees" table="groupes">
<id name="ID" column="id" type="int" unsaved-value="0" >
<generator class="identity"/>
</id>
<property name="Nom" column="nom" type="String" length="255"/>
<property name="Description" column="description" type="String" length="510"/>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
ITransaction transaction = session.BeginTransaction();

PPEA.Donnees.Groupe obj = new PPEA.Donnees.Groupe(" TEST !");
obj.Description = "Description";

session.Save(obj);

transaction.Commit();

Full stack trace of any exception that occurs:
Unhandled Exception: NHibernate.MappingException: Unknown entity class: PPEA.Donnees.Groupe
at NHibernate.Impl.SessionFactoryImpl.GetEntityPersister (System.Type theClass) [0x00000]
at NHibernate.Impl.SessionImpl.GetClassPersister (System.Type theClass) [0x00000]
at NHibernate.Impl.SessionImpl.GetEntityPersister (System.Object obj) [0x00000]
at NHibernate.Impl.SessionImpl.SaveWithGeneratedIdentifier (System.Object obj, NHibernate.Engine.CascadingAction action, System.Object anything) [0x00000]
at NHibernate.Impl.SessionImpl.Save (System.Object obj) [0x00000]
at Apprendre.MainClass.NHibernate () [0x00049] in /donnees/Documents/Projets/MonoDevelop/Apprendre/Apprendre/Apprendre/Main.cs:79
at Apprendre.MainClass.Main (System.String[] args) [0x000d6] in /donnees/Documents/Projets/MonoDevelop/Apprendre/Apprendre/Apprendre/Main.cs:56

Name and version of the database you are using:
SQLite 3

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I think everything is above ... For info, I'm using Mono 1.2.5.

I've check the content of my assembly ; PPEA.Donnees and I find the class PPEA.Donnees.Groupe ...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 03, 2007 3:48 am 
Newbie

Joined: Thu Jul 05, 2007 9:44 am
Posts: 4
Hallo

Malheureusement je parle pas bien le francais, et ecrire c'est encore plus difficile..

Ton Erreur c'est parce-que hibernate ne sait rien de ton mapping..
J'avait le mème probleme avec nhibernate 1.2 (asp.net VS2005).

J ai vu que j'ai pas deploy le xml-mapping-file qui dis, quelle class est mapped sur laquelle table en database..

En Visual-Studio 2005 je peut dire au configuration de l mapping-xml (en allemand): "Eingebettete Ressource" et "Kopieren wenn neuer"..

HTH

Salutations de Suisse


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 03, 2007 4:28 am 
Newbie

Joined: Thu May 25, 2006 4:22 pm
Posts: 9
Merci !
Votre français est très bon !
Effectivement, c'était bien cela.

Maintenant, j'ai un souci de fichier de mapping :)
Step by step !


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.