This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "A query with HQL " Watch "A query with HQL " New topic
Author

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
Bartender

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 .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A query with HQL
 
Similar Threads
How to select all datas from DB using HQL
Stored Procedure inside HQL query?
Hibernate Doubt in HQL
retrive data
Left join using on keyword (Hibernate)