-->
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: persiters Problem
PostPosted: Fri May 27, 2005 3:28 am 
Hello,
To select a row from the database i'm using the following program :

Code:
using System;
using NHibernate;
using NHibernate.Cfg;

namespace NHibernateTest
{
   
   public class Insertion
   {
      public static void Main(string[] args)
      {
      
         try
         {
               
            Configuration cfg = new Configuration();
            
            //cfg.AddXmlFile("Equipement.hbm.xml");
            cfg.AddAssembly("NHibernateTest");
            
            ISessionFactory factory = cfg.BuildSessionFactory();
            ISession session = factory.OpenSession();
            

            Equipement equipement = (Equipement)session.Load(typeof(Equipement), "Internet-1");
            session.Flush ();

            System.Collections.IList EquipList = session.CreateCriteria(typeof(Equipement)).List();
            foreach(Equipement equipement1 in EquipList)
            {
               System.Diagnostics.Debug.WriteLine(equipement1.Id + " name is " + equipement.Nom);
            }

            session.Close();
         }
         catch (System.Exception ex) { Console.WriteLine(ex.Message); }
      }
   }
}


And i get the following error

Code:
No persisters for: NHibernateTest.Equipement


Does any one see the problem ??

Thanks
Code:
Code:


Top
  
 
 Post subject:
PostPosted: Fri May 27, 2005 7:01 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This is usually caused by a typo in your mapping files, for example "Equipement" vs "Equipment".


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 27, 2005 10:39 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Make sure that your "Equipement.hbm.xml" file is an "Embedded Resource" (in VS.NET file properties)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.