|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.impl.AbstractQueryImpl
Abstract implementation of the Query interface
| Constructor Summary | |
AbstractQueryImpl(String queryString,
SessionImplementor session)
|
|
| Method Summary | |
protected String |
bindParameterLists(Map namedParamsCopy)
|
protected Map |
getNamedParameterLists()
|
String[] |
getNamedParameters()
Return the names of all named parameters of the query. |
protected Map |
getNamedParams()
|
QueryParameters |
getQueryParameters(Map namedParams)
|
String |
getQueryString()
Get the query string. |
Type[] |
getReturnTypes()
Return the Hibernate types of the query result set. |
protected RowSelection |
getRowSelection()
|
RowSelection |
getSelection()
|
protected List |
getTypes()
|
protected List |
getValues()
|
Query |
setBigDecimal(int position,
BigDecimal number)
|
Query |
setBigDecimal(String name,
BigDecimal number)
|
Query |
setBinary(int position,
byte[] val)
|
Query |
setBinary(String name,
byte[] val)
|
Query |
setBoolean(int position,
boolean val)
|
Query |
setBoolean(String name,
boolean val)
|
Query |
setByte(int position,
byte val)
|
Query |
setByte(String name,
byte val)
|
Query |
setCacheable(boolean cacheable)
Enable caching of this query result set. |
Query |
setCacheRegion(String cacheRegion)
Set the name of the cache region. |
Query |
setCalendar(int position,
Calendar calendar)
|
Query |
setCalendar(String name,
Calendar calendar)
|
Query |
setCalendarDate(int position,
Calendar calendar)
|
Query |
setCalendarDate(String name,
Calendar calendar)
|
Query |
setCharacter(int position,
char val)
|
Query |
setCharacter(String name,
char val)
|
Query |
setDate(int position,
Date date)
|
Query |
setDate(String name,
Date date)
|
Query |
setDouble(int position,
double val)
|
Query |
setDouble(String name,
double val)
|
Query |
setEntity(int position,
Object val)
Bind an instance of a mapped persistent class to a JDBC-style query parameter. |
Query |
setEntity(String name,
Object val)
Bind an instance of a mapped persistent class to a named query parameter. |
Query |
setEnum(int position,
Object val)
Bind an instance of a persistent enumeration class to a JDBC-style query parameter. |
Query |
setEnum(String name,
Object val)
Bind an instance of a mapped persistent enumeration class to a named query parameter. |
Query |
setFetchSize(int fetchSize)
Set a fetch size for the underlying JDBC query. |
Query |
setFirstResult(int firstResult)
Set the first row to retrieve. |
Query |
setFloat(int position,
float val)
|
Query |
setFloat(String name,
float val)
|
Query |
setForceCacheRefresh(boolean forceCacheRefresh)
Should the query force a refresh of the specified query cache region? This is particularly useful in cases where underlying data may have been updated via a seperate process (i.e., not modified through Hibernate) and allows the application to selectively refresh the query cache regions based on its knowledge of those events. |
Query |
setInteger(int position,
int val)
|
Query |
setInteger(String name,
int val)
|
Query |
setLocale(int position,
Locale locale)
|
Query |
setLocale(String name,
Locale locale)
|
void |
setLockMode(String alias,
LockMode lockMode)
Set the lockmode for the objects idententified by the given alias that appears in the FROM clause. |
Query |
setLong(int position,
long val)
|
Query |
setLong(String name,
long val)
|
Query |
setMaxResults(int maxResults)
Set the maximum number of rows to retrieve. |
Query |
setParameter(int position,
Object val)
Bind a value to a JDBC-style query parameter, guessing the Hibernate type from the class of the given object. |
Query |
setParameter(int position,
Object val,
Type type)
Bind a value to a JDBC-style query parameter. |
Query |
setParameter(String name,
Object val)
Bind a value to a named query parameter, guessing the Hibernate type from the class of the given object. |
Query |
setParameter(String name,
Object val,
Type type)
Bind a value to a named query parameter. |
Query |
setParameterList(String name,
Collection vals)
Bind multiple values to a named query parameter, guessing the Hibernate type from the class of the first object in the collection. |
Query |
setParameterList(String name,
Collection vals,
Type type)
Bind multiple values to a named query parameter. |
Query |
setParameterList(String name,
Object[] vals)
Bind multiple values to a named query parameter, guessing the Hibernate type from the class of the first object in the array. |
Query |
setParameterList(String name,
Object[] vals,
Type type)
Bind multiple values to a named query parameter. |
Query |
setProperties(Object bean)
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. |
Query |
setSerializable(int position,
Serializable val)
|
Query |
setSerializable(String name,
Serializable val)
|
Query |
setShort(int position,
short val)
|
Query |
setShort(String name,
short val)
|
Query |
setString(int position,
String val)
|
Query |
setString(String name,
String val)
|
Query |
setText(int position,
String val)
|
Query |
setText(String name,
String val)
|
Query |
setTime(int position,
Date date)
|
Query |
setTime(String name,
Date date)
|
Query |
setTimeout(int timeout)
Set a timeout for the underlying JDBC query. |
Query |
setTimestamp(int position,
Date date)
|
Query |
setTimestamp(String name,
Date date)
|
Type[] |
typeArray()
|
Object |
uniqueResult()
Convenience method to return a single instance that matches the query, or null if the query returns no results. |
Object[] |
valueArray()
|
protected void |
verifyParameters()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.hibernate.Query |
iterate, list, scroll, scroll |
| Constructor Detail |
public AbstractQueryImpl(String queryString, SessionImplementor session)
| Method Detail |
public final String getQueryString()
Query
getQueryString in interface Queryprotected Map getNamedParams()
protected void verifyParameters()
throws HibernateException
HibernateExceptionprotected Map getNamedParameterLists()
protected List getValues()
protected List getTypes()
public RowSelection getSelection()
public Query setMaxResults(int maxResults)
Query
setMaxResults in interface QuerymaxResults - the maximum number of rowspublic Query setTimeout(int timeout)
Query
setTimeout in interface Querytimeout - the timeout in secondspublic Query setFetchSize(int fetchSize)
Query
setFetchSize in interface QueryfetchSize - the fetch sizepublic Query setFirstResult(int firstResult)
Query
setFirstResult in interface QueryfirstResult - a row number, numbered from 0public Query setParameter(int position, Object val, Type type)
Query
setParameter in interface Queryposition - the position of the parameter in the query
string, numbered from 0.val - the possibly-null parameter valuetype - the Hibernate typepublic Query setString(int position, String val)
public Query setCharacter(int position, char val)
setCharacter in interface Querypublic Query setBoolean(int position, boolean val)
setBoolean in interface Querypublic Query setByte(int position, byte val)
public Query setShort(int position, short val)
public Query setInteger(int position, int val)
setInteger in interface Querypublic Query setLong(int position, long val)
public Query setFloat(int position, float val)
public Query setDouble(int position, double val)
public Query setBinary(int position, byte[] val)
public Query setText(int position, String val)
public Query setSerializable(int position, Serializable val)
setSerializable in interface Querypublic Query setDate(int position, Date date)
public Query setTime(int position, Date date)
public Query setTimestamp(int position, Date date)
setTimestamp in interface Querypublic Query setEntity(int position, Object val)
Query
position - the position of the parameter in the query
string, numbered from 0.val - a non-null instance of a persistent classpublic Query setEnum(int position, Object val) throws MappingException
Query
position - the position of the parameter in the query
string, numbered from 0.val - a non-null instance of a persistent enumeration
MappingExceptionpublic Query setLocale(int position, Locale locale)
public Query setCalendar(int position, Calendar calendar)
setCalendar in interface Querypublic Query setCalendarDate(int position, Calendar calendar)
setCalendarDate in interface Querypublic Query setBinary(String name, byte[] val)
public Query setText(String name, String val)
public Query setBoolean(String name, boolean val)
setBoolean in interface Querypublic Query setByte(String name, byte val)
public Query setCharacter(String name, char val)
setCharacter in interface Querypublic Query setDate(String name, Date date)
public Query setDouble(String name, double val)
public Query setEntity(String name, Object val)
Query
name - the name of the parameterval - a non-null instance of a persistent classpublic Query setEnum(String name, Object val) throws MappingException
Query
name - the name of the parameterval - a non-null instance of a persistent enumeration
MappingExceptionpublic Query setFloat(String name, float val)
public Query setInteger(String name, int val)
setInteger in interface Querypublic Query setLocale(String name, Locale locale)
public Query setCalendar(String name, Calendar calendar)
setCalendar in interface Querypublic Query setCalendarDate(String name, Calendar calendar)
setCalendarDate in interface Querypublic Query setLong(String name, long val)
public Query setParameter(String name, Object val, Type type)
Query
setParameter in interface Queryname - the name of the parameterval - the possibly-null parameter valuetype - the Hibernate typepublic Query setSerializable(String name, Serializable val)
setSerializable in interface Querypublic Query setShort(String name, short val)
public Query setString(String name, String val)
public Query setTime(String name, Date date)
public Query setTimestamp(String name, Date date)
setTimestamp in interface Querypublic Query setBigDecimal(int position, BigDecimal number)
setBigDecimal in interface Querypublic Query setBigDecimal(String name, BigDecimal number)
setBigDecimal in interface Querypublic Query setParameter(int position, Object val) throws HibernateException
Query
setParameter in interface Queryposition - the position of the parameter in the query
string, numbered from 0.val - the non-null parameter value
HibernateException - if no type could be determinedpublic Query setParameter(String name, Object val) throws HibernateException
Query
setParameter in interface Queryname - the name of the parameterval - the non-null parameter value
HibernateException - if no type could be determinedpublic Type[] getReturnTypes() throws HibernateException
Query
getReturnTypes in interface QueryHibernateExceptionpublic Query setParameterList(String name, Collection vals, Type type) throws HibernateException
Query
setParameterList in interface Queryname - the name of the parametervals - a collection of values to listtype - the Hibernate type of the values
HibernateExceptionprotected String bindParameterLists(Map namedParamsCopy)
public Query setParameterList(String name, Collection vals) throws HibernateException
Query
setParameterList in interface Queryname - the name of the parametervals - a collection of values to list
HibernateExceptionpublic String[] getNamedParameters() throws HibernateException
Query
getNamedParameters in interface QueryHibernateExceptionpublic Query setProperties(Object bean) throws HibernateException
Query
setProperties in interface Querybean - any JavaBean or POJO
HibernateExceptionpublic Query setParameterList(String name, Object[] vals, Type type) throws HibernateException
Query
setParameterList in interface Queryname - the name of the parametervals - a collection of values to listtype - the Hibernate type of the values
HibernateExceptionpublic Query setParameterList(String name, Object[] vals) throws HibernateException
Query
setParameterList in interface Queryname - the name of the parametervals - a collection of values to list
HibernateExceptionpublic void setLockMode(String alias, LockMode lockMode)
Query
setLockMode in interface Queryalias - a query alias, or this for a collection filterpublic Object uniqueResult() throws HibernateException
Query
uniqueResult in interface QueryHibernateException - if there is more than one matching resultprotected RowSelection getRowSelection()
public Type[] typeArray()
public Object[] valueArray()
public QueryParameters getQueryParameters(Map namedParams)
public Query setCacheable(boolean cacheable)
Query
setCacheable in interface Querycacheable - Should the query results be cacheable?public Query setCacheRegion(String cacheRegion)
Query
setCacheRegion in interface QuerycacheRegion - the name of a query cache region, or null
for the default query cachepublic Query setForceCacheRefresh(boolean forceCacheRefresh)
Query
setForceCacheRefresh in interface QueryforceCacheRefresh - Should the query result in a forceable refresh of
the query cache?
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||