-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem trying to debug createSQLQuery() calls...
PostPosted: Mon Jul 26, 2004 6:39 pm 
Beginner
Beginner

Joined: Mon Dec 01, 2003 8:48 pm
Posts: 47
Location: Texas, United States
I am using Hiberante 2.1.1 with Oracle and the following SQL dialect
net.sf.hibernate.dialect.OracleDialect

Here's my Java:
Code:
String query = "SELECT cle.observed_time as {cle.observedTime} FROM ul_common_log_event {cle}";

public List find(String query) {
        Session session = null;
        List result = null;
        try {
            session = sessionFactory.openSession();
            String[] aliasArray = {"cle"};
            Class[] classArray = {CommonLogEvent.class};
            Query q = session.createSQLQuery(query, aliasArray, classArray);
            result = q.list();
        } catch (HibernateException ex) {
            ex.printStackTrace();
        }
        finally {
            close(session);
        }
        return result;
    }


This Java String is translated to:
Code:
Hibernate: SELECT cle.observed_time as observed2_0_ FROM ul_common_log_event cle


which produces the following error:
Code:
Caused by: java.sql.SQLException: Invalid column name


Here's part of the table definition:
Code:
CREATE TABLE UL_COMMON_LOG_EVENT
(
  CLE_ID            NUMBER(19)                  NOT NULL,
  OBSERVED_TIME     DATE,


Interestingly enough, when I run the Hibernate produced SQL in TOAD, it works just fine.

Has anyone had this issue before? I am sure that I am missing something.


Top
 Profile  
 
 Post subject: I'm havning the same problem
PostPosted: Wed Aug 18, 2004 12:51 pm 
Beginner
Beginner

Joined: Mon May 03, 2004 1:25 pm
Posts: 31
I'm having the same problem.


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

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.