From: NHibernate J. <mik...@us...> - 2006-11-13 18:03:34
|
[ http://jira.nhibernate.org/browse/NH-280?page=all ] Sergey Koshcheyev updated NH-280: --------------------------------- Fix Version: LATER Version: 1.2.0.Beta2 Assign To: (was: Mike Doerfler) > Using constants in select clause of HQL > --------------------------------------- > > Key: NH-280 > URL: http://jira.nhibernate.org/browse/NH-280 > Project: NHibernate > Type: New Feature > Components: Core > Versions: 1.2.0.Beta2, beta-0.8.3 > Environment: .net 1.1, nhibernate 0.8.2.0, sql server 2000 sp 3 > Reporter: Dragos Nuta > Priority: Minor > Fix For: LATER > > It would be nice and easier to have a way to specify constants in the select clause in hql. > select someobject.property, 1, 'constant string' > from SomeObject someobject > If you need a case where this could prove useful think about union (that as far as I know is not supported either) in a case like this: > ArrayList result = new ArrayList(); > result.AddRange( > Session.CreateQuery( "select o1.Name, 'O1' from Object1 o1" ).List() > ); > result.AddRange( > Session.CreateQuery( "select o2.Name, 'O2' from Object2 o2" ).List() > ); > I think it should not be hard to support integer, decimal or string constants, but you may find some difficulties in expressing datetime constants. On possibility whould be to support a new keyword, something like newDate( year, month, day, hour, minute, second), or support a syntax like in Access (I guess) of {year-month-date} or {year-month-date hour:minute:second}. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |