Is there any way I can just do a distinct select in HQL?
I would do this in SQL: select distinct name from table1.
Where table1 has an id (int identity field), name (string field), etc.
I tried using SqlSimpleSelectBuilder and that wants a index column.
I tried using HQL, but that wants a Persister class.
I tried this:
IQuery query = this.session.CreateSQLQuery("select distinct name from table1", "names", typeof(String));
files = query.List();
But, I get this error: ""No persisters for: System.String".
I don't want a persistable object, I just want a read-only list of strings to be honest.
Any help or direction would be great.
Thanks,
Jamie
|