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.
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