Hql statements are designedUnderstanding of multi-state queries, From, followed by the persistence class name, not only query all instances of the persistence class, but also query all instances of the subclass of the class:
From person as P
This query statement not only queries all instances of the person, but also the child classes of the person, such as all instances of the teacher, provided that the person and teacher have completed the correct inheritance ing.
Hql supports specifying any Java class or interface in the from clause. The query returns an instance that inherits the persistence subclass of the class or an instance of the persistence class that implements the interface. The following query statement returns all persistent objects:
From Java. Lang. Object o
If the named interface has multiple persistence implementation classes, the following statement returns all instances of these persistence classes:
From named as N