|
From: Steve E. <ste...@jb...> - 2006-06-22 20:37:35
|
On Oracle10g it actually returns String for both of the scalars.
Not sure what you want to have happen here. The ResultSetMetaData
explicitly reports columnType =3D 12 (java.sql.Types.VARCHAR) for both =
of
these columns. It's not like I can return numerics for all columnType =
=3D
12 auto-discoveries...
-----Original Message-----
From: Emmanuel Bernard [mailto:emm...@hi...]=20
Sent: Wednesday, June 21, 2006 4:59 PM
To: Steve Ebersole
Cc: Hibernate development
Subject: Re: [Hibernate] New error on Annotation query
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: hib...@li...
> [mailto:hib...@li...] 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=20
> 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 =20
> whatever the underlying db returns.
>
> This has not changed afaik.
>
> /max
>
> =20
>> The initial issue is fixed,
>> But now I do have some weird type conversion using HSQLDB (didn't
>> =20
> tried
> =20
>> 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:
>> =20
>>> Try it again from SVN.
>>>
>>> -----Original Message-----
>>> From: hib...@li...
>>> [mailto:hib...@li...] 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
>>>
>>> =20
>
org.hibernate.loader.custom.CustomLoader$NonScalarResultColumnProcessor.
> =20
>>> performDiscovery(CustomLoader.java:453)
>>> at
>>>
>>> =20
>
org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.
> =20
>>> java:511)
>>> at org.hibernate.loader.Loader.getResultSet(Loader.java:1677)
>>> at org.hibernate.loader.Loader.doQuery(Loader.java:662)
>>> at
>>>
>>> =20
>
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loade
> =20
>>> 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
>>>
>>> =20
>
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142
> =20
>>> )
>>> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150)
>>> at
>>>
>>> =20
>
org.hibernate.test.annotations.query.QueryTest.testNativeQueryAndComposi
> =20
>>> tePKAndComponents(QueryTest.java:195)
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>
>>> =20
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> =20
>>> a:39)
>>> at
>>>
>>> =20
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> =20
>>> Impl.java:25)
>>> at
>>> =20
> org.hibernate.test.annotations.TestCase.runTest(TestCase.java:67)
> =20
>>> at
>>>
>>> =20
>
com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
> =20
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> at
>>>
>>> =20
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> =20
>>> a:39)
>>> at
>>>
>>> =20
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> =20
>>> Impl.java:25)
>>> at
>>> com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
>>>
>>>
>>>
>>> @NamedNativeQuery(name =3D "compositekey",
>>> query =3D "select name, model, speed, lname as lastn, fname =
as
>>> firstn, length, width, length * width as surface, length * width *10
>>> =20
> as
> =20
>>> volume from SpaceShip",
>>> resultSetMapping =3D "compositekey")
>>> }
>>>
>>>
>>> @SqlResultSetMapping(name =3D "compositekey",
>>> entities =3D @EntityResult(entityClass =3D
>>> org.hibernate.test.annotations.query.SpaceShip.class,
>>> fields =3D {
>>> @FieldResult(name =3D "name", column =3D "name"),
>>> @FieldResult(name =3D "model", column =3D "model"),
>>> @FieldResult(name =3D "speed", column =3D "speed"),
>>> @FieldResult(name =3D "dimensions.width", column =3D
>>> "width"),
>>> @FieldResult(name =3D "captain.lastname", column =3D
>>> "lastn"),
>>> @FieldResult(name =3D "dimensions.length", column =
=3D
>>> "length"),
>>> @FieldResult(name =3D "captain.firstname", column =
=3D
>>> "firstn")
>>> }),
>>> columns =3D {@ColumnResult(name =3D "surface"),
>>> @ColumnResult(name =3D "volume")})
>>>
>>>
>>>
>>> _______________________________________________
>>> hibernate-devel mailing list
>>> hib...@li...
>>> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>>>
>>> =20
>> All the advantages of Linux Managed Hosting--Without the Cost and
>> =20
> Risk!
> =20
>> Fully trained technicians. The highest number of Red Hat
>> =20
> certifications =20
> =20
>> in
>> the hosting industry. Fanatical Support. Click to learn more
>>
>> =20
>
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat=3D=
121642
> =20
>> _______________________________________________
>> hibernate-devel mailing list
>> hib...@li...
>> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
>> =20
>
>
>
> =20
|