1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.dao.orm;
24  
25  import java.util.Collection;
26  import java.util.Map;
27  
28  /**
29   * <a href="RestrictionsFactoryUtil.java.html"><b><i>View Source</i></b></a>
30   *
31   * @author Raymond Augé
32   *
33   */
34  public class RestrictionsFactoryUtil {
35  
36      public static Criterion allEq(Map propertyNameValues) {
37          return getRestrictionsFactory().allEq(propertyNameValues);
38      }
39  
40      public static Criterion and(Criterion lhs, Criterion rhs) {
41          return getRestrictionsFactory().and(lhs, rhs);
42      }
43  
44      public static Criterion between(String propertyName, Object lo, Object hi) {
45          return getRestrictionsFactory().between(propertyName, lo, hi);
46      }
47  
48      public static Conjunction conjunction() {
49          return getRestrictionsFactory().conjunction();
50      }
51  
52      public static Disjunction disjunction() {
53          return getRestrictionsFactory().disjunction();
54      }
55  
56      public static Criterion eq(String propertyName, Object value) {
57          return getRestrictionsFactory().eq(propertyName, value);
58      }
59  
60      public static Criterion eqProperty(
61          String propertyName, String otherPropertyName) {
62  
63          return getRestrictionsFactory().eqProperty(
64              propertyName, otherPropertyName);
65      }
66  
67      public static Criterion ge(String propertyName, Object value) {
68          return getRestrictionsFactory().ge(propertyName, value);
69      }
70  
71      public static Criterion geProperty(
72          String propertyName, String otherPropertyName) {
73  
74          return getRestrictionsFactory().geProperty(
75              propertyName, otherPropertyName);
76      }
77  
78      public static RestrictionsFactory getRestrictionsFactory() {
79          return _restrictionsFactory;
80      }
81  
82      public static Criterion gt(String propertyName, Object value) {
83          return getRestrictionsFactory().gt(propertyName, value);
84      }
85  
86      public static Criterion gtProperty(
87          String propertyName, String otherPropertyName) {
88  
89          return getRestrictionsFactory().gtProperty(
90              propertyName, otherPropertyName);
91      }
92  
93      public static Criterion ilike(String propertyName, Object value) {
94          return getRestrictionsFactory().ilike(propertyName, value);
95      }
96  
97      public static Criterion in(String propertyName, Collection values) {
98          return getRestrictionsFactory().in(propertyName, values);
99      }
100 
101     public static Criterion in(String propertyName, Object[] values) {
102         return getRestrictionsFactory().in(propertyName, values);
103     }
104 
105     public static Criterion isEmpty(String propertyName) {
106         return getRestrictionsFactory().isEmpty(propertyName);
107     }
108 
109     public static Criterion isNotEmpty(String propertyName) {
110         return getRestrictionsFactory().isNotEmpty(propertyName);
111     }
112 
113     public static Criterion isNotNull(String propertyName) {
114         return getRestrictionsFactory().isNotNull(propertyName);
115     }
116 
117     public static Criterion isNull(String propertyName) {
118         return getRestrictionsFactory().isNull(propertyName);
119     }
120 
121     public static Criterion le(String propertyName, Object value) {
122         return getRestrictionsFactory().le(propertyName, value);
123     }
124 
125     public static Criterion leProperty(
126         String propertyName, String otherPropertyName) {
127 
128         return getRestrictionsFactory().leProperty(
129             propertyName, otherPropertyName);
130     }
131 
132     public static Criterion like(String propertyName, Object value) {
133         return getRestrictionsFactory().like(propertyName, value);
134     }
135 
136     public static Criterion lt(String propertyName, Object value) {
137         return getRestrictionsFactory().lt(propertyName, value);
138     }
139 
140     public static Criterion ltProperty(
141         String propertyName, String otherPropertyName) {
142 
143         return getRestrictionsFactory().ltProperty(
144             propertyName, otherPropertyName);
145     }
146 
147     public static Criterion ne(String propertyName, Object value) {
148         return getRestrictionsFactory().ne(propertyName, value);
149     }
150 
151     public static Criterion neProperty(
152         String propertyName, String otherPropertyName) {
153 
154         return getRestrictionsFactory().neProperty(
155             propertyName, otherPropertyName);
156     }
157 
158     public static Criterion not(Criterion expression) {
159         return getRestrictionsFactory().not(expression);
160     }
161 
162     public static Criterion or(Criterion lhs, Criterion rhs) {
163         return getRestrictionsFactory().or(lhs, rhs);
164     }
165 
166     public void setRestrictionsFactory(
167         RestrictionsFactory restrictionsFactory) {
168 
169         _restrictionsFactory = restrictionsFactory;
170     }
171 
172     public static Criterion sizeEq(String propertyName, int size) {
173         return getRestrictionsFactory().sizeEq(propertyName, size);
174     }
175 
176     public static Criterion sizeGe(String propertyName, int size) {
177         return getRestrictionsFactory().sizeGe(propertyName, size);
178     }
179 
180     public static Criterion sizeGt(String propertyName, int size) {
181         return getRestrictionsFactory().sizeGt(propertyName, size);
182     }
183 
184     public static Criterion sizeLe(String propertyName, int size) {
185         return getRestrictionsFactory().sizeLe(propertyName, size);
186     }
187 
188     public static Criterion sizeLt(String propertyName, int size) {
189         return getRestrictionsFactory().sizeLt(propertyName, size);
190     }
191 
192     public static Criterion sizeNe(String propertyName, int size) {
193         return getRestrictionsFactory().sizeNe(propertyName, size);
194     }
195 
196     private static RestrictionsFactory _restrictionsFactory;
197 
198 }