Came across this error yesterday. Although it looks like a problem in my mapping files, it wasn't. Such an error could be caused by one of multiple reasons (at least that is what my googling about it keeps giving). In my case it was something like the following query:
apparently, I used SetEntity where I should have used a simple SetParameter (yes I used copy paste!). My actual exception was
and such an error could have been caused by any such mistake when setting Binding Parameters for a query.
Hope this helps someone in despair.
session
.CreateSQLQuery("select whatever from AClass where AProperty = :AParameter")
.SetEntity("AParameter", 1)
.List();
.CreateSQLQuery("select whatever from AClass where AProperty = :AParameter")
.SetEntity("AParameter", 1)
.List();
apparently, I used SetEntity where I should have used a simple SetParameter (yes I used copy paste!). My actual exception was
NHibernate.MappingException: No persister for: System.Int32
and such an error could have been caused by any such mistake when setting Binding Parameters for a query.
Hope this helps someone in despair.
2 comments:
Bloody Brilliant!
You need to make it .SetInt32(1) instead of SetEntity()
Post a Comment