]
Terry Bhatti commented on HHH-37:
---------------------------------
This is sitting open since 2004, wish it had been done since.
Nested instantiation using "select new"
---------------------------------------
Key: HHH-37
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-37
Project: Hibernate Core
Issue Type: New Feature
Components: core
Affects Versions: 3.0 alpha
Environment: Hibernate 3.0 alpha
Reporter: Regis Pires Magalhaes
Assignee: Steve Ebersole
Attachments: h3.0.1_grammar.patch, h3.0.1_src.patch, h3.0.1_src_b.patch,
IteratorImpl.java, Loader.java, NestedHolderClass.java, QueryTranslatorImpl.java,
ScrollableResultsImpl.java, SelectParser.java
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: