File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes retrive data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "retrive data" Watch "retrive data" New topic

retrive data

madhuchilipi reddy

Joined: Feb 09, 2007
Posts: 17
i am writing in sql my query is "select max(sid) from Student" this is my query.
how i write same query using HQL
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Its written pretty much the same as you would in SQL:

However, why do you want the max id? I would normally expect an aggregate function to be used on a numeric property, not the primary key?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: retrive data
It's not a secret anymore!