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=6595alloc_id=14396op=click ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
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=6595alloc_id=14396op=click ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] New SQLQuery interface.
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=6595alloc_id=14396op=click ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] New SQLQuery interface.
On Mon, 14 Feb 2005 06:06:59 -0600, Gavin King [EMAIL PROTECTED] wrote: No. okeeey - not much came out of that review then ,) ...so no objections to me adding throw an exception if users ask for ordering with scalars first ? /max -Original Message- From: Max Andersen Sent: Monday, 14 February 2005 10:42 PM To: Gavin King; hibernate-devel@lists.sourceforge.net Subject: Re: [Hibernate] New SQLQuery interface. 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=6595alloc_id=14396op=click ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
Re: [Hibernate] New SQLQuery interface.
On Tue, 25 Jan 2005 09:48:20 +1100, Gavin King [EMAIL PROTECTED] wrote: 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
Re: [Hibernate] New SQLQuery interface.
Inline Max Rydahl Andersen wrote: On Tue, 25 Jan 2005 09:48:20 +1100, Gavin King [EMAIL PROTECTED] wrote: Then there is the whole sequencing of the resulting Object[] ? I would rather have addXxx order as significant If we want to keep the strict ordering scalar-first, entities-last Why do we want to keep that one? 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
Re: [Hibernate] New SQLQuery interface.
I think I forgot to commit my test dir earlier. Try now. Joshua Davis wrote: I've just updated and I can't find the test. I'll try again. SQLTest seems to fail becaues of a DTD validation problem as well... maybe my classpath is incorrect. Gavin King wrote: Guys, please review: org.hibernate.test.sql.SQLQueryTest.testSQLQueryInterface() It demonstrates the new SQLQuery interface, which will replace the horrible createSQLQuery() methods. Let me know what you think. I'm not 100% sold on it yet. Thanks, Gavin --- 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 -- Gavin King +61 410 534 454 +1 404 822 8349 callto://gavinking Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://jboss.com --- 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
Re: [Hibernate] New SQLQuery interface.
On Tue, 25 Jan 2005 12:17:59 +0100, Emmanuel Bernard [EMAIL PROTECTED] wrote: Inline Max Rydahl Andersen wrote: On Tue, 25 Jan 2005 09:48:20 +1100, Gavin King [EMAIL PROTECTED] wrote: Then there is the whole sequencing of the resulting Object[] ? I would rather have addXxx order as significant Me too, but that is just not how it is implemented at the moment. Thus, if we keep it that way we should complain when users try to do it against-the-implementation. If we don't do this, we would not be able to actually provide a future release that actually returns in the sequence the user specifies. /max If we want to keep the strict ordering scalar-first, entities-last Why do we want to keep that one? 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 --- 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
Re: [Hibernate] New SQLQuery interface.
Hi, It demonstrates the new SQLQuery interface, which will replace the horrible createSQLQuery() methods. It for sure looks better. I also like the look of it. 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(); Looks okay to me. Shouldn't this be select {org.*}, {emp.*}, emp.regionCode {regionCode} from ..., or did you remove aliasing for the scalars? 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 ? Can't we reuse the names from the CustomType? Something like select ammount {money.ammount}, currency {money.currency} from ... 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 ? I would rather go for some user-defined ordering, e.g. the order of the addXXX() method calls. Enforcing something like entities always first sounds a bit confusing to me, what if I return multiple entities, scalars, how do I know which one comes first then? Michael --- 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
Re: [Hibernate] New SQLQuery interface.
On Tue, 25 Jan 2005 12:01:27 +0100, Max Rydahl Andersen [EMAIL PROTECTED] wrote: 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 ? Alternatively we could mimic the DTD and have setReturnScalar(), setReturn(Entity)(), setReturnJoin(), setLoadCollection() or ? /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
Re: [Hibernate] New SQLQuery interface.
I've just updated and I can't find the test. I'll try again. SQLTest seems to fail becaues of a DTD validation problem as well... maybe my classpath is incorrect. Gavin King wrote: Guys, please review: org.hibernate.test.sql.SQLQueryTest.testSQLQueryInterface() It demonstrates the new SQLQuery interface, which will replace the horrible createSQLQuery() methods. Let me know what you think. I'm not 100% sold on it yet. Thanks, Gavin --- 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
[Hibernate] New SQLQuery interface.
Guys, please review: org.hibernate.test.sql.SQLQueryTest.testSQLQueryInterface() It demonstrates the new SQLQuery interface, which will replace the horrible createSQLQuery() methods. Let me know what you think. I'm not 100% sold on it yet. Thanks, Gavin -- Gavin King +61 410 534 454 +1 404 822 8349 callto://gavinking Hibernate [EMAIL PROTECTED] http://hibernate.org JBoss Inc [EMAIL PROTECTED] http://jboss.com --- 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