Home > no persister > no persister for fluent nhibernate error

No Persister For Fluent Nhibernate Error

here for a quick overview of the site Help Center Detailed answers to any no persister for nhibernate c# questions you might have Meta Discuss the workings and policies of fluent nhibernate no persister for entity this site About Us Learn more about Stack Overflow the company Business Learn more about hiring no persister for nhibernate mapping by code developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up no persister for: Fluent nHibernate Exception up vote 3 down vote favorite i m getting the exception "No persister for: MVCTemplate.Common.Entities.User" . I Google this issue and apply all the solution i found. but all are useless for me. Does anyone know what i m doing wrong ? my User Class code is public class User { public virtual Guid UserID { get; private set; } public virtual string UserName { get; set; } public virtual string Password { get; set; } public virtual string FullName { get; set; } public virtual string Email { get; set; } public virtual TimeSpan LastLogin { get; set; } public virtual bool IsActive { get; set; } public virtual DateTime CreationDate { get; set; } public virtual IList UserInRoles { get; set; } } User Mapping : public class UserMap : ClassMap { public UserMap() { Table("tblUsers"); Id(user => user.UserID).GeneratedBy.GuidComb(); Map(user => user.UserName).Not.Nullable(); Map(user => user.Password).Not.Nullable(); Map(user => user.FullName).Not.Nullable(); Map(user => user.Email).Not.Nullable(); Map(user => user.LastLogin).Not.Nullable(); Map(user => user.IsActive).Nullable(); Map(user => user.CreationDate).Not.Nullable(); HasMany(user => user.UserInRoles); } } FNH Configuration : return Fluently.Configure() .Database(FluentNHibernate.Cfg.Db.MsSqlConfiguration.MsSql2008 .ConnectionString(c => c.FromConnectionStringWithKey("FNHConnection")) ) .Mappings(m => m.FluentMappings.AddFromAssemblyOf()) .BuildSess

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/6606800/no-persister-for-fluent-nhibernate-exception them; it only takes a minute: Sign up Fluent NHibernate no persister for entitiy class up vote 0 down vote favorite I've Googled my ass off and can't seem to find the solution to my problem. I trying to get the demo project here: http://wiki.fluentnhibernate.org/Getting_started to work with sql-server 2008. I can't seem to create the sessionFactory correctly. The code: http://stackoverflow.com/questions/6663574/fluent-nhibernate-no-persister-for-entitiy-class private static ISessionFactory CreateSessionFactory() { try { return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2008 .ConnectionString(c => c .Server("localhost") .Database("gisli") .TrustedConnection()).ShowSql()) .Mappings(m => { m.HbmMappings.AddFromAssemblyOf(); m.HbmMappings.AddFromAssemblyOf(); m.HbmMappings.AddFromAssemblyOf(); }) .BuildSessionFactory(); } catch (Exception e) { Console.WriteLine(e.Message); if(e.InnerException !=null) Console.WriteLine(e.InnerException.Message); return null; } } I have also tried to use the automapping and have not been able to make it work. All of my entity classes are public. Example of entity class and mapping class: public class Product { public virtual int Id { get; private set; } public virtual string Name { get; set; } public virtual double Price { get; set; } public virtual IList StoresStockedIn { get; set; } public Product() { StoresStockedIn = new List(); } } public class ProductMap : ClassMap { public ProductMap() { Id(x => x.Id); Map(x => x.Name); Map(x => x.Price); HasManyToMany(x => x.StoresStockedIn) .Cascade.All() .Inverse() .Table("StoreProduct"); } } EDIT: I also tried this: private static ISessionFactory CreateSessionFactory() { return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2008.ConnectionString(c => c.Server(".").Database("gisli").TrustedConnection())) .Mappings(m => m.FluentMappings.AddFromAssemblyOf()) .BuildSessionFactory(); } EDIT: The second example is in fact the solution. I had accidentally named the project FluentNH

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta http://stackoverflow.com/questions/3345743/need-help-with-a-no-persister-for-exception-with-fluent-nhibernate-automappin Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like no persister you, helping each other. Join them; it only takes a minute: Sign up Need help with a 'No persister for:' exception with Fluent Nhibernate Automapping up vote 3 down vote favorite I'm having some problems with applying NHibernate Fluent Automapping. It worked great in a test project. But now.. Test method [PROJECTNAME].SubscriptionTest.SubscriptionConstructorTest threw exception: NHibernate.MappingException: No persister no persister for for: [PROJECTLIB].SubscriptionManagerRP The class (then again, the same exception arises with a much simpler testclass - so the problem shouldn't be here): [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.4927")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://docs.oasis-open.org/wsn/b-2")] [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://docs.oasis-open.org/wsn/b-2", IsNullable = false)] [System.Runtime.Serialization.DataContractAttribute(Name = "SubscriptionManagerRP", Namespace = "http://docs.oasis-open.org/wsn/b-2")] public class SubscriptionManagerRP { private string id; public string Id { get { return id; } set { id = value; } } public Boolean Save() { DatabaseAccess access = new DatabaseAccess(); var sessionFactory = access.getSessionFactory(); //try //{ using (var session = sessionFactory.OpenSession()) { using (var transaction = session.BeginTransaction()) { SaveTextMess(this.ToString()); session.Save(this); transaction.Commit(); return true; } } //} //catch (Exception e) //{ // SaveTextMess("ERROR: " + e); // Console.WriteLine(e); //} //SaveTextMess("false"); return false; } private void SaveTextMess(String output) { //Just for Demo purposes, saving text file per message that should be sent // create a writer and open the file TextWriter tw = new StreamWriter("C:\\Temp\\CespSubscriptionManagerRPMessage.txt"); // write a line of text to the file tw.WriteLine(output); // close the stream tw.Close(); } //################################### [EditorBrowsable(EditorBrowsableState.Never)] private EndpointReferenceType c

 

Related content

error no persister

Error No Persister table id toc tbody tr td div id toctitle Contents div ul li a href No Persister For Proxy a li li a href Nhibernate No Persister For Entity a li li a href No Persister For Nhibernate C a li li a href Fluent Nhibernate Mappingexception No Persister For a li ul td tr tbody table p here for a quick overview of p h id No Persister For Proxy p the site Help Center Detailed answers to any no persister for fluent nhibernate c questions you might have Meta Discuss the workings and policies of

error no persister for

Error No Persister For table id toc tbody tr td div id toctitle Contents div ul li a href No Persister For Fluent Nhibernate C a li li a href Nhibernate No Persister For Class a li li a href Nhibernate No Persister For Entity a li ul td tr tbody table p here for a quick overview of the no persister for proxy site Help Center Detailed answers to any questions you p h id No Persister For Fluent Nhibernate C p might have Meta Discuss the workings and policies of this site About Us p h id Nhibernate

fluent nhibernate error no persister for

Fluent Nhibernate Error No Persister For table id toc tbody tr td div id toctitle Contents div ul li a href Fluent Nhibernate No Persister For Entity a li ul td tr tbody table p here for a quick overview of the site Help Center Detailed answers to any questions you relatedl might have Meta Discuss the workings and policies of no persister for nhibernate c this site About Us Learn more about Stack Overflow the company Business Learn p h id Fluent Nhibernate No Persister For Entity p more about hiring developers or posting ads with us Stack Overflow

hibernate no persister error

Hibernate No Persister Error table id toc tbody tr td div id toctitle Contents div ul li a href No Persister For Nhibernate Mapping By Code a li li a href Nhibernate Mapping Assembly a li li a href Could Not Compile The Mapping Document a li ul td tr tbody table p here for a quick fluent nhibernate no persister for overview of the site Help Center Detailed answers no persister for fluent nhibernate c to any questions you might have Meta Discuss the workings and policies of fluent nhibernate mappingexception no persister for this site About Us Learn

hibernate error no persister

Hibernate Error No Persister table id toc tbody tr td div id toctitle Contents div ul li a href Fluent Nhibernate mappingexception No Persister For a li li a href No Persister For Entity a li li a href Could Not Compile The Mapping Document a li ul td tr tbody table p here for a quick overview of the site relatedl Help Center Detailed answers to any questions you no persister for nhibernate c might have Meta Discuss the workings and policies of this site fluent nhibernate no persister for About Us Learn more about Stack Overflow the company

no persister error hibernate

No Persister Error Hibernate table id toc tbody tr td div id toctitle Contents div ul li a href No Persister For Fluent Nhibernate C a li li a href No Persister For Nhibernate Mapping By Code a li li a href No Persister For Entity a li li a href Orchard Cms No Persister For a li ul td tr tbody table p here for a quick overview of the site relatedl Help Center Detailed answers to any questions fluent nhibernate no persister for you might have Meta Discuss the workings and policies of this p h id No