Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Select query

 
Pradeeep Sharma
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
First Merry Christmas to all!

I am new to hibernate i am facing problem in implementing HQL for select query. Below is my hbm file:


and the related HQL for this in POJO class


but when I try to run this i got error message like this:
Hibernate: select register0_.FIRSTNAME as col_0_0_, register0_.LASTNAME as col_1_0_, register0_.EMAIL as col_2_0_ from CONTACT register0_
java.lang.String

As the name has changed in query i am not able to get any record from database.
Can any one tell me what s the actual solution for this problem.

With Regards,
Pradeep Sharma
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this the only error you get? Try running this query in DB directly..
 
Pradeeep Sharma
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes!
But when i run the same query in simple java file it runs fine, and in jsp code it's creating problem. I mean i not getting any record.
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I want to see the full code of the above class
 
Pradeeep Sharma
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Lucene china
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,can you sure that session Object is created?in jsp code.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using Hibernate if you're just going to query with SQL and transfer the results manually to the objects? Avoiding that is the whole point of Hibernate.

I also don't see any error message, did you forget to post it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic