1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.ActiveRecordSupport
.Pagination
19 using Castle
.ActiveRecord
.Queries
;
24 /// Performs a simple query and paginate the results.
27 /// There's no need to supply a <c>returnType</c>, like in
28 /// <see cref="SimpleQuery"/>, as we do not perform the
29 /// conversion of the query results to an array.
31 public class ARPaginableSimpleQuery
: AbstractPaginableQuery
34 private object[] parameters
;
36 public ARPaginableSimpleQuery(Type targetType
, String hql
, params object[] parameters
) : base(targetType
)
39 this.parameters
= parameters
;
42 protected override string BuildHQL()
47 protected override void SetQueryParameters(IQuery query
)
51 foreach (object param
in parameters
)
53 query
.SetParameter(i
++, param
);