Solved

from clause in Hibernate

Posted on 2010-11-11
2
368 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
ID: 34118683
You use the class name, Employee
0
 
LVL 58

Assisted Solution

by:cyberkiwi
cyberkiwi earned 50 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

777 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