This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes A query with HQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "A query with HQL " Watch "A query with HQL " New topic

A query with HQL

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

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

Save India From Corruption - Anna Hazare.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

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).

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

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 .
Consider Paul's rocket mass heater.
subject: A query with HQL
Similar Threads
How to select all datas from DB using HQL
Stored Procedure inside HQL query?
retrive data
Hibernate Doubt in HQL
Left join using on keyword (Hibernate)