Cameron Braid wrote:

The "SELECT new DataClass(domainField1, domainField2) FROM class DomainClass" is an excellent feature, though I propose the following enhancements :

*a) Allow aliasing of the field names. *

this allows the the default constructor to be used, and the bean properties set by name.

SELECT new DataClass(domainField1 as field1, domainField2 as field2) FROM class DomainClass

this also allows a map to be constructed instead of an object array :

SELECT new Map(domainField1 as field1, domainField2 as field2) FROM class DomainClass

Max and I both agree that this is a very desirable feature. Actually we don't even need aliases to support select new map(...). We could just use the propety names.




this also allows a DataTable to be constructed to contain the metadata of the results,

SELECT new DataTable(domainField1 as field1, domainField2 as field2) FROM class DomainClass

the DataTable is a List of Entry. each Entry implements Map and CustomMetaData
the CustomMetaData provides a list of column names and types.

I don't know quite what you're getting at here.




*b) Allow arithmentic expressions in the select clause when using SELECT new*


Gavin states at https://sourceforge.net/forum/message.php?msg_id=2070062

that the problem with arithmentic expressions in the select clause is

"The trouble is that Hibernate doesn't know what the resulting type of the expression would be. It would depend upon db-specific type conversions."

Would this matter as long as you are creating a Map, DataTable or CustomDataClass ?

Yeah, it still matters. I call ResultSet.getWhat?




--
Gavin King
JBoss Group
+61 410534454
http://hibernate.org



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to