Can yo add the test project? I guess I know the problem. The problem can be the use of DateTime
Try var date=DateTime.Now; List<PickPeriod> periods = session.Linq<PickPeriod> ().Where(pp => pp.StartDate < date).ToList(); Tuna Toksöz http://tunatoksoz.com http://turkiyealt.net http://twitter.com/tehlike Typos included to enhance the readers attention! On Sat, Mar 7, 2009 at 6:55 PM, Randy <[email protected]> wrote: > > Started over with the simplest configuration I could manage and still > having this problem. Is there any configuration necessary for > enabling NHibernate.Linq functionality that I may be missing? > > I am making a simple call: > using (ISession session = NHibernateHelper.OpenSession()) > { > List<PickPeriod> periods = session.Linq<PickPeriod> > ().Where(pp => pp.StartDate < DateTime.Now).ToList(); > } > > Here's the stack trace for the exception: > > [MappingException: No persister for: System.DateTime] > NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String > entityName) +144 > NHibernate.Linq.Visitors.AssociationRewriteVisitor.VisitMemberAccess > (MemberExpression expr) in E:\code\nHibernate\trunk\nhibernate\src > \NHibernate.Linq\Visitors\AssociationRewriteVisitor.cs:53 > NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in E:\code > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs: > 66 > NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33 > NHibernate.Linq.ExpressionVisitor.VisitBinary(BinaryExpression b) > in E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq > \ExpressionVisitor.cs:124 > NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in E:\code > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs: > 56 > NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33 > NHibernate.Linq.ExpressionVisitor.VisitLambda(LambdaExpression > lambda) in E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq > \ExpressionVisitor.cs:313 > NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in E:\code > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs: > 70 > NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33 > NHibernate.Linq.ExpressionVisitor.VisitUnary(UnaryExpression u) in > E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq > \ExpressionVisitor.cs:114 > NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in E:\code > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs: > 32 > NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33 > NHibernate.Linq.ExpressionVisitor.VisitList(ReadOnlyCollection`1 > original) in E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq > \ExpressionVisitor.cs:200 > NHibernate.Linq.ExpressionVisitor.VisitMethodCall > (MethodCallExpression m) in E:\code\nHibernate\trunk\nhibernate\src > \NHibernate.Linq\ExpressionVisitor.cs:185 > NHibernate.Linq.ExpressionVisitor.Visit(Expression exp) in E:\code > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\ExpressionVisitor.cs: > 68 > NHibernate.Linq.Visitors.NHibernateExpressionVisitor.Visit > (Expression exp) in E:\code\nHibernate\trunk\nhibernate\src > \NHibernate.Linq\Visitors\NHibernateExpressionVisitor.cs:33 > NHibernate.Linq.Visitors.AssociationRewriteVisitor.Rewrite > (Expression expr, ISessionFactoryImplementor factory) in E:\code > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\Visitors > \AssociationRewriteVisitor.cs:29 > NHibernate.Linq.Query.LinqTranslator.Translate() in E:\code > \nHibernate\trunk\nhibernate\src\NHibernate.Linq\Query > \LinqTranslator.cs:39 > NHibernate.Linq.NHibernateQueryProvider.Execute(Expression > expression) in E:\code\nHibernate\trunk\nhibernate\src\NHibernate.Linq > \NHibernateQueryProvider.cs:27 > NHibernate.Linq.Query`1.GetEnumerator() in E:\code\nHibernate\trunk > \nhibernate\src\NHibernate.Linq\Query.cs:58 > System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > +7663302 > System.Linq.Enumerable.ToList(IEnumerable`1 source) +61 > > Also, in case it somehow matters the Helper is creating it's > ISessionFactory with: > > var configuration = new Configuration(); > > configuration.Configure(); > > configuration.AddAssembly(typeof > (Season).Assembly); > > _sessionFactory = configuration.BuildSessionFactory > (); > > On Mar 6, 2:00 pm, Tuna Toksoz <[email protected]> wrote: > > The trunk code with latest NH trunk dll works perfectly fine. > > > > Tuna Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp:// > twitter.com/tehlike > > > > Typos included to enhance the readers attention! > > > > On Fri, Mar 6, 2009 at 6:58 AM, Tuna Toksoz <[email protected]> wrote: > > > I'll check it out today. > > > > > Tuna Toksöz > > >http://tunatoksoz.com > > >http://turkiyealt.net > > >http://twitter.com/tehlike > > > > > Typos included to enhance the readers attention! > > > > > On Fri, Mar 6, 2009 at 5:34 AM, Randy <[email protected]> wrote: > > > > >> I've confirmed that this is an issue w/o Castle Windsor in the > > >> pipeline. Is there some sort of configuration necessary for getting > > >> LinqToHibernate to work? > > > > >> On Mar 5, 12:50 pm, Randy <[email protected]> wrote: > > >> > Sorry that's on my box at home, but it's on trunk of nHibernate and > > >> > LinqToNHIibernate as of last night. I am also using the Castle NH > > >> > Facility on the latest build, if that may be part of the issue. I > was > > >> > planning on testing it without Castle tonite to further isolate the > > >> > issue. I am very new to NH so I could be missing something basic > > >> > here, but I was able to get NH and Castle running just fine until I > > >> > tried integrating the Linq stuff. > > > > >> > Thanks! > > > > >> > On Mar 5, 4:19 am, Tuna Toksoz <[email protected]> wrote: > > > > >> > > Randy? > > > > >> > > Tuna Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp:// > > >> twitter.com/tehlike > > > > >> > > Typos included to enhance the readers attention! > > > > >> > > On Thu, Mar 5, 2009 at 12:18 PM, Tuna Toksoz <[email protected]> > > >> wrote: > > >> > > > Trunk doesn't have any changes since february 6. > > > > >> > > > Which revision of NH are you using? > > > > >> > > > Tuna Toksöz > > >> > > >http://tunatoksoz.com > > >> > > >http://turkiyealt.net > > >> > > >http://twitter.com/tehlike > > > > >> > > > Typos included to enhance the readers attention! > > > > >> > > > On Thu, Mar 5, 2009 at 6:24 AM, Randy <[email protected]> > wrote: > > > > >> > > >> I'm getting the same exception w/ trunk as of 3/4. Anyone have > any > > >> > > >> ideas? > > > > >> > > >> On Feb 24, 4:34 pm, James Crowley <[email protected]> > wrote: > > >> > > >> > I'm workingagainst the current trunk of nhibernate and > > >> nhibernate.linq. > > >> > > >> > Accessing my data via the standard query methods is fine, but > > >> when going > > >> > > >> via > > >> > > >> > the linq2hibernate provider, I'm getting a MappingException > > >> stating "No > > >> > > >> > persister for: System.*" where * is whatever the first > System.* > > >> type > > >> > > >> that > > >> > > >> > appears in my entity. > > > > >> > > >> > The line where it goes wrong is in VisitMemberAccess of > > >> > > >> > AssociationRewriteVisitor > > > > >> > > >> > IPropertyMapping mapping = > > >> > > >> > sessionFactory.GetEntityPersister(expr.Type.FullName) as > > >> > > >> IPropertyMapping; > > > > >> > > >> > and it's trying to find an entity persister for > "System.String", > > >> > > >> > "System.Bool" etc. > > > > >> > > >> > Any ideas? Am I doing something wrong? > > > > >> > > >> > Thanks, > > > > >> > > >> > James > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
