Solved

from clause in Hibernate

Posted on 2010-11-11
2
364 Views
Last Modified: 2012-05-10
What should I use within the from clause of the Hibernate(HQL).

Is it the name of the table or the name of the class.

Suppose if we have a table with name "Employee" and it's corresponding mapping class "Person"

so should we say it as "from Employee" or "from Person" in order to get all the details.
0
Comment
Question by:shragi
  • 2
2 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 50 total points
Comment Utility
You use the class name, Employee
0
 
LVL 58

Assisted Solution

by:cyberkiwi
cyberkiwi earned 50 total points
Comment Utility
Your class name is Person, sorry, it is "from Person"

http://docs.jboss.org/hibernate/core/3.3/reference/en/html/queryhql.html#queryhql-from

This returns all instances of the class eg.Cat.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Read about achieving the basic levels of HRIS security in the workplace.
The viewer will learn how to set up a document for the web and print and the recommended PPI for printing.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now