-->
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: HSQL Select column AS Alias - java.sql.SQLException
PostPosted: Thu Nov 05, 2009 5:07 am 
Newbie

Joined: Sun Oct 11, 2009 7:17 pm
Posts: 8
Hi

I have the below SQL query

Code:
String SQL_QUERY = "SELECT c.ID AS customerName, com.name AS companyName FROM customers c, company com";
      
System.out.println(SQL_QUERY);
   
Session s = HibernateUtil.getCurrentSession();
s.createSQLQuery(SQL_QUERY).list();



This results in java.sql.SQLException: Column 'ID' not found.

Why? O'why?
Has been driving me nuts. The SQL is valid as I copy/past the println into mysql and it loves it!

Cheers

Kris

_________________
Kremsoft
Software Development Outsourcing http://www.kremsoft.com


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.