Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
3.3. Mapping Queries
3.3.Mapping JPAQL/HQL queries. Mapping JPAQL/HQL queries Link kopierenLink in die Zwischenablage kopiert!
Link kopierenLink in die Zwischenablage kopiert!
You can map EJBQL/HQL queries using annotations.
@NamedQuery
and @NamedQueries
can be defined at the class level or in a JPA XML file. However their definitions are global to the session factory/entity manager factory scope. A named query is defined by its name and the actual query string.
You can also provide some hints to a query through an array of
QueryHint
through a hints
attribute.
The availabe Hibernate hints are
hint | description |
---|---|
org.hibernate.cacheable | Whether the query should interact with the second level cache (default to false) |
org.hibernate.cacheRegion | Cache region name (default used otherwise) |
org.hibernate.timeout | Query timeout |
org.hibernate.fetchSize | resultset fetch size |
org.hibernate.flushMode | Flush mode used for this query |
org.hibernate.cacheMode | Cache mode used for this query |
org.hibernate.readOnly | Entities loaded by this query should be in read only mode or not (default to false) |
org.hibernate.comment | Query comment added to the generated SQL |