Home > no persister > fluent nhibernate error no persister for

Fluent Nhibernate Error No Persister For

Contents

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 no persister for nhibernate c# this site About Us Learn more about Stack Overflow the company Business Learn

Fluent Nhibernate No Persister For Entity

more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question no persister for nhibernate mapping by code x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fluent NHibernate mapping exception (no persister error) up vote 0 down vote favorite I have the following code which gives me a mapping exception with no persister error: var sessionFactory = Fluently.Configure() .Database( OracleClientConfiguration.Oracle10.ConnectionString( c => c.FromConnectionStringWithKey("Main.ConnectionString"))) .Mappings(x => x.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly())) .BuildSessionFactory(); using (var session = sessionFactory.OpenSession()) { using (var tx = session.BeginTransaction()) { var card = new Card {CardType = "Test"}; session.Save(card); tx.Commit(); } } I have three projects in my solution: MainApplication , Entities and EntityMappings MainApp has a reference to Entities and EntityMappings has a reference to Entities I don't understand what I am doing wrong. Any ideas ? EDIT: The properties are public The exact error message is : No persister for: TNT_DAL.EntityClasses.Card c# fluent-nhibernate share|improve this question edited May 5 '14 at 9:09 asked May 5 '14 at 8:31 Cemre 4,20595297 Can you provide the full exception message please? If I recall correctly it should mention no persister for a particular class or database field. –JW Lim May 5 '14 at 9:03 @JWLim yes you are right. please see the edit –Cemre May 5 '14 at 9:09 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted Make sure that your entity and mapping classes are public. Properties for your entities i.e. database fields should be public virtual. Also try specifying the assembly of a mapping class instead of using GetExecutingAssembly(), I do vaguely recall experiencing trouble with it when I tried setting up FNH for the fir

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 http://stackoverflow.com/questions/23468116/fluent-nhibernate-mapping-exception-no-persister-error us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NHibernate.MappingException: http://stackoverflow.com/questions/57804/nhibernate-mappingexception-no-persister-for-xyz No persister for: XYZ up vote 114 down vote favorite 12 Now, before you say it: I did Google and my hbm.xml file is an Embedded Resource. Here is the code I am calling: ISession session = GetCurrentSession(); var returnObject = session.Get(Id); Here is my mapping file for the class: Has anyone run to this issue before? Here is the full error message: MappingException: No persister for: HQData.Objects.SubCategory]NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName, Boolean throwIfNotFound) in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:766 NHibernate.Impl.SessionFactoryI

ASP.NET Community Standup Forums Help Home/ASP.NET Forums/Data Access/ADO.NET, Entity Framework, LINQ to SQL, NHibernate/nHiberanate 3.0 + Fluent nHiberanate : "No Persister for:" Error nHiberanate 3.0 + Fluent nHiberanate http://forums.asp.net/t/1787017.aspx?nHiberanate+3+0+Fluent+nHiberanate+No+Persister+for+Error : "No Persister for:" Error [Answered]RSS 2 replies Last post Mar 30, 2012 12:15 PM by krokonoster ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply krokonoster Contributor 3572 Points 1675 Posts nHiberanate 3.0 + Fluent nHiberanate : "No Persister for:" Error Mar 29, 2012 06:01 PM|krokonoster|LINK Hi, Made my no persister first attempt at nHibernate after I got a sample working (which was a bit simpler and all inside a single console app) However, I'm stuck with some "No persister for: [myclass]" error and no question / answer I found could solve my problem so far. I uploaded the source code to github for in case someone want to see the complete code. In no persister for a nutshell it's 3 projects. One "infrastructure" (domain entities and service interfaces), nl. krok.blog and a nHibernate implementation of those services in krok.blog.data. I "use" this in a sandbox console app (in the test folder). The domain are very simple (maybe not for a n00b with nHibernate) but let me post some code: namespace krok.blog.Domain { public class Post : Entity { public Post() { Categories = new List(); Comments = new List(); } public virtual string Title { get; set; } public virtual string Body { get; set; } public virtual string Synopsis { get; set; } public virtual IList Categories { get; set; } public virtual IList Comments { get; set; } } } Mapping namespace krok.blog.data.Mappings { public class PostMap : ClassMap { public PostMap() { Id(x => x.Id); Map(x => x.Title); Map(x => x.Body); Map(x => x.Synopsis); HasMany(x => x.Comments).KeyColumn("CommentId"); HasManyToMany(x => x.Categories) .Table("BlogPostsCategories") .ParentKeyColumn("PostId") .ChildKeyColumn("CategoryId"); Table("BlogPosts"); } } } Configuration: private static void InitializeSessionFactory() { string connectionString = ConfigurationManager.ConnectionStrings["blogdb"].ConnectionString; _sessionFactory = Fluently.Configure() .Database(MsSqlConfiguration.MsSql2008.ConnectionString(@connectionString).ShowSql()) .Mappings(m => m.FluentMappings.AddFromAssemblyOf()) .BuildSessionFactory(); } I'll keep trying to figure it out and will post the solution *IF* I ca

 

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

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

no persister for fluent nhibernate error

No Persister For Fluent Nhibernate Error p here for a quick overview of the relatedl 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 million programmers just like