Re: [Hibernate] New SQLQuery interface.
Here is the error I'm getting: org.hibernate.MappingException: Error reading resource: org/hibernate/test/sql/Employment.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:427) ... Caused by: org.xml.sax.SAXParseException: Attribute "class" is required and must be specified for element type "return". at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) I'm temporarily adjusting hibernate-mapping-3.0.dtd to get it to stop complaining. 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] Tools 3.0 alpha 1 and Annotations 3.0 alpha 2 released
http://tools.hibernate.org/ http://annotations.hibernate.org/ -- Christian Bauer callto://christian-bauer 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.
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
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.
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: > > > > > > 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: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.
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.
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.
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: 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