• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A query with HQL

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am praticing Hibernate HQL through Eclipse HQL Editor .

Could anybody please let me know why the FIrst Statement is executed while the second throws an Error .

select NAME , PASSWORD from Users 1st query

select * from Users
2nd query

Please suggest . Thank
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Impossible to say without knowing what error is thrown. Both look OK (though the property names in the first look a bit suspect for a Java class).
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul ,

You were correct that without seeing the POJO types we cant say whats the problem in case of writing HQL .

Assume taht this is my code inside a Java Object .



I just want to ask that , is it possbile to use normal SQL queries within @Namedquery , or should it be HQL queries only

Please advice , thanks .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic