Top Methods
org.hibernate.query.sql.spi

public Interface NativeQueryImplementor<R>

extends QueryImplementor<R>, NativeQuery<R>, NameableQuery
Known Direct Implementers
org.hibernate.query.sql.internal.NativeQueryImpl
Annotations
@Incubating
Imports
java.time.Instant, java.util.Calendar, .Collection, .Date, .Map, org.hibernate.CacheMode, .FlushMode, .Incubating, .LockMode, .LockOptions, .MappingException, org.hibernate.metamodel.model.domain.BasicDomainType, org.hibernate.query.BindableType, .NativeQuery, .QueryParameter, .ResultListTransformer, .TupleTransformer, org.hibernate.query.named.NameableQuery, org.hibernate.query.results.dynamic.DynamicResultBuilderEntityStandard, org.hibernate.query.spi.QueryImplementor, org.hibernate.transform.ResultTransformer, jakarta.persistence.AttributeConverter, .FlushModeType, .LockModeType, .Parameter, .TemporalType, jakarta.persistence.metamodel.SingularAttribute

Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public NativeQueryImplementor<R>
addAttributeResult(String columnAlias, Class<T> entityJavaType, String attributePath)

Redeclares org.hibernate.query.NativeQuery.addAttributeResult.

Defines a result based on a specified attribute.
public NativeQueryImplementor<R>
addAttributeResult(String columnAlias, String entityName, String attributePath)

Redeclares org.hibernate.query.NativeQuery.addAttributeResult.

Defines a result based on a specified attribute.
public NativeQueryImplementor<R>
addAttributeResult(String columnAlias, SingularAttribute<X, T> attribute)

Redeclares org.hibernate.query.NativeQuery.addAttributeResult.

Defines a result based on a specified attribute.
public NativeQueryImplementor<R>
addEntity(String
The entity name that is the root return of the query
entityName
)

Redeclares org.hibernate.query.NativeQuery.addEntity.

Declare a "root" entity, without specifying an alias.
public NativeQueryImplementor<R>
addEntity(String
The SQL table alias
tableAlias
,
String
The entity name
entityName
)

Redeclares org.hibernate.query.NativeQuery.addEntity.

Declare a "root" entity.
public NativeQueryImplementor<R>
addEntity(String
The SQL table alias
tableAlias
,
String
The entity name
entityName
,
LockMode
The lock mode for this return.
lockMode
)

Redeclares org.hibernate.query.NativeQuery.addEntity.

Declare a "root" entity, specifying a lock mode.
public NativeQueryImplementor<R>
addEntity(Class<T>
The java type of the entity to add as a root
entityType
)

Redeclares org.hibernate.query.NativeQuery.addEntity.

Declare a "root" entity, without specifying an alias.
public NativeQueryImplementor<R>
addEntity(Class<R> entityType, LockMode lockMode)

public NativeQueryImplementor<R>
addEntity(String
The SQL table alias
tableAlias
,
Class<T>
The java type of the entity to add as a root
entityType
)

Redeclares org.hibernate.query.NativeQuery.addEntity.

Declare a "root" entity.
public NativeQueryImplementor<R>
addEntity(String
The SQL table alias
tableAlias
,
Class<T>
The entity Class
entityClass
,
LockMode
The lock mode for this return
lockMode
)

Redeclares org.hibernate.query.NativeQuery.addEntity.

Declare a "root" entity, specifying a lock mode.
public NativeQueryImplementor<R>
addJoin(String
The SQL table alias for the data to be mapped to this fetch.
tableAlias
,
String
The association path of form [owner-alias].[property-name].
path
)

Redeclares org.hibernate.query.NativeQuery.addJoin.

Declare a join fetch result.
public NativeQueryImplementor<R>
addJoin(String
The SQL table alias for the data to be mapped to this fetch
tableAlias
,
String
Identify the table alias of the owner of this association. Should match the alias of a previously added root or fetch.
ownerTableAlias
,
String
The name of the property being join fetched.
joinPropertyName
)

Redeclares org.hibernate.query.NativeQuery.addJoin.

Declare a join fetch result.
public NativeQueryImplementor<R>
addJoin(String
The SQL table alias for the data to be mapped to this fetch
tableAlias
,
String
The association path of form [owner-alias].[property-name].
path
,
LockMode
The lock mode for this return.
lockMode
)

Redeclares org.hibernate.query.NativeQuery.addJoin.

Declare a join fetch result, specifying a lock mode.
public NativeQueryImplementor<R>
addQueryHint(String
The database specific query hint to add.
hint
)

Redeclares org.hibernate.query.Query.addQueryHint, org.hibernate.query.NativeQuery.addQueryHint.

Add a database query hint to the SQL query.
public void
addResultTypeClass(Class<?> resultClass)

public DynamicResultBuilderEntityStandard
addRoot(String
The SQL table alias to map to this entity
tableAlias
,
String
The name of the entity
entityName
)

Redeclares org.hibernate.query.NativeQuery.addRoot.

Add a new root return mapping, returning a RootReturn to allow further definition.
public NativeQueryImplementor<R>
addScalar(String
The column alias in the result set to be processed as a scalar result
columnAlias
)

Redeclares org.hibernate.query.NativeQuery.addScalar.

Declare a scalar query result.
public NativeQueryImplementor<R>
addScalar(String
The column alias in the result set to be processed as a scalar result
columnAlias
,
BasicDomainType<J>
The Hibernate type as which to treat the value.
type
)

Redeclares org.hibernate.query.NativeQuery.addScalar.

Declare a scalar query result.
public NativeQueryImplementor<R>
addScalar(String columnAlias, Class<T> javaType)

Redeclares org.hibernate.query.NativeQuery.addScalar.

Declare a scalar query result using the specified result type.
public <C> NativeQueryImplementor<R>
addScalar(String columnAlias, Class<C>
The Java type expected by the converter as its "relational" type.
relationalJavaType
,
AttributeConverter<?, C>
The conversion to apply. Consumes the JDBC value based on relationalJavaType.
converter
)

Redeclares org.hibernate.query.NativeQuery.addScalar.

Declare a scalar query result with an explicit conversion.
public <O, J> NativeQueryImplementor<R>
addScalar(String columnAlias, Class<O>
The Java type expected by the converter as its "object model" type.
domainJavaType
,
Class<J>
The Java type expected by the converter as its "relational model" type.
jdbcJavaType
,
AttributeConverter<O, J>
The conversion to apply. Consumes the JDBC value based on relationalJavaType.
converter
)

Redeclares org.hibernate.query.NativeQuery.addScalar.

Declare a scalar query result with an explicit conversion.
public <C> NativeQueryImplementor<R>
addScalar(String columnAlias, Class<C>
The Java type expected by the converter as its "relational" type.
relationalJavaType
,
Class<? extends AttributeConverter<?, C>>
The conversion to apply. Consumes the JDBC value based on relationalJavaType.
converter
)

Redeclares org.hibernate.query.NativeQuery.addScalar.

Declare a scalar query result with an explicit conversion.
public <O, J> NativeQueryImplementor<R>
addScalar(String columnAlias, Class<O>
The Java type expected by the converter as its "object model" type.
domainJavaType
,
Class<J>
The Java type expected by the converter as its "relational model" type.
jdbcJavaType
,
Class<? extends AttributeConverter<O, J>>
The conversion to apply. Consumes the JDBC value based on relationalJavaType.
converter
)

Redeclares org.hibernate.query.NativeQuery.addScalar.

Declare a scalar query result with an explicit conversion.
public NativeQueryImplementor<R>
addSynchronizedEntityClass(Class<T>
The class of the entity.
entityClass
)

Redeclares org.hibernate.query.NativeQuery.addSynchronizedEntityClass.

Add all query spaces associated with the entity with the given type.
public NativeQueryImplementor<R>
addSynchronizedEntityName(String
The name of an entity.
entityName
)

Redeclares org.hibernate.query.NativeQuery.addSynchronizedEntityName.

Add all query spaces associated with the entity with the given names.
public NativeQueryImplementor<R>
addSynchronizedQuerySpace(String
The name of the query space, usually the name of a database table.
querySpace
)

Redeclares org.hibernate.query.NativeQuery.addSynchronizedQuerySpace.

Add a query space.
public Boolean
isSelectQuery()

Best guess whether this is a select query.

public NativeQueryImplementor<R>
setCacheable(boolean cacheable)

Redeclares org.hibernate.query.Query.setCacheable, org.hibernate.query.NativeQuery.setCacheable.

Enable/disable second level query (result) caching for this query.
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
setCacheRegion(String cacheRegion)

Redeclares org.hibernate.query.Query.setCacheRegion, org.hibernate.query.NativeQuery.setCacheRegion.

Set the name of the cache region where query results should be cached (assuming isCacheable).
public NativeQueryImplementor<R>
setComment(String
The human-readable comment
comment
)

Redeclares org.hibernate.query.Query.setComment, org.hibernate.query.NativeQuery.setComment.

Set the comment for this query.
public NativeQueryImplementor<R>
setFetchSize(int
the fetch size hint
fetchSize
)

Redeclares org.hibernate.query.Query.setFetchSize, org.hibernate.query.NativeQuery.setFetchSize.

Sets a JDBC fetch size hint for the query.
public NativeQueryImplementor<R>
setFirstResult(int
position of the first result, numbered from 0
startPosition
)

Redeclares org.hibernate.query.Query.setFirstResult, org.hibernate.query.NativeQuery.setFirstResult.

Set the first row position to return from the query results.
public NativeQueryImplementor<R>
setFlushMode(FlushModeType
flush mode
flushMode
)

Redeclares org.hibernate.query.Query.setFlushMode, org.hibernate.query.NativeQuery.setFlushMode.

Set the flush mode type to be used for the query execution.
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
setHint(String
name of property or hint
hintName
,
Object
value for the property or hint
value
)

Redeclares org.hibernate.query.Query.setHint, org.hibernate.query.NativeQuery.setHint.

Set a query property or hint.
public NativeQueryImplementor<R>
setLockMode(LockModeType
lock mode
lockMode
)

Redeclares org.hibernate.query.Query.setLockMode, org.hibernate.query.NativeQuery.setLockMode.

Not applicable to native SQL queries, due to an unfortunate requirement of the JPA specification.
public NativeQueryImplementor<R>
setLockMode(String
A query alias
alias
,
LockMode
The lock mode to apply
lockMode
)

Redeclares org.hibernate.query.Query.setLockMode, org.hibernate.query.NativeQuery.setLockMode.

Not applicable to native SQL queries.
public NativeQueryImplementor<R>
setLockOptions(LockOptions
The lock options to apply to the query.
lockOptions
)

Redeclares org.hibernate.query.Query.setLockOptions, org.hibernate.query.NativeQuery.setLockOptions.

Apply the given lock options to this query.
public NativeQueryImplementor<R>
setMaxResults(int
maximum number of results to retrieve
maxResult
)

Redeclares org.hibernate.query.Query.setMaxResults, org.hibernate.query.NativeQuery.setMaxResults.

Set the max number of rows requested for the query results.
public NativeQueryImplementor<R>
setParameter(String
parameter name
name
,
Object
parameter value
val
)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind the given argument to a named query parameter.
public <P> NativeQueryImplementor<R>
setParameter(String name, P val, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind the given argument to a named query parameter using the given BindableType.
public <P> NativeQueryImplementor<R>
setParameter(String name, P val, Class<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind the given argument to a named query parameter using the given Class reference to attempt to determine the BindableType to use.
public NativeQueryImplementor<R>
setParameter(String name, Instant value, TemporalType temporalType)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind an Instant value to the named query parameter using just the portion indicated by the given TemporalType.
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
setParameter(int
position
position
,
Object
parameter value
val
)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind the given argument to an ordinal query parameter.
public <P> NativeQueryImplementor<R>
setParameter(int position, P val, Class<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind the given argument to an ordinal query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameter(int position, P val, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind the given argument to an ordinal query parameter using the given BindableType.
public NativeQueryImplementor<R>
setParameter(int position, Instant value, TemporalType temporalType)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind an Instant value to the ordinal query parameter using just the portion indicated by the given TemporalType.
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
public <P> NativeQueryImplementor<R>
setParameter(QueryParameter<P>
the query parameter memento
parameter
,
P
the argument, which might be null
val
)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter.
public <P> NativeQueryImplementor<R>
setParameter(QueryParameter<P>
the query parameter memento
parameter
,
P
the argument, which might be null
val
,
Class<P>
a BindableType representing the type of the parameter
type
)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameter(QueryParameter<P>
the query parameter memento
parameter
,
P
the argument, which might be null
val
,
BindableType<P>
an BindableType representing the type of the parameter
type
)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.NativeQuery.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter using the given BindableType.
public <P> NativeQueryImplementor<R>
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
public NativeQueryImplementor<R>
public <P> NativeQueryImplementor<R>
setParameterList(String name, Collection<? extends P> values, Class<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameterList(String name, Collection<? extends P> values, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to a named query parameter using the given BindableType.
public NativeQueryImplementor<R>
public <P> NativeQueryImplementor<R>
setParameterList(String name, P[] values, Class<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameterList(String name, P[] values, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to a named query parameter using the given BindableType.
public NativeQueryImplementor<R>
setParameterList(int position, Collection<E> values)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to an ordinal query parameter.
public <P> NativeQueryImplementor<R>
setParameterList(int position, Collection<? extends P> values, Class<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameterList(int position, Collection<? extends P> values, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given BindableType.
public NativeQueryImplementor<R>
setParameterList(int position, Object[] values)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to an ordinal query parameter.
public <P> NativeQueryImplementor<R>
setParameterList(int position, P[] values, Class<P> javaType)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameterList(int position, P[] values, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given BindableType.
public <P> NativeQueryImplementor<R>
setParameterList(QueryParameter<P>
the parameter memento
parameter
,
Collection<? extends P>
a collection of arguments
values
)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter.
public <P> NativeQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter, inferring the BindableType.
public <P> NativeQueryImplementor<R>
setParameterList(QueryParameter<P>
the parameter memento
parameter
,
P[]
a collection of arguments
values
)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter.
public <P> NativeQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter using the given Class reference to attempt to determine the BindableType to use.
public <P> NativeQueryImplementor<R>
setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)

Redeclares org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.NativeQuery.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter, inferring the BindableType.
public NativeQueryImplementor<R>
setProperties(Object
any JavaBean or POJO
bean
)

Redeclares org.hibernate.query.spi.QueryImplementor.setProperties, org.hibernate.query.NativeQuery.setProperties.

Bind the property values of the given bean to named parameters of the query, matching property names with parameter names and mapping property types to Hibernate types using heuristics.
public NativeQueryImplementor<R>
setProperties(Map<K, V>
a Map of names to arguments
bean
)

Redeclares org.hibernate.query.spi.QueryImplementor.setProperties, org.hibernate.query.NativeQuery.setProperties.

Bind the values of the given Map for each named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.
public NativeQueryImplementor<R>
setReadOnly(boolean
true indicates that entities and proxies loaded by the query are to be put in read-only mode; false indicates that entities and proxies loaded by the query will be put in modifiable mode
readOnly
)

Redeclares org.hibernate.query.Query.setReadOnly, org.hibernate.query.NativeQuery.setReadOnly.

Set the read-only/modifiable mode for entities and proxies loaded by this Query.
public NativeQueryImplementor<R>
public default <T> NativeQueryImplementor<T>
public NativeQueryImplementor<R>
setTimeout(int
the timeout in seconds
timeout
)

Redeclares org.hibernate.query.Query.setTimeout, org.hibernate.query.NativeQuery.setTimeout.

Set the query timeout in seconds.
public <T> NativeQueryImplementor<T>
public NamedNativeQueryMemento
toMemento(String name)

Redeclares org.hibernate.query.named.NameableQuery.toMemento.

Convert the query into the memento
Inherited from org.hibernate.query.NativeQuery:
addFetchaddInstantiationaddRootaddScalargetHibernateLockModegetLockModegetLockOptionssetCacheRetrieveModesetCacheStoreMode
Inherited from org.hibernate.query.spi.QueryImplementor:
getParameterBindingsgetSessionscrollscrollsetOptionalEntityNamesetOptionalIdsetOptionalObject