From: NHibernate J. <mik...@us...> - 2006-10-26 19:53:15
|
[ http://jira.nhibernate.org/browse/NH-738?page=comments#action_14226 ] Fabio Maulo commented on NH-738: -------------------------------- Simple.... not really. The classic HQL parse (the parse of NHb) is something hard to modify. The new AST parse of H3.2 don't support generic. I think you can solve the problem now using a class inherited from Pair<int,string>. public class IdWithValue : Pair<int,string> { public IdValueList(int id, string value):base(id,value) {..... ... } Any way this is an interesting improvement. > HQL select new generics support > ------------------------------- > > Key: NH-738 > URL: http://jira.nhibernate.org/browse/NH-738 > Project: NHibernate > Type: Improvement > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Mike Nichols > > Given class Pair<int,string> that has a constructor Pair(int i, string s), HQL fails to parse out the generic parameter tokens when trying the following expression: 'select new Pair<int,string>(p.Id,p.Name) from Person p' > The <import/> is used to pull in this custom Pair class. > The default error " , expected in SELECT ..." appears, but this is misleading. > Actually, the tokens in the QueryTranslator class' ConcreteQueries() method aren't parsed correctly when generic "<>" symbols are present in the query. It reads the comma in the generic parameter list as a field separator and doesn't recognize the less-than/greater-than symbols. > Seems like this could be a powerful and (simple?) improvement ... -- 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 |