Hello,
i had the same problem with Returning non-managed entities as swtechno.
But the following example works now fine for me:
Code:
IQuery query = session.CreateSQLQuery("SELECT DISTINCT TABLE_SCHEMA FROM INFORMATION_SCHEMA.COLUMNS WHERE (TABLE_SCHEMA<>'information_schema' AND TABLE_SCHEMA<>'mysql')").AddScalar("TABLE_SCHEMA", NHibernateUtil.String).SetResultTransformer(Transformers.AliasToBean(typeof(Schema)));
Schema is a small class with one property.
My Problem now is that i can not aliased the database columnsname "TABLE_SCHEMA" to my property "Name", because now the propertyname is the same as the databasecolumn. this is not nice.
Is there a way and how can i do it?
Thanks Axel