Re: [Hibernate] New error on Annotation query

2006-06-22 Thread Steve Ebersole
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 = 12 (java.sql.Types.VARCHAR) for both of
these columns.  It's not like I can return numerics for all columnType =
12 auto-discoveries...

-Original Message-
From: Emmanuel Bernard [mailto:[EMAIL PROTECTED] 
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: [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

Re: [Hibernate] New error on Annotation query

2006-06-22 Thread Steve Ebersole
Actually, I just tested with HSQLDB.  For me, HSQLDB is *also* returning
columnType = 12 for both of those scalars (and Hibernate then returns
Strings for both)...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Steve Ebersole
Sent: Thursday, June 22, 2006 3:37 PM
To: Hibernate development
Subject: Re: [Hibernate] New error on Annotation query

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 = 12 (java.sql.Types.VARCHAR) for both of
these columns.  It's not like I can return numerics for all columnType =
12 auto-discoveries...

-Original Message-
From: Emmanuel Bernard [mailto:[EMAIL PROTECTED] 
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: [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

Re: [Hibernate] New error on Annotation query

2006-06-21 Thread Steve Ebersole
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=lnkkid=107521bid=248729dat=121642
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] New error on Annotation query

2006-06-21 Thread Emmanuel Bernard
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=lnkkid=107521bid=248729dat=121642
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] New error on Annotation query

2006-06-21 Thread Max Rydahl Andersen

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=lnkkid=107521bid=248729dat=121642
 ___
 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]

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 

Re: [Hibernate] New error on Annotation query

2006-06-21 Thread Max Rydahl Andersen

btw. does the spec say about the conversion rules for this ?

/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=lnkkid=107521bid=248729dat=121642
 ___
 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]

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=lnkkid=107521bid=248729dat=121642

Re: [Hibernate] New error on Annotation query

2006-06-21 Thread Steve Ebersole
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=lnkkid=107521bid=248729dat=121642
 ___
 hibernate-devel mailing list
 hibernate-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/hibernate-devel



-- 
--
Max Rydahl Andersen
callto

Re: [Hibernate] New error on Annotation query

2006-06-21 Thread Steve Ebersole
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

Re: [Hibernate] New error on Annotation query

2006-06-21 Thread Emmanuel Bernard
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

Re: [Hibernate] New error on Annotation query

2006-06-20 Thread Max Rydahl Andersen

I've just committed a test for the mixed setup. It passed before and fails  
now - for some reason the addScalar column name is not passed downwards  
to the autodiscovery ?

/max

 From my understanding in discussions with Max, auto-discovery is illegal
 once any returns have been defined/added.

 Max, can you clarify here?  Thinking some more about it, maybe you just
 meant the column name discovery (as it should be possible to still
 auto-discover types in this scenario)?

 Also, in general, we need to make certain that these types of
 integration point tests are defined within the Hibernate test suite
 proper so that we can catch these discrepancies earlier...

 -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


 ___
 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]


___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] New error on Annotation query

2006-06-19 Thread Steve Ebersole
From my understanding in discussions with Max, auto-discovery is illegal
once any returns have been defined/added.

Max, can you clarify here?  Thinking some more about it, maybe you just
meant the column name discovery (as it should be possible to still
auto-discover types in this scenario)?

Also, in general, we need to make certain that these types of
integration point tests are defined within the Hibernate test suite
proper so that we can catch these discrepancies earlier...

-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


___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] New error on Annotation query

2006-06-19 Thread Max Andersen
Title: Re: [Hibernate] New error on Annotation query





From my understanding in discussions with Max, 
auto-discovery is illegalonce any returns have been 
defined/added.Max, can you clarify here? Thinking some more about 
it, maybe you justmeant the column name discovery (as it should be possible 
to stillauto-discover types in this scenario)?
Yes - autodiscover of scalar types should always be 
possible.
name discovery is only possible activated when nothing 
is added to the query.
Also, in general, we need to make certain that 
these types of"integration point tests" are defined within the Hibernate 
test suiteproper so that we can catch these discrepancies 
earlier...
I dont have a working setup here at the moment - but there 
definitly should be test for this part.
But maybe this specific case of mixed add's might be 
missed.
-max

-Original Message-From: 
[EMAIL PROTECTED][mailto:[EMAIL PROTECTED]] 
On Behalf OfEmmanuel BernardSent: Sunday, June 18, 2006 10:21 PMTo: 
Hibernate developmentSubject: [Hibernate] New error on Annotation 
queryHas something changed that I haven't propagated in my 
code?org.hibernate.HibernateException: cannot perform autodiscovery 
onqueries with non-scalar results 
atorg.hibernate.loader.custom.CustomLoader$NonScalarResultColumnProcessor.performDiscovery(CustomLoader.java:453) 
atorg.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) 
atorg.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224) 
at org.hibernate.loader.Loader.doList(Loader.java:2144) 
atorg.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028) 
at org.hibernate.loader.Loader.list(Loader.java:2023) 
atorg.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:290) 
atorg.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695) 
atorg.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142) 
at 
org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150) 
atorg.hibernate.test.annotations.query.QueryTest.testNativeQueryAndCompositePKAndComponents(QueryTest.java:195) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method) 
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at 
org.hibernate.test.annotations.TestCase.runTest(TestCase.java:67) 
atcom.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method) 
atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
atcom.intellij.rt.execution.application.AppMain.main(AppMain.java:90)@NamedNativeQuery(name 
= "compositekey", query = "select 
name, model, speed, lname as lastn, fname asfirstn, length, width, length * 
width as surface, length * width *10 asvolume 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 listhibernate-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/hibernate-devel___hibernate-devel 
mailing listhibernate-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/hibernate-devel


___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel