oalexandrino wrote:
that didn't work.
I just get an error saying sth like "No Type specified"
What have I to do (configuration?) in order to work without mapping?
You can use AliasToEntityMapResultTransformer to return data as dictionary.
If you just want to use your objects without mapping, you can do something like this:
For example, in HQL you can say something like this:
Code:
select new MyMappedClass(x.id, x.name) From blabla as x
Obviously, this needs mapping for MyMappedClass. But, you can also use this:
Code:
select new System.Collections.DictionaryEntry(x.id, x.name) From blabla as x
So, if you want this:
Code:
select new MyNamespace.MyNOTMappedClass(x.id, x.name) From blabla as x
you have to add an <import> somewhere in mapping file:
Code:
<import class='MyNamespace.MyNOTMappedClass, MyAssembly'>
.
NOTE <import> should be placed before <class>
Also, you could try using NHibernate.Cfg.Mappings.AddImport
HTH, Tom