-->
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: Native Queries
PostPosted: Wed Oct 29, 2003 9:25 pm 
Newbie

Joined: Mon Oct 20, 2003 12:18 pm
Posts: 12
Location: Mexico
Hi, Im trying to use Native Queries with the following code
Code:
   public static void findTest(Session session) throws HibernateException { 
      //"SELECT {fecha}.descripcion AS  {fecha}.descripcion FROM segu_fecha_inhabil {fecha} WHERE {fecha}.fecha NOT IN (SELECT z.fecha FROM segu_sistema_fecha_inhabil z WHERE z.sistema='TELLER')",
      List result = session.createSQLQuery(
         "SELECT {f}.descripcion AS {f.descripcion} FROM segu_fecha_inhabil {f} WHERE {f}.fecha NOT IN (SELECT z.fecha FROM segu_sistema_fecha_inhabil z WHERE z.sistema='TELLER')",
         "f", SeguFechasInhabiles.class).list();


When I used a database enviroment I dont have any problem with this. But if I use this in one application the weblogic display me that:



Code:
<Oct 29, 2003 7:02:02 PM CST> <Warning> <Log4JBridge> <000000> <3249515 [Execute
Thread: '13' for queue: 'weblogic.kernel.Default'] WARN  net.sf.hibernate.util.J
DBCExceptionReporter  - SQL Error: 904, SQLState: 42000 >
<Oct 29, 2003 7:02:02 PM CST> <Error> <Log4JBridge> <000000> <3249515 [ExecuteTh
read: '13' for queue: 'weblogic.kernel.Default'] ERROR net.sf.hibernate.util.JDB
CExceptionReporter  - ORA-00904: invalid column name
        >
<Oct 29, 2003 7:02:02 PM CST> <Error> <Log4JBridge> <000000> <3249515 [ExecuteTh
read: '13' for queue: 'weblogic.kernel.Default'] ERROR net.sf.hibernate.util.JDB
CExceptionReporter  - SQLException occurred
java.sql.SQLException: ORA-00904: invalid column name

        at oracle.jdbc.dbaccess.DBError.throwSqlException(Ljava.lang.String;Ljav
a.lang.String;I)V(DBError.java:134)
        at oracle.jdbc.ttc7.TTIoer.processError()V(TTIoer.java:289)
        at oracle.jdbc.ttc7.Oall7.receive()V(Oall7.java:579)
        at oracle.jdbc.ttc7.TTC7Protocol.doOall7(BBI[B[Loracle.jdbc.dbaccess.DBT
ype;[Loracle.jdbc.dbaccess.DBData;I[Loracle.jdbc.dbaccess.DBType;[Loracle.jdbc.d
baccess.DBData;I)V(TTC7Protocol.java:1892)
        at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(Loracle.jdbc.dbacc
ess.DBStatement;[BLoracle.jdbc.dbaccess.DBDataSet;)[Loracle.jdbc.dbaccess.DBColu
mn;(TTC7Protocol.java:830)
        at oracle.jdbc.driver.OracleStatement.doExecuteQuery()V(OracleStatement.
java:2488)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()V(OracleStat
ement.java:2832)
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()I(OraclePre
paredStatement.java:608)
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery()Ljava.sql.Re
sultSet;(OraclePreparedStatement.java:536)
        at weblogic.jdbc.wrapper.PreparedStatement.executeQuery()Ljava.sql.Resul
tSet;(PreparedStatement.java:80)
        at net.sf.hibernate.impl.BatcherImpl.getResultSet(Ljava.sql.PreparedStat
ement;)Ljava.sql.ResultSet;(BatcherImpl.java:81)
        at net.sf.hibernate.loader.Loader.getResultSet(Ljava.sql.PreparedStateme
nt;Lnet.sf.hibernate.engine.RowSelection;Lnet.sf.hibernate.engine.SessionImpleme
ntor;)Ljava.sql.ResultSet;(Loader.java:629)
        at net.sf.hibernate.loader.Loader.doResultSet(Lnet.sf.hibernate.engine.S
essionImplementor;[Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;Ljava.lang.Obj
ect;Ljava.io.Serializable;[Ljava.io.Serializable;ZLnet.sf.hibernate.engine.RowSe
lection;Ljava.util.Map;Ljava.util.Map;)Ljava.util.List;(Loader.java:171)
        at net.sf.hibernate.loader.Loader.doFind(Lnet.sf.hibernate.engine.Sessio
nImplementor;[Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;Ljava.lang.Object;L
java.io.Serializable;[Ljava.io.Serializable;ZLnet.sf.hibernate.engine.RowSelecti
on;Ljava.util.Map;Ljava.util.Map;)Ljava.util.List;(Loader.java:113)
        at net.sf.hibernate.loader.Loader.find(Lnet.sf.hibernate.engine.SessionI
mplementor;[Ljava.lang.Object;[Lnet.sf.hibernate.type.Type;ZLnet.sf.hibernate.en
gine.RowSelection;Ljava.util.Map;Ljava.util.Map;)Ljava.util.List;(Loader.java:73
6)


If somenone Can help me I will be very greatful.
Thanks for advance


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.