My description was too generic. I've updated the GeneralTest by adding a SpaceShip class. It now fails with the error I encountered.
Steve Ebersole wrote: > I just ran this on Oracle-10g and HSQLDB and both worked fine for me. > > On Oracle, the discovered types were BigDecimalType and BigDecimalType. > > On HSQLDB, the discovered types were BigIntegerType and BigDecimalType > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Steve Ebersole > Sent: Wednesday, June 21, 2006 3:55 PM > To: Max Andersen; Emmanuel Bernard > Cc: Hibernate development > Subject: Re: [Hibernate] New error on Annotation query > > I am creating a similar test in the core testsuite and see if I can > reproduce. > > -----Original Message----- > From: Max Andersen > Sent: Wednesday, June 21, 2006 3:53 PM > To: Emmanuel Bernard; Steve Ebersole > Cc: Hibernate development > Subject: Re: [Hibernate] New error on Annotation query > > > This should be controlled by calls to Dialect.registerHibernateType() > and > whatever the underlying db returns. > > This has not changed afaik. > > /max > > >> The initial issue is fixed, >> But now I do have some weird type conversion using HSQLDB (didn't >> > tried > >> the other ones). >> >> basically I do have >> public Dimension() { >> private int length; >> private int width; >> } >> >> ints are converted into INTEGER types at the DB level, fine >> >> The following native SQL query, mapped using scalar autodiscovery >> select length * width as surface, length * width * 10 as volume ... >> >> returns String for the first argument and Double for the second >> The same query used to return BigInteger for the first one and >> BigDecimal for the second. >> >> >> >> Steve Ebersole wrote: >> >>> Try it again from SVN. >>> >>> -----Original Message----- >>> From: [EMAIL PROTECTED] >>> [mailto:[EMAIL PROTECTED] On Behalf Of >>> Emmanuel Bernard >>> Sent: Sunday, June 18, 2006 10:21 PM >>> To: Hibernate development >>> Subject: [Hibernate] New error on Annotation query >>> >>> Has something changed that I haven't propagated in my code? >>> >>> >>> org.hibernate.HibernateException: cannot perform autodiscovery on >>> queries with non-scalar results >>> at >>> >>> > org.hibernate.loader.custom.CustomLoader$NonScalarResultColumnProcessor. > >>> performDiscovery(CustomLoader.java:453) >>> at >>> >>> > org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader. > >>> java:511) >>> at org.hibernate.loader.Loader.getResultSet(Loader.java:1677) >>> at org.hibernate.loader.Loader.doQuery(Loader.java:662) >>> at >>> >>> > org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loade > >>> r.java:224) >>> at org.hibernate.loader.Loader.doList(Loader.java:2144) >>> at >>> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) >>> at org.hibernate.loader.Loader.list(Loader.java:2023) >>> at >>> org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:290) >>> at >>> org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) >>> at >>> >>> > org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142 > >>> ) >>> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150) >>> at >>> >>> > org.hibernate.test.annotations.query.QueryTest.testNativeQueryAndComposi > >>> tePKAndComponents(QueryTest.java:195) >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> >>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav > >>> a:39) >>> at >>> >>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor > >>> Impl.java:25) >>> at >>> > org.hibernate.test.annotations.TestCase.runTest(TestCase.java:67) > >>> at >>> >>> > com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32) > >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> at >>> >>> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav > >>> a:39) >>> at >>> >>> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor > >>> Impl.java:25) >>> at >>> com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) >>> >>> >>> >>> @NamedNativeQuery(name = "compositekey", >>> query = "select name, model, speed, lname as lastn, fname as >>> firstn, length, width, length * width as surface, length * width *10 >>> > as > >>> volume from SpaceShip", >>> resultSetMapping = "compositekey") >>> } >>> >>> >>> @SqlResultSetMapping(name = "compositekey", >>> entities = @EntityResult(entityClass = >>> org.hibernate.test.annotations.query.SpaceShip.class, >>> fields = { >>> @FieldResult(name = "name", column = "name"), >>> @FieldResult(name = "model", column = "model"), >>> @FieldResult(name = "speed", column = "speed"), >>> @FieldResult(name = "dimensions.width", column = >>> "width"), >>> @FieldResult(name = "captain.lastname", column = >>> "lastn"), >>> @FieldResult(name = "dimensions.length", column = >>> "length"), >>> @FieldResult(name = "captain.firstname", column = >>> "firstn") >>> }), >>> columns = [EMAIL PROTECTED](name = "surface"), >>> @ColumnResult(name = "volume")}) >>> >>> >>> >>> _______________________________________________ >>> hibernate-devel mailing list >>> hibernate-devel@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >>> >>> >> All the advantages of Linux Managed Hosting--Without the Cost and >> > Risk! > >> Fully trained technicians. The highest number of Red Hat >> > certifications > >> in >> the hosting industry. Fanatical Support. Click to learn more >> >> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > >> _______________________________________________ >> hibernate-devel mailing list >> hibernate-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >> > > > > All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel