Solved

from clause in Hibernate

Posted on 2010-11-11
2
369 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Very Large data in MYSQL 7 75
Access 2016 Query with Proper Case logic 2 37
Import text from rows into columns? 12 47
SQL 2008 R2 2 8
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
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!
The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

820 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