Use of From in HQL and SQL by R4R Team

form is the simplest hibernate query.This returns all instances of the class eg.Student. By the use of usually need to qualify the class name, since auto-import is the default. Order to refer to the Student in other parts of the query, you will need to assign an alias.

Example:

from eg.Student

from Student

from Student as boy----> here we assign an alias

This query assigns the alias boy to Student instances, so here you can use that alias later in the query. The as keyword is optional. 

We can also write in other word:

from Student boy

Multiple classes can appear, resulting in a cartesian product or "cross" join. It is good practice to name query aliases using an initial lowercase as this is consistent with Java naming standards for local variables (e.g. domesticStudent).

from Formula, Parameter

from Formula as form, Parameter as param
Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!