Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

from clause in Hibernate

Posted on 2010-11-11
2
Medium Priority
?
381 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 200 total points
ID: 34118683
You use the class name, Employee
0
 
LVL 58

Assisted Solution

by:cyberkiwi
cyberkiwi earned 200 total points
ID: 34118692
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Starting up a Project
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

810 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