-->
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 Exception - Why ????
PostPosted: Thu Nov 17, 2005 4:19 pm 
My hbm xml files are in the project librarie called Domain. In the hibernate.cfg.xml file I specify <mapping assembly="Domain" />

when I do a EmployeeDAO.get(typeof(Employee), 7)

I get Unknown Enityt class Domain.Employee

here is the debug output of Hibernate

------------------------------------------------

2005-11-17 15:02:36,927 [1980] DEBUG NHibernate.Cfg.Environment - no hibernate settings in app.config/web.config were found
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - connection.provider=NHibernate.Connection.DriverConnectionProvider
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - connection.driver_class=NHibernate.Driver.SqlClientDriver
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - connection.connection_string=Server=Northwind;initial catalog=Northwind;User ID=superuser;Password=qweqwe;
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - show_sql=true
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - dialect=NHibernate.Dialect.MsSql2000Dialect
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - use_outer_join=true
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - query.substitutions=true 1, false 0, yes 'Y', no 'N'
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - HBSpringSessionFactory<-Domain
2005-11-17 15:02:38,099 [1980] INFO NHibernate.Cfg.Configuration - searching for mapped documents in assembly: Domain
2005-11-17 15:02:38,099 [1980] INFO NHibernate.Cfg.Configuration - Configured SessionFactory: HBSpringSessionFactory
2005-11-17 15:02:38,099 [1980] DEBUG NHibernate.Cfg.Configuration - properties: System.Collections.Hashtable
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.Configuration - processing one-to-many association mappings
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.Configuration - processing one-to-one association property references
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.Configuration - processing foreign key constraints
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Dialect.Dialect - Using dialect: NHibernate.Dialect.MsSql2000Dialect
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.SettingsFactory - use outer join fetching: True
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Connection.ConnectionProviderFactory - Intitializing connection provider: NHibernate.Connection.DriverConnectionProvider
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Connection.ConnectionProvider - Configuring ConnectionProvider
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.SettingsFactory - Optimize cache for minimal puts: False
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.SettingsFactory - echoing all SQL to stdout
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.SettingsFactory - Query language substitutions: {yes='Y', true=1, no='N', false=0}
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.SettingsFactory - cache provider: NHibernate.Cache.HashtableCacheProvider
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Cfg.Configuration - instantiating and configuring caches
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Impl.SessionFactoryImpl - building session factory
2005-11-17 15:02:39,068 [1980] DEBUG NHibernate.Impl.SessionFactoryImpl - instantiating session factory with properties: {show_sql=true, connection.provider=NHibernate.Connection.DriverConnectionProvider, dialect=NHibernate.Dialect.MsSql2000Dialect, connection.driver_class=NHibernate.Driver.SqlClientDriver, hibernate.session_factory_name=HBSpringSessionFactory, hibernate.use_outer_join=true, hibernate.connection.connection_string=Server=Northwind;initial catalog=Northwind;User ID=superuser;Password=qweqwe;, hibernate.connection.driver_class=NHibernate.Driver.SqlClientDriver, query.substitutions=true 1, false 0, yes 'Y', no 'N', connection.connection_string=Server=Northwind;initial catalog=Northwind;User ID=superuser;Password=qweqwe;, hibernate.connection.provider=NHibernate.Connection.DriverConnectionProvider, hibernate.dialect=NHibernate.Dialect.MsSql2000Dialect, use_outer_join=true, hibernate.show_sql=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'}
2005-11-17 15:02:39,068 [1980] DEBUG NHibernate.Impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory
2005-11-17 15:02:39,068 [1980] DEBUG NHibernate.Impl.SessionFactoryObjectFactory - registered: f9fed28cfab64567ae5a28dacd4cb361(HBSpringSessionFactory)
2005-11-17 15:02:39,068 [1980] INFO NHibernate.Impl.SessionFactoryObjectFactory - Factory name:HBSpringSessionFactory
2005-11-17 15:02:39,068 [1980] DEBUG NHibernate.Impl.SessionFactoryImpl - Instantiated session factory

-----------------------------------------------

Anyone knows if my Nhibernate has actually read my mapping files. :?: :(


Top
  
 
 Post subject:
PostPosted: Fri Nov 18, 2005 11:52 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You should read the mapping found after:
INFO NHibernate.Cfg.Configuration - searching for mapped documents in assembly: Domain

So it looks like your assembly doesn't contain any hbm.xml files.
Make sure that you set "Embedded Resource" on them in the Visual Studio project...

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 18, 2005 12:07 pm 
Thanks Pixel thats waht it was.


Top
  
 
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.