Top Description Fields Constructors Methods
org.hibernate.impl

public abstract Class AbstractQueryImpl

extends Object
implements Query
Class Inheritance
All Implemented Interfaces
org.hibernate.Query
Known Direct Subclasses
org.hibernate.impl.QueryImpl, org.hibernate.impl.SQLQueryImpl
Imports
java.io.Serializable, java.math.BigDecimal, .BigInteger, java.util.ArrayList, .Arrays, .Calendar, .Collection, .Date, .HashMap, .HashSet, .Iterator, .List, .Locale, .Map, .Set, org.hibernate.CacheMode, .FlushMode, .Hibernate, .HibernateException, .MappingException, .NonUniqueResultException, .PropertyNotFoundException, .Query, .QueryException, .LockOptions, org.hibernate.engine.QueryParameters, .RowSelection, .SessionImplementor, .TypedValue, org.hibernate.engine.query.ParameterMetadata, org.hibernate.hql.classic.ParserHelper, org.hibernate.property.Getter, org.hibernate.proxy.HibernateProxyHelper, org.hibernate.transform.ResultTransformer, org.hibernate.type.SerializableType, .Type, org.hibernate.util.ArrayHelper, .MarkerObject, .ReflectHelper, .StringHelper

Abstract implementation of the Query interface.
Authors
Gavin King, Max Andersen

Field Summary

Modifier and TypeField and Description
private boolean
private CacheMode
private String
private Serializable
private String
private FlushMode
private Map<K, V>
private Map<K, V>
private String
private Serializable
private Object
protected final ParameterMetadata
private final String
private Boolean
private ResultTransformer
private RowSelection
protected final SessionImplementor
private CacheMode
private FlushMode
private List<E>
private static final Object
private static final Object
private List<E>

Constructor Summary

AccessConstructor and Description
public
AbstractQueryImpl(String queryString, FlushMode flushMode, SessionImplementor session, ParameterMetadata parameterMetadata)

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
protected Type
determineType(int paramPosition, Object paramValue, Type defaultType)

protected Type
determineType(int paramPosition, Object paramValue)

protected Type
determineType(String paramName, Object paramValue, Type defaultType)

protected Type
determineType(String paramName, Object paramValue)

protected Type
determineType(String paramName, Class<T> clazz)

private String
expandParameterList(String query, String name, TypedValue typedList, Map<K, V> namedParamsCopy)

Warning

adds new parameters to the argument by side-effect, as well as mutating the query string!

protected String
expandParameterLists(Map<K, V> namedParamsCopy)

Warning

adds new parameters to the argument by side-effect, as well as mutating the query string!

public CacheMode
public abstract LockOptions
protected Map<K, V>

Returns:

The parameter list value map.
getNamedParameterLists
()

Retreive the value map for any named parameter lists (i.e., for auto-expansion) bound to this query.

public String[]

Returns:

Array of named parameter names.
getNamedParameters
()

Implements org.hibernate.Query.getNamedParameters.

Returns an array representing all named parameter names encountered during (intial) parsing of the query.
protected Map<K, V>

Returns:

Shallow copy of the named parameter value map
getNamedParams
()

Returns a shallow copy of the named parameter value map.

public ParameterMetadata
public QueryParameters
getQueryParameters(Map<K, V> namedParams)

public final String
getQueryString()

Implements org.hibernate.Query.getQueryString.

Get the query string.
public String[]
getReturnAliases()

Implements org.hibernate.Query.getReturnAliases.

Return the HQL select clause aliases (if any)
public Type[]
getReturnTypes()

Implements org.hibernate.Query.getReturnTypes.

Return the Hibernate types of the query result set.
protected RowSelection
public RowSelection
pack-priv SessionImplementor
protected List<E>

Returns:

The ordinal parameter types.
getTypes
()

Retreives the list of parameter types bound to this query for ordinal parameters.

protected List<E>

Returns:

The ordinal parameter values.
getValues
()

Retreives the list of parameter values bound to this query for ordinal parameters.

private Type
private Type
guessType(Class<T> clazz)

public boolean

Returns:

True if the query was found to contain named parameters; false otherwise;
hasNamedParameters
()

Does this query contain named parameters?

public boolean
isReadOnly()

Implements org.hibernate.Query.isReadOnly.

Should entities and proxies loaded by this Query be put in read-only mode?
private String
public Query
public Query
public Query
public Query
public Query
setBinary(int position, byte[] val)

Implements org.hibernate.Query.setBinary.

public Query
setBinary(String name, byte[] val)

Implements org.hibernate.Query.setBinary.

public Query
setBoolean(int position, boolean val)

Implements org.hibernate.Query.setBoolean.

public Query
setBoolean(String name, boolean val)

Implements org.hibernate.Query.setBoolean.

public Query
setByte(int position, byte val)

Implements org.hibernate.Query.setByte.

public Query
setByte(String name, byte val)

Implements org.hibernate.Query.setByte.

public Query
setCacheable(boolean
Should the query results be cacheable?
cacheable
)

Implements org.hibernate.Query.setCacheable.

Enable caching of this query result set.
public Query
setCacheMode(CacheMode cacheMode)

Implements org.hibernate.Query.setCacheMode.

Override the current session cache mode, just for this query.
public Query
setCacheRegion(String
the name of a query cache region, or null for the default query cache
cacheRegion
)

Implements org.hibernate.Query.setCacheRegion.

Set the name of the cache region.
public Query
setCalendar(int position, Calendar calendar)

Implements org.hibernate.Query.setCalendar.

public Query
public Query
public Query
public Query
setCharacter(int position, char val)

Implements org.hibernate.Query.setCharacter.

public Query
public Query
public Query
setComment(String
a human-readable string
comment
)

Implements org.hibernate.Query.setComment.

Add a comment to the generated SQL.
public Query
setDate(int position, Date date)

Implements org.hibernate.Query.setDate.

public Query
public Query
setDouble(int position, double val)

Implements org.hibernate.Query.setDouble.

public Query
setDouble(String name, double val)

Implements org.hibernate.Query.setDouble.

public Query
setEntity(int
the position of the parameter in the query string, numbered from 0.
position
,
Object
a non-null instance of a persistent class
val
)

Implements org.hibernate.Query.setEntity.

Bind an instance of a mapped persistent class to a JDBC-style query parameter.
public Query
setEntity(String
the name of the parameter
name
,
Object
a non-null instance of a persistent class
val
)

Implements org.hibernate.Query.setEntity.

Bind an instance of a mapped persistent class to a named query parameter.
public Query
setFetchSize(int
the fetch size
fetchSize
)

Implements org.hibernate.Query.setFetchSize.

Set a fetch size for the underlying JDBC query.
public Query
setFirstResult(int
a row number, numbered from 0
firstResult
)

Implements org.hibernate.Query.setFirstResult.

Set the first row to retrieve.
public Query
setFloat(int position, float val)

Implements org.hibernate.Query.setFloat.

public Query
setFloat(String name, float val)

Implements org.hibernate.Query.setFloat.

public Query
setFlushMode(FlushMode flushMode)

Implements org.hibernate.Query.setFlushMode.

Override the current session flush mode, just for this query.
public Query
setInteger(int position, int val)

Implements org.hibernate.Query.setInteger.

public Query
public Query
setLocale(int position, Locale locale)

Implements org.hibernate.Query.setLocale.

public Query
public Query
setLong(int position, long val)

Implements org.hibernate.Query.setLong.

public Query
setLong(String name, long val)

Implements org.hibernate.Query.setLong.

public Query
setMaxResults(int
the maximum number of rows
maxResults
)

Implements org.hibernate.Query.setMaxResults.

Set the maximum number of rows to retrieve.
public void
setOptionalEntityName(String optionalEntityName)

public void
public void
setOptionalObject(Object optionalObject)

public Query
setParameter(int
the position of the parameter in the query string, numbered from 0.
position
,
Object
the possibly-null parameter value
val
,
Type
the Hibernate type
type
)

Implements org.hibernate.Query.setParameter.

Bind a value to a JDBC-style query parameter.
public Query
setParameter(String
the name of the parameter
name
,
Object
the possibly-null parameter value
val
,
Type
the Hibernate type
type
)

Implements org.hibernate.Query.setParameter.

Bind a value to a named query parameter.
public Query
setParameter(int
the position of the parameter in the query string, numbered from 0.
position
,
Object
the non-null parameter value
val
)

Implements org.hibernate.Query.setParameter.

Bind a value to a JDBC-style query parameter.
public Query
setParameter(String
the name of the parameter
name
,
Object
the non-null parameter value
val
)

Implements org.hibernate.Query.setParameter.

Bind a value to a named query parameter.
public Query
setParameterList(String
the name of the parameter
name
,
Collection<E>
a collection of values to list
vals
,
Type
the Hibernate type of the values
type
)

Implements org.hibernate.Query.setParameterList.

Bind multiple values to a named query parameter.
public Query
setParameterList(String
the name of the parameter
name
,
Collection<E>
a collection of values to list
vals
)

Implements org.hibernate.Query.setParameterList.

Bind multiple values to a named query parameter.
public Query
setParameterList(String
the name of the parameter
name
,
Object[]
a collection of values to list
vals
,
Type
the Hibernate type of the values
type
)

Implements org.hibernate.Query.setParameterList.

Bind multiple values to a named query parameter.
public Query
setParameterList(String
the name of the parameter
name
,
Object[]
a collection of values to list
vals
)

Implements org.hibernate.Query.setParameterList.

Bind multiple values to a named query parameter.
public Query
setParameters(Object[] values, Type[] types)

Implements org.hibernate.Query.setParameters.

Bind values and types to positional parameters.
public Query
setProperties(Map<K, V>
a java.util.Map
map
)

Implements org.hibernate.Query.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 hueristics.
public Query
setProperties(Object
any JavaBean or POJO
bean
)

Implements org.hibernate.Query.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 hueristics.
public Query
setReadOnly(boolean
true, entities and proxies loaded by the query will be put in read-only mode false, entities and proxies loaded by the query will be put in modifiable mode
readOnly
)

Implements org.hibernate.Query.setReadOnly.

Set the read-only/modifiable mode for entities and proxies loaded by this Query.
public Query
setResultTransformer(ResultTransformer
The transformer to apply
transformer
)

Implements org.hibernate.Query.setResultTransformer.

Set a strategy for handling the query results.
public Query
public Query
public Query
setShort(int position, short val)

Implements org.hibernate.Query.setShort.

public Query
setShort(String name, short val)

Implements org.hibernate.Query.setShort.

public Query
setString(int position, String val)

Implements org.hibernate.Query.setString.

public Query
public Query
setText(int position, String val)

Implements org.hibernate.Query.setText.

public Query
public Query
setTime(int position, Date date)

Implements org.hibernate.Query.setTime.

public Query
public Query
setTimeout(int
the timeout in seconds
timeout
)

Implements org.hibernate.Query.setTimeout.

Set a timeout for the underlying JDBC query.
public Query
setTimestamp(int position, Date date)

Implements org.hibernate.Query.setTimestamp.

public Query
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public Type[]
pack-priv static Object
public Object
uniqueResult()

Implements org.hibernate.Query.uniqueResult.

Convenience method to return a single instance that matches the query, or null if the query returns no results.
public Object[]
protected void
verifyParameters()

Perform parameter validation.

protected void
verifyParameters(boolean
if true, the first ? will not be verified since its needed for e.g. callable statements returning a out parameter
reserveFirstParameter
)

Perform parameter validation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait