From: Max R. A. <max...@jb...> - 2006-06-20 12:22:00
|
I've just committed a test for the mixed setup. It passed before and fai= ls = now - for some reason the "addScalar" column name is not passed downward= s = to the autodiscovery ? /max >> From my understanding in discussions with Max, auto-discovery is ille= gal > once any returns have been defined/added. > > Max, can you clarify here? Thinking some more about it, maybe you jus= t > 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: 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 > org.hibernate.loader.custom.CustomLoader$NonScalarResultColumnProcesso= r. > performDiscovery(CustomLoader.java:453) > at > org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoade= r. > 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(Loa= de > 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:1= 42 > ) > at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150) > at > org.hibernate.test.annotations.query.QueryTest.testNativeQueryAndCompo= si > tePKAndComponents(QueryTest.java:195) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j= av > a:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess= or > Impl.java:25) > at org.hibernate.test.annotations.TestCase.runTest(TestCase.java:6= 7) > at > com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:3= 2) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j= av > a:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess= or > 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 a= s > 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 > > > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel -- = -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate ma...@hi... http://hibernate.org JBoss Inc max...@jb... |