Nested instantiation using "select new"

Description

Our suggestion is to get lightweight objects from Hibernate using nested new's in HQL "select new" feature.
Currently, the following HQL statement works fine:

select new Store(store.id, store.description) from Store store

However we can not do a nested instantiation like:

select new Store(store.id, store.description, new Section(store.section.id, store.section.name)) from Store store

We have done some custom changes in our Hibernate 3.0 alpha source code in order to support it.

The changed classes were:
org.hibernate.impl.IteratorImpl
org.hibernate.loader.Loader
org.hibernate.hql.QueryTranslatorImpl
org.hibernate.impl.ScrollableResultsImpl
org.hibernate.hql.SelectParser

The new class is:
org.hibernate.util.NestedHolderClass;

We would like to know if Hibernate Team has some interest to analyse this contribution and maybe add this feature to future versions of Hibernate.

Environment

Hibernate 3.0 alpha

Assignee

Steve Ebersole

Reporter

Regis Pires Magalhaes

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure