NHibernate - Fluent NHibernate auto mapping
Asked By jithendra
27-Jul-10 02:52 PM
Hi,
I have two questions about fluent Nhibernate auto mapping
1. No persister for:
i am getting the above error when i try to save my data using the following
AutoMappingNHibernate.Author author = new AutoMappingNHibernate.Author();
author.AuthorInfo = ".Net developer extraordinaire";
author.AuthorFirstName = "Peter";
author.AuthorLastName = "Bromberg";
author.AuthorName = "Peter Bromberg";
ITransaction trans = session.BeginTransaction();
session.Save(author);
2. Where(t => t.Namespace.StartsWith("QuotesApp"))
what exactly we are doing here and what value we need to pass inside startswith?
Please suggest me, how to solve 1 problem and what value i need to pass on second
It's very urgent, please help me
Thanking you
My email id is : jith_n@yahoo.com
With Regards,
Jithendra
Peter Bromberg replied to jithendra
Did you set the Build Action of any of your .hbm.xml files to Embedded Resource?
Regarding Where(t => t.Namespace.StartsWith("QuotesApp")) you are simply saying do the mapping only on classes where the namespace starts with "QuotesApp" (or whatever your namespace for your classes is).
jithendra replied to Peter Bromberg
Hi Peter Bromberg,
Thank you very much for your prompt reply
i do not have .hbm.xml files, it's automapping using fluent Nhibernate, i just followed your article using the following link
http://www.eggheadcafe.com/tutorials/aspnet/50aa9259-6dbb-4d16-9639-81ee42171b00/more-fun-with-fluent-nhibernate-automapping.aspx
In the above article you asked me to create class files and program.cs file, i just exactly what you did on the above article.
Please suggest me what i need to do to fix that "No Persister" problem
Thanking you
With Regards,
Jithendra

Update in Gridview (Nhibernate) how to update record in nhibernate , i put public long? Update(CTS_Class_Detail classDtl) { long? retVal = null; ITransaction transaction = null; try { transaction = Session.BeginTransaction(); Session.Update(classDtl); retVal = classDtl.ClassId; } catch (Exception ex if (transaction ! = null && transaction.IsActive) transaction.Rollback(); throw; } return retVal; } and call this in another class objsave.ClassId = classId; objsave.Duration = duration; objsave.RoomNo = roomNo; objsave.Topic = topic; objsave.DateOfClass = dateOfClass
More Fun with Fluent NHibernate Automapping Simple example of using Fluent NHibernate Automapping NHibernate is a flexible and adaptable framework; and when you understand the way it works and comes at a cost. Developers who are new to this ORM framework often claim that NHibernate has a steep learning curve, and they are correct –mastering NHibernate does require significant study. Like any other tool, you need to get the facts and limited time. One of my personal 2010 goals is to become completely comfortable with both NHibernate and Fluent.NHibernate. I made this decision after a great deal of thought and study. My conclusions were that NHibernate is still years ahead of competing technologies and is likely to remain so for the
Fluent NHibernate Automapping Quick intro to Fluent NHibernate, resource links, and a working downloadable self-contained sample. Covers only the basics of using AutoMapping, schema generation, and basic NHibernate CRUD actions. I've been following NHibernate and, more recently, the Fluent NHibernate offering for a while now. I have a book on it NHibernate in Action ), which I've now gone through a couple of times, and I believe I have mastered the basics of using NHibernate. I like NHibernate for a few reasons: 1) It is a mature ORM originally ported from the JAVA
them away. Any help will be appreciated! Greeting Martin. Code: namespace Edifact { using namespace std; class EdifactFormat; class ElementFormat; template <class Ch, class Tr, class In> class EdifactSibling; template <class Ch, class Tr, class In> class ElementSibling; template <class Ch, class Tr, class In> class Request; template