/** * The implementation executes the query on each shard and concatenates the * results. * * {@inheritDoc} * * @return a list containing the concatenated results of executing the * query on all shards * @throws HibernateException */ public IList List() { IShardOperation <IList> shardOp = new ListShardOperation <IList>(queryId, this); IExitStrategy <IList> exitStrategy = new ConcatenateListsExitStrategy(); /** * We don't support shard selection for HQL queries. If you want * custom shards, create a ShardedSession with only the shards you want. */ return(shardAccessStrategy.Apply(shards, shardOp, exitStrategy, queryCollector)); }
//public ScrollableResults Scroll() //{ // throw new NotSupportedException(); //} //public ScrollableResults Scroll(ScrollMode scrollMode) //{ // throw new NotSupportedException(); //} public IList List() { //build a shard operation and apply it across all shards IShardOperation <IList> shardOp = new ListShardOperation <IList>(this); IExitStrategy <IList> exitStrategy = new ConcatenateListsExitStrategy(); /** * We don't support shard selection for criteria queries. If you want * custom shards, create a ShardedSession with only the shards you want. * We're going to concatenate all our results and then use our * criteria collector to do post processing. */ return(this.shardAccessStrategy.Apply(this.shards, shardOp, exitStrategy, this.criteriaCollector)); }
public T UniqueResult <T>() { IShardOperation <T> shardOp = new ListShardOperation <T>(queryId, this); return(shardAccessStrategy.Apply(shards, shardOp, new FirstNonNullResultExitStrategy <T>(), queryCollector)); }