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  public class RestrictionsFactoryUtil {
34  
35      public static Criterion allEq(Map propertyNameValues) {
36          return getRestrictionsFactory().allEq(propertyNameValues);
37      }
38  
39      public static Criterion and(Criterion lhs, Criterion rhs) {
40          return getRestrictionsFactory().and(lhs, rhs);
41      }
42  
43      public static Criterion between(String propertyName, Object lo, Object hi) {
44          return getRestrictionsFactory().between(propertyName, lo, hi);
45      }
46  
47      public static Conjunction conjunction() {
48          return getRestrictionsFactory().conjunction();
49      }
50  
51      public static Disjunction disjunction() {
52          return getRestrictionsFactory().disjunction();
53      }
54  
55      public static Criterion eq(String propertyName, Object value) {
56          return getRestrictionsFactory().eq(propertyName, value);
57      }
58  
59      public static Criterion eqProperty(
60          String propertyName, String otherPropertyName) {
61  
62          return getRestrictionsFactory().eqProperty(
63              propertyName, otherPropertyName);
64      }
65  
66      public static Criterion ge(String propertyName, Object value) {
67          return getRestrictionsFactory().ge(propertyName, value);
68      }
69  
70      public static Criterion geProperty(
71          String propertyName, String otherPropertyName) {
72  
73          return getRestrictionsFactory().geProperty(
74              propertyName, otherPropertyName);
75      }
76  
77      public static RestrictionsFactory getRestrictionsFactory() {
78          return _restrictionsFactory;
79      }
80  
81      public static Criterion gt(String propertyName, Object value) {
82          return getRestrictionsFactory().gt(propertyName, value);
83      }
84  
85      public static Criterion gtProperty(
86          String propertyName, String otherPropertyName) {
87  
88          return getRestrictionsFactory().gtProperty(
89              propertyName, otherPropertyName);
90      }
91  
92      public static Criterion ilike(String propertyName, Object value) {
93          return getRestrictionsFactory().ilike(propertyName, value);
94      }
95  
96      public static Criterion in(String propertyName, Collection values) {
97          return getRestrictionsFactory().in(propertyName, values);
98      }
99  
100     public static Criterion in(String propertyName, Object[] values) {
101         return getRestrictionsFactory().in(propertyName, values);
102     }
103 
104     public static Criterion isEmpty(String propertyName) {
105         return getRestrictionsFactory().isEmpty(propertyName);
106     }
107 
108     public static Criterion isNotEmpty(String propertyName) {
109         return getRestrictionsFactory().isNotEmpty(propertyName);
110     }
111 
112     public static Criterion isNotNull(String propertyName) {
113         return getRestrictionsFactory().isNotNull(propertyName);
114     }
115 
116     public static Criterion isNull(String propertyName) {
117         return getRestrictionsFactory().isNull(propertyName);
118     }
119 
120     public static Criterion le(String propertyName, Object value) {
121         return getRestrictionsFactory().le(propertyName, value);
122     }
123 
124     public static Criterion leProperty(
125         String propertyName, String otherPropertyName) {
126 
127         return getRestrictionsFactory().leProperty(
128             propertyName, otherPropertyName);
129     }
130 
131     public static Criterion like(String propertyName, Object value) {
132         return getRestrictionsFactory().like(propertyName, value);
133     }
134 
135     public static Criterion lt(String propertyName, Object value) {
136         return getRestrictionsFactory().lt(propertyName, value);
137     }
138 
139     public static Criterion ltProperty(
140         String propertyName, String otherPropertyName) {
141 
142         return getRestrictionsFactory().ltProperty(
143             propertyName, otherPropertyName);
144     }
145 
146     public static Criterion ne(String propertyName, Object value) {
147         return getRestrictionsFactory().ne(propertyName, value);
148     }
149 
150     public static Criterion neProperty(
151         String propertyName, String otherPropertyName) {
152 
153         return getRestrictionsFactory().neProperty(
154             propertyName, otherPropertyName);
155     }
156 
157     public static Criterion not(Criterion expression) {
158         return getRestrictionsFactory().not(expression);
159     }
160 
161     public static Criterion or(Criterion lhs, Criterion rhs) {
162         return getRestrictionsFactory().or(lhs, rhs);
163     }
164 
165     public void setRestrictionsFactory(
166         RestrictionsFactory restrictionsFactory) {
167 
168         _restrictionsFactory = restrictionsFactory;
169     }
170 
171     public static Criterion sizeEq(String propertyName, int size) {
172         return getRestrictionsFactory().sizeEq(propertyName, size);
173     }
174 
175     public static Criterion sizeGe(String propertyName, int size) {
176         return getRestrictionsFactory().sizeGe(propertyName, size);
177     }
178 
179     public static Criterion sizeGt(String propertyName, int size) {
180         return getRestrictionsFactory().sizeGt(propertyName, size);
181     }
182 
183     public static Criterion sizeLe(String propertyName, int size) {
184         return getRestrictionsFactory().sizeLe(propertyName, size);
185     }
186 
187     public static Criterion sizeLt(String propertyName, int size) {
188         return getRestrictionsFactory().sizeLt(propertyName, size);
189     }
190 
191     public static Criterion sizeNe(String propertyName, int size) {
192         return getRestrictionsFactory().sizeNe(propertyName, size);
193     }
194 
195     private static RestrictionsFactory _restrictionsFactory;
196 
197 }