nhibernate3 weaknesses
Posted
by
Adrakadabra
on Stack Overflow
See other posts from Stack Overflow
or by Adrakadabra
Published on 2011-01-01T07:06:13Z
Indexed on
2011/01/01
7:54 UTC
Read the original article
Hit count: 196
nhibernate
from the moment we've migrated from hibernate 2 to hibernate3 ,around 30% of queries can not execute anymore,while there were not any problem with the previous version. does anybody have such problems?
for example some of errors we see r like these
Specified cast is not valid:
Repository<CountrySubdivision>.Find(p => p.Parent.Id == parentId);
specified method is not supported:
public JsonResult AllEducationDegree(string search)
{
var data = Repository<EducationDegree>
.FindBySpecification(new EducationDegreeSpecification().Search(search))
.Take(10)
.Select(p => new NameValue(p.Title, (int)p.Id))
.ToList();
// .AsDropdown(" ");
return Json(data, JsonRequestBehavior.AllowGet);
}
public class EducationDegreeSpecification : FluentSpecification<EducationDegree>
{
public EducationDegreeSpecification Search(string EducationDegreeSearch)
{
if (!String.IsNullOrEmpty(EducationDegreeSearch))
{
string[] searchs = EducationDegreeSearch.Split(' ');
foreach (string search in searchs)
{
if (!String.IsNullOrEmpty(search))
{
AddExpression(p => p.Title.Contains(search));
}
}
}
return this;
}
}
© Stack Overflow or respective owner