resulttransformer

Hibernate dynamic query performance issue solutions using result transformer!

This is a important addition especially to solve performance issues while being able to write efficient dynamic HQL queries. But, how do we modify the HQL transformer in case of loading a specific parent or another mapped entity property. session.createQuery( "select st.stNumber as stNumber, st.stDate as stDate " + " from SomeTable st "...

Projections in NHibernate

suppose in an entity there are attributes id, username, age, address. Now I just want id and username and I use this code for it. Projections enable the returning of something other than a list of entities from a query. var proj = Projections.ProjectionList() .Add(Projections.Property("Id"), "Id") .Add(Projections.Property("Use...

Getting mapped entities from an ISQLQuery without AddEntity

Hello all, consider these POCOs: class Foo { int Id {get;set;} string Name {get;set;} } class Bar { int Id {get;set;} string PropA {get;set;} Foo PropB {get;set;} } Now what i want to achieve is using an ISQLQuery with a root entity of Bar to also hydrate the PropB property. ISQLQuery barsAround = nhSes.CreateSQLQuery("s...