inherit the Dialect and register your function where is not already register
2010/3/15 Richard Wilde <[email protected]> > Is it possible to use a native MSSQL function on the where clause for a > class? > > Basically I would like to add a native "DateAdd" function. However the > generated sql looks like this:- > > ...FROM members this_ WHERE ( this_.ExpiryDate >= > DateAdd(this_.ww,-6,getDate()))... > > Notice the additional "this_" just before the ".ww" > > I would want the SQL generated to be this:- > > ...FROM members this_ WHERE ( this_.ExpiryDate >= > DateAdd(ww,-6,getDate()))... > > My HBM.XML looks like this. > > <class name="Domain.Model.Entities.BobMember, Domain.Model" table="members" > mutable="false" where="ExpiryDate >= DateAdd(ww,-6,getDate())"> > > Is this a really stupid question? If this is a real stupid question then is > there a different technique which will enforce my model to always add a > where clause where I can only get a list of Members where the expiry date > is > greater than 6 weeks before today. > > I do understand that in my code, I am tying my model to SQL server. > > Many Thanks > Richard > > > -- > 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]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- Fabio Maulo -- 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.
