On Mon, 14 Feb 2005 05:39:12 -0600, Gavin King <[EMAIL PROTECTED]>
wrote:
Oh, I did not read the whole thread. No, the order is not controlled.
Ok - so nothing was changed ?
/max
-----Original Message-----
From: Max Andersen
Sent: Monday, 14 February 2005 10:17 PM
To: Gavin King; hibernate-devel@lists.sourceforge.net
Subject: Re: [Hibernate] New SQLQuery interface.
On Mon, 14 Feb 2005 05:06:46 -0600, Gavin King <[EMAIL PROTECTED]>
wrote:
yep.
well - maybe i'm blind, but looking at the
current SQLTest.java (and the underlying impl) it still
looks like its called addXXX and that sequence is still strictly
controlled ?.
I seem to remember a commit message about this being changed, but maybe
it
was overwritten by one of the two big merges ?
So, let me rephrase my question: What was changed ?
/max
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Max
Rydahl Andersen
Sent: Monday, 14 February 2005 9:58 PM
To: 'hibernate-devel@lists.sourceforge.net'
Subject: Re: [Hibernate] New SQLQuery interface.
Hi,
whatever happend to the stuff discussed in this thread ?
was anything changed or ?
-max
Guys, please review:
org.hibernate.test.sql.SQLQueryTest.testSQLQueryInterface()
It demonstrates the new SQLQuery interface, which will replace the
horrible createSQLQuery() methods.
It for sure looks better.
Let me know what you think. I'm not 100% sold on it yet.
List l = s.createSQLQuery("select {org.*}, {emp.*}, emp.regionCode
from
organization org left outer join employment emp on org.id =
emp.employer")
.addEntity("org", Organization.class)
.addJoin("emp", "org.employments")
.addScalar("regionCode", Hibernate.STRING)
.list();
Just dumping thoughts on the above:
addEntity is better than setEntity (which we IM'ed about),
but is "add" the right word/concept for the user ? Would mapEntity,
aliasEntity, bindEntity be better ?
addJoin - is that a new feature or did that come in there together
with
load-collection and i've just been blind ?
addScalar - ok, any thoughts on how this "scales" up to handling
compositeusertypes ?
The suggested xml version is something like:
<return-scalar type="MonetaryAmount">
<column-alias name="c1"/>
<column-alias name="c2"/>
</return-scalar>
in the API that would be something like:
.addScalar(new String[] { "c1", "c2" },
Hibernate.custom(MonetaryAmmount.class)) or ?
Then there is the whole sequencing of the resulting Object[] ?
If we want to keep the strict ordering scalar-first, entities-last
then
I would
like to force the users to obey to this in their code. This could be
done by
simply having addScalar check that no entities have been added - and
otherwise
throw an exception telling about the sequence needed ?
-max
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive
Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF,
etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel