This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Object Relational Mapping and the fly likes Fetching data from the database table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Fetching data from the database table" Watch "Fetching data from the database table" New topic
Author

Fetching data from the database table

Balasubramanian Krishnaswamy
Greenhorn

Joined: Jun 26, 2007
Posts: 24
Hi All,
I am wondering if there is a way in Hibernate where in I can query the database and retrieve data from a table without writing SQL and any type of HQL.
Can someone help me to crack this question? Is Collection concept in Hibernate anything to do with this query?

Thanks
Bala
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Balasubramanian Krishnaswamy wrote:Hi All,
I am wondering if there is a way in Hibernate where in I can query the database and retrieve data from a table without writing SQL and any type of HQL.
Can someone help me to crack this question? Is Collection concept in Hibernate anything to do with this query?

Thanks
Bala


yes, there are. this is one of the powers of hibernate. you will use org.hibernate.Session for this, normally using get.

good references:
http://docs.jboss.org/hibernate/stable/core/reference/en/html/
https://www.hibernate.org/hib_docs/v3/api/
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Fetching data from the database table