Top Description Methods
org.hibernate.annotations

public @Interface HQLSelect

extends Annotation
Annotations
@Target:TYPE, FIELD, METHOD
@Retention:RUNTIME
Imports
java.lang.annotation.Retention, .Target

Specifies a custom HQL/JPQL query to be used in place of the default SQL generated by Hibernate when an entity or collection is fetched from the database by id. This occurs when:

The given HQL query must have exactly one parameter which accepts the id of the entity or of the entity which owns the collection. It must return a single item in the select list, and that item must be the correct type of entity or collection element.

Implementation Note

This annotation is just an abbreviation for Loader together with NamedQuery.

Author
Gavin King
Since
6.2
See Also
SQLSelect

Method Summary

Modifier and TypeMethod and Description
public String
query()

The HQL SELECT statement.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

queryback to summary
public String query()

The HQL SELECT statement.