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
.ActiveRecord
20 using NHibernate
.Expressions
;
22 internal class CriteriaHelper
24 private CriteriaHelper()
26 throw new Exception("Instances Not Supported");
30 /// Adds a collection of ICriterion to an ICriteria.
32 /// <param name="criteria">The ICriteria that will be modified.</param>
33 /// <param name="criterions">The collection of Criterion.</param>
34 internal static void AddCriterionToCriteria(ICriteria criteria
, ICriterion
[] criterions
)
36 if (criterions
!= null)
38 foreach (ICriterion cond
in criterions
)
46 /// Adds a collection of Order (sort by) specifiers to an ICriteria.
48 /// <param name="criteria">The ICriteria that will be modified.</param>
49 /// <param name="orders">The collection of Order specifiers.</param>
50 internal static void AddOrdersToCriteria(ICriteria criteria
, Order
[] orders
)
54 foreach (Order order
in orders
)
56 criteria
.AddOrder(order
);