Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HQL Inner Join problem

 
subhashchandra medhiassam
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table a1. Its columns are:
identity(int type) and name(varchar type).

I am trying to perform an inner join on this table and then print out the first column of the result obtained.

Here, is the code snippet which is supposed to do this:



When i run this program, I am getting the following error message:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Hibernate: select a1x0_.identity as identity, a1x0_.name as name1_ from a1 a1x0_
a1 cannot be cast to [Ljava.lang.Object;


Kindly do let me know where i went wrong.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

The log4j warnings are simply because you don't have the log4j.xml or log4.properties properly configured (you need to have one in your classpath).

For the Hibernate error, are you sure that the object you are getting out of alElements is of type Object[]?

Can you also send us some more of the output? It will be interesting to see where the System.outs get to.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic