|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.shards.query.ShardedQueryImpl
public class ShardedQueryImpl
Concrete implementation of ShardedQuery provided by Hibernate Shards. This implementation introduces limits to the HQL language; mostly around limits and aggregation. Its approach is simply to execute the query on each shard and compile the results in a list, or if a unique result is desired, the fist non-null result is returned. The setFoo methods are implemented using a set of classes that implement the QueryEvent interface and are called SetFooEvent. These query events are used to call setFoo with the appropriate arguments on each Query that is executed on a shard.
{@inheritDoc}| Constructor Summary | |
|---|---|
ShardedQueryImpl(QueryId queryId,
List<Shard> shards,
QueryFactory queryFactory,
ShardAccessStrategy shardAccessStrategy)
Constructor for ShardedQueryImpl |
|
| Method Summary | |
|---|---|
int |
executeUpdate()
ExecuteUpdate is not supported and throws an UnsupportedOperationException. |
String[] |
getNamedParameters()
|
QueryFactory |
getQueryFactory()
|
QueryId |
getQueryId()
|
String |
getQueryString()
|
String[] |
getReturnAliases()
|
org.hibernate.type.Type[] |
getReturnTypes()
|
Iterator |
iterate()
This method currently wraps list(). |
List |
list()
The implementation executes the query on each shard and concatenates the results. |
org.hibernate.ScrollableResults |
scroll()
Scrolling is unsupported. |
org.hibernate.ScrollableResults |
scroll(org.hibernate.ScrollMode scrollMode)
Scrolling is unsupported. |
org.hibernate.Query |
setBigDecimal(int position,
BigDecimal number)
|
org.hibernate.Query |
setBigDecimal(String name,
BigDecimal number)
|
org.hibernate.Query |
setBigInteger(int position,
BigInteger number)
|
org.hibernate.Query |
setBigInteger(String name,
BigInteger number)
|
org.hibernate.Query |
setBinary(int position,
byte[] val)
|
org.hibernate.Query |
setBinary(String name,
byte[] val)
|
org.hibernate.Query |
setBoolean(int position,
boolean val)
|
org.hibernate.Query |
setBoolean(String name,
boolean val)
|
org.hibernate.Query |
setByte(int position,
byte val)
|
org.hibernate.Query |
setByte(String name,
byte val)
|
org.hibernate.Query |
setCacheable(boolean cacheable)
|
org.hibernate.Query |
setCacheMode(org.hibernate.CacheMode cacheMode)
|
org.hibernate.Query |
setCacheRegion(String cacheRegion)
|
org.hibernate.Query |
setCalendar(int position,
Calendar calendar)
|
org.hibernate.Query |
setCalendar(String name,
Calendar calendar)
|
org.hibernate.Query |
setCalendarDate(int position,
Calendar calendar)
|
org.hibernate.Query |
setCalendarDate(String name,
Calendar calendar)
|
org.hibernate.Query |
setCharacter(int position,
char val)
|
org.hibernate.Query |
setCharacter(String name,
char val)
|
org.hibernate.Query |
setComment(String comment)
|
org.hibernate.Query |
setDate(int position,
Date date)
|
org.hibernate.Query |
setDate(String name,
Date date)
|
org.hibernate.Query |
setDouble(int position,
double val)
|
org.hibernate.Query |
setDouble(String name,
double val)
|
org.hibernate.Query |
setEntity(int position,
Object val)
|
org.hibernate.Query |
setEntity(String name,
Object val)
|
org.hibernate.Query |
setFetchSize(int fetchSize)
|
org.hibernate.Query |
setFirstResult(int firstResult)
|
org.hibernate.Query |
setFloat(int position,
float val)
|
org.hibernate.Query |
setFloat(String name,
float val)
|
org.hibernate.Query |
setFlushMode(org.hibernate.FlushMode flushMode)
|
org.hibernate.Query |
setInteger(int position,
int val)
|
org.hibernate.Query |
setInteger(String name,
int val)
|
org.hibernate.Query |
setLocale(int position,
Locale locale)
|
org.hibernate.Query |
setLocale(String name,
Locale locale)
|
org.hibernate.Query |
setLockMode(String alias,
org.hibernate.LockMode lockMode)
|
org.hibernate.Query |
setLong(int position,
long val)
|
org.hibernate.Query |
setLong(String name,
long val)
|
org.hibernate.Query |
setMaxResults(int maxResults)
|
org.hibernate.Query |
setParameter(int position,
Object val)
|
org.hibernate.Query |
setParameter(int position,
Object val,
org.hibernate.type.Type type)
|
org.hibernate.Query |
setParameter(String name,
Object val)
|
org.hibernate.Query |
setParameter(String name,
Object val,
org.hibernate.type.Type type)
|
org.hibernate.Query |
setParameterList(String name,
Collection vals)
|
org.hibernate.Query |
setParameterList(String name,
Collection vals,
org.hibernate.type.Type type)
|
org.hibernate.Query |
setParameterList(String name,
Object[] vals)
|
org.hibernate.Query |
setParameterList(String name,
Object[] vals,
org.hibernate.type.Type type)
|
org.hibernate.Query |
setParameters(Object[] values,
org.hibernate.type.Type[] types)
|
org.hibernate.Query |
setProperties(Map map)
|
org.hibernate.Query |
setProperties(Object bean)
|
org.hibernate.Query |
setReadOnly(boolean readOnly)
|
org.hibernate.Query |
setResultTransformer(org.hibernate.transform.ResultTransformer transformer)
|
org.hibernate.Query |
setSerializable(int position,
Serializable val)
|
org.hibernate.Query |
setSerializable(String name,
Serializable val)
|
org.hibernate.Query |
setShort(int position,
short val)
|
org.hibernate.Query |
setShort(String name,
short val)
|
org.hibernate.Query |
setString(int position,
String val)
|
org.hibernate.Query |
setString(String name,
String val)
|
org.hibernate.Query |
setText(int position,
String val)
|
org.hibernate.Query |
setText(String name,
String val)
|
org.hibernate.Query |
setTime(int position,
Date date)
|
org.hibernate.Query |
setTime(String name,
Date date)
|
org.hibernate.Query |
setTimeout(int timeout)
|
org.hibernate.Query |
setTimestamp(int position,
Date date)
|
org.hibernate.Query |
setTimestamp(String name,
Date date)
|
Object |
uniqueResult()
The implementation executes the query on each shard and returns the first non-null result. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShardedQueryImpl(QueryId queryId,
List<Shard> shards,
QueryFactory queryFactory,
ShardAccessStrategy shardAccessStrategy)
queryId - the id of the queryshards - list of shards on which this query will be executedqueryFactory - factory that knows how to create the actual query we'll executeshardAccessStrategy - the shard strategy for this query| Method Detail |
|---|
public QueryId getQueryId()
getQueryId in interface ShardedQuerypublic QueryFactory getQueryFactory()
getQueryFactory in interface ShardedQuerypublic String getQueryString()
getQueryString in interface org.hibernate.Query
public org.hibernate.type.Type[] getReturnTypes()
throws org.hibernate.HibernateException
getReturnTypes in interface org.hibernate.Queryorg.hibernate.HibernateException
public String[] getReturnAliases()
throws org.hibernate.HibernateException
getReturnAliases in interface org.hibernate.Queryorg.hibernate.HibernateException
public String[] getNamedParameters()
throws org.hibernate.HibernateException
getNamedParameters in interface org.hibernate.Queryorg.hibernate.HibernateException
public Iterator iterate()
throws org.hibernate.HibernateException
iterate in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.ScrollableResults scroll()
throws org.hibernate.HibernateException
scroll in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.ScrollableResults scroll(org.hibernate.ScrollMode scrollMode)
throws org.hibernate.HibernateException
scroll in interface org.hibernate.Queryorg.hibernate.HibernateException
public List list()
throws org.hibernate.HibernateException
list in interface org.hibernate.Queryorg.hibernate.HibernateException
public Object uniqueResult()
throws org.hibernate.HibernateException
uniqueResult in interface org.hibernate.Queryorg.hibernate.HibernateException
public int executeUpdate()
throws org.hibernate.HibernateException
executeUpdate in interface org.hibernate.Queryorg.hibernate.HibernateExceptionpublic org.hibernate.Query setMaxResults(int maxResults)
setMaxResults in interface org.hibernate.Querypublic org.hibernate.Query setFirstResult(int firstResult)
setFirstResult in interface org.hibernate.Querypublic org.hibernate.Query setReadOnly(boolean readOnly)
setReadOnly in interface org.hibernate.Querypublic org.hibernate.Query setCacheable(boolean cacheable)
setCacheable in interface org.hibernate.Querypublic org.hibernate.Query setCacheRegion(String cacheRegion)
setCacheRegion in interface org.hibernate.Querypublic org.hibernate.Query setTimeout(int timeout)
setTimeout in interface org.hibernate.Querypublic org.hibernate.Query setFetchSize(int fetchSize)
setFetchSize in interface org.hibernate.Query
public org.hibernate.Query setLockMode(String alias,
org.hibernate.LockMode lockMode)
setLockMode in interface org.hibernate.Querypublic org.hibernate.Query setComment(String comment)
setComment in interface org.hibernate.Querypublic org.hibernate.Query setFlushMode(org.hibernate.FlushMode flushMode)
setFlushMode in interface org.hibernate.Querypublic org.hibernate.Query setCacheMode(org.hibernate.CacheMode cacheMode)
setCacheMode in interface org.hibernate.Query
public org.hibernate.Query setParameter(int position,
Object val,
org.hibernate.type.Type type)
setParameter in interface org.hibernate.Query
public org.hibernate.Query setParameter(String name,
Object val,
org.hibernate.type.Type type)
setParameter in interface org.hibernate.Query
public org.hibernate.Query setParameter(int position,
Object val)
throws org.hibernate.HibernateException
setParameter in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setParameter(String name,
Object val)
throws org.hibernate.HibernateException
setParameter in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setParameters(Object[] values,
org.hibernate.type.Type[] types)
throws org.hibernate.HibernateException
setParameters in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setParameterList(String name,
Collection vals,
org.hibernate.type.Type type)
throws org.hibernate.HibernateException
setParameterList in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setParameterList(String name,
Collection vals)
throws org.hibernate.HibernateException
setParameterList in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setParameterList(String name,
Object[] vals,
org.hibernate.type.Type type)
throws org.hibernate.HibernateException
setParameterList in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setParameterList(String name,
Object[] vals)
throws org.hibernate.HibernateException
setParameterList in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setProperties(Object bean)
throws org.hibernate.HibernateException
setProperties in interface org.hibernate.Queryorg.hibernate.HibernateException
public org.hibernate.Query setString(int position,
String val)
setString in interface org.hibernate.Query
public org.hibernate.Query setCharacter(int position,
char val)
setCharacter in interface org.hibernate.Query
public org.hibernate.Query setBoolean(int position,
boolean val)
setBoolean in interface org.hibernate.Query
public org.hibernate.Query setByte(int position,
byte val)
setByte in interface org.hibernate.Query
public org.hibernate.Query setShort(int position,
short val)
setShort in interface org.hibernate.Query
public org.hibernate.Query setInteger(int position,
int val)
setInteger in interface org.hibernate.Query
public org.hibernate.Query setLong(int position,
long val)
setLong in interface org.hibernate.Query
public org.hibernate.Query setFloat(int position,
float val)
setFloat in interface org.hibernate.Query
public org.hibernate.Query setDouble(int position,
double val)
setDouble in interface org.hibernate.Query
public org.hibernate.Query setBinary(int position,
byte[] val)
setBinary in interface org.hibernate.Query
public org.hibernate.Query setText(int position,
String val)
setText in interface org.hibernate.Query
public org.hibernate.Query setSerializable(int position,
Serializable val)
setSerializable in interface org.hibernate.Query
public org.hibernate.Query setLocale(int position,
Locale locale)
setLocale in interface org.hibernate.Query
public org.hibernate.Query setBigDecimal(int position,
BigDecimal number)
setBigDecimal in interface org.hibernate.Query
public org.hibernate.Query setBigInteger(int position,
BigInteger number)
setBigInteger in interface org.hibernate.Query
public org.hibernate.Query setDate(int position,
Date date)
setDate in interface org.hibernate.Query
public org.hibernate.Query setTime(int position,
Date date)
setTime in interface org.hibernate.Query
public org.hibernate.Query setTimestamp(int position,
Date date)
setTimestamp in interface org.hibernate.Query
public org.hibernate.Query setCalendar(int position,
Calendar calendar)
setCalendar in interface org.hibernate.Query
public org.hibernate.Query setCalendarDate(int position,
Calendar calendar)
setCalendarDate in interface org.hibernate.Query
public org.hibernate.Query setString(String name,
String val)
setString in interface org.hibernate.Query
public org.hibernate.Query setCharacter(String name,
char val)
setCharacter in interface org.hibernate.Query
public org.hibernate.Query setBoolean(String name,
boolean val)
setBoolean in interface org.hibernate.Query
public org.hibernate.Query setByte(String name,
byte val)
setByte in interface org.hibernate.Query
public org.hibernate.Query setShort(String name,
short val)
setShort in interface org.hibernate.Query
public org.hibernate.Query setInteger(String name,
int val)
setInteger in interface org.hibernate.Query
public org.hibernate.Query setLong(String name,
long val)
setLong in interface org.hibernate.Query
public org.hibernate.Query setFloat(String name,
float val)
setFloat in interface org.hibernate.Query
public org.hibernate.Query setDouble(String name,
double val)
setDouble in interface org.hibernate.Query
public org.hibernate.Query setBinary(String name,
byte[] val)
setBinary in interface org.hibernate.Query
public org.hibernate.Query setText(String name,
String val)
setText in interface org.hibernate.Query
public org.hibernate.Query setSerializable(String name,
Serializable val)
setSerializable in interface org.hibernate.Query
public org.hibernate.Query setLocale(String name,
Locale locale)
setLocale in interface org.hibernate.Query
public org.hibernate.Query setBigDecimal(String name,
BigDecimal number)
setBigDecimal in interface org.hibernate.Query
public org.hibernate.Query setBigInteger(String name,
BigInteger number)
setBigInteger in interface org.hibernate.Query
public org.hibernate.Query setDate(String name,
Date date)
setDate in interface org.hibernate.Query
public org.hibernate.Query setTime(String name,
Date date)
setTime in interface org.hibernate.Query
public org.hibernate.Query setTimestamp(String name,
Date date)
setTimestamp in interface org.hibernate.Query
public org.hibernate.Query setCalendar(String name,
Calendar calendar)
setCalendar in interface org.hibernate.Query
public org.hibernate.Query setCalendarDate(String name,
Calendar calendar)
setCalendarDate in interface org.hibernate.Query
public org.hibernate.Query setEntity(int position,
Object val)
setEntity in interface org.hibernate.Query
public org.hibernate.Query setEntity(String name,
Object val)
setEntity in interface org.hibernate.Querypublic org.hibernate.Query setResultTransformer(org.hibernate.transform.ResultTransformer transformer)
setResultTransformer in interface org.hibernate.Query
public org.hibernate.Query setProperties(Map map)
throws org.hibernate.HibernateException
setProperties in interface org.hibernate.Queryorg.hibernate.HibernateException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||