-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: createSQLQuery: "invalid identifier"
PostPosted: Tue Sep 28, 2004 11:00 am 
Newbie

Joined: Tue Aug 31, 2004 7:11 am
Posts: 2
Location: Israel
Hibernate version:
2.1.6

Mapping documents (partial):
<joined-subclass
name="com.nlayers.seneca.datamodel.Service"
table="service"
dynamic-update="false"
dynamic-insert="false"
>
<key
column="id"
/>

<many-to-one
name="host"
class="com.nlayers.seneca.datamodel.Host"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="host_id"
not-null="true"
/>

<property
name="knowledgeLevel"
type="int"
update="true"
insert="true"
column="knowledge_level"
/>

<property
name="hostService"
type="boolean"
update="true"
insert="true"
column="is_host_service"
/>

<many-to-one
name="product"
class="com.nlayers.seneca.datamodel.Product"
cascade="save-update"
outer-join="auto"
update="true"
insert="true"
column="product_id"
not-null="true"
/>

<set
name="serviceEndpoints"
lazy="false"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="service_id"
/>

<one-to-many
class="com.nlayers.seneca.datamodel.ServiceEndpoint"
/>
</set>

</joined-subclass>

Code between sessionFactory.openSession() and session.close():
Code:
Query quer = session.createSQLQuery("select {service.*} from service", "service", Service.class);
return quer.list();


Full stack trace of any exception that occurs:
16:29:23,436 WARN [JDBCExceptionReporter] SQL Error: 904, SQLState: 42000
16:29:23,449 ERROR [JDBCExceptionReporter] ORA-00904: "SERVICE_1_"."VER": invalid identifier

16:29:23,449 WARN [JDBCExceptionReporter] SQL Error: 904, SQLState: 42000
16:29:23,449 ERROR [JDBCExceptionReporter] ORA-00904: "SERVICE_1_"."VER": invalid identifier

16:29:23,449 ERROR [JDBCExceptionReporter] SQLException occurred
java.sql.SQLException: ORA-00904: "SERVICE_1_"."VER": invalid identifier

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:420)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:896)
at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:452)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:986)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2888)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2929)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:289)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.loader.SQLLoader.list(SQLLoader.java:92)
at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3806)
at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
at com.nlayers.seneca.datamodel.HibernatePGBean.simpleListSqlQuery(HibernatePGBean.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
at org.jboss.ejb.Container.invoke(Container.java:674)
at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:534)

Name and version of the database you are using:
Oracle 10g

The generated SQL (show_sql=true):
select service.id as id0_, service.host_id as host_id10_0_, service.knowledge_level as knowledg3_10_0_, service.is_host_service as is_host_4_10_0_, service.product_id as product_id10_0_, service_1_.ver as ver7_0_ from service

===============================================


Hi.
I have no idea why does the resulting query comes out with service_1_.ver instead of service.ver which is indeed an invalid identifier.

Any help/hint will be greatly appreciated.

Daniel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.