001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.dao.orm;
016    
017    import java.util.Collection;
018    import java.util.Map;
019    
020    /**
021     * @author Raymond Augé
022     */
023    public class RestrictionsFactoryUtil {
024    
025            public static Criterion allEq(Map<String, Criterion> propertyNameValues) {
026                    return getRestrictionsFactory().allEq(propertyNameValues);
027            }
028    
029            public static Criterion and(Criterion lhs, Criterion rhs) {
030                    return getRestrictionsFactory().and(lhs, rhs);
031            }
032    
033            public static Criterion between(String propertyName, Object lo, Object hi) {
034                    return getRestrictionsFactory().between(propertyName, lo, hi);
035            }
036    
037            public static Conjunction conjunction() {
038                    return getRestrictionsFactory().conjunction();
039            }
040    
041            public static Disjunction disjunction() {
042                    return getRestrictionsFactory().disjunction();
043            }
044    
045            public static Criterion eq(String propertyName, Object value) {
046                    return getRestrictionsFactory().eq(propertyName, value);
047            }
048    
049            public static Criterion eqProperty(
050                    String propertyName, String otherPropertyName) {
051    
052                    return getRestrictionsFactory().eqProperty(
053                            propertyName, otherPropertyName);
054            }
055    
056            public static Criterion ge(String propertyName, Object value) {
057                    return getRestrictionsFactory().ge(propertyName, value);
058            }
059    
060            public static Criterion geProperty(
061                    String propertyName, String otherPropertyName) {
062    
063                    return getRestrictionsFactory().geProperty(
064                            propertyName, otherPropertyName);
065            }
066    
067            public static RestrictionsFactory getRestrictionsFactory() {
068                    return _restrictionsFactory;
069            }
070    
071            public static Criterion gt(String propertyName, Object value) {
072                    return getRestrictionsFactory().gt(propertyName, value);
073            }
074    
075            public static Criterion gtProperty(
076                    String propertyName, String otherPropertyName) {
077    
078                    return getRestrictionsFactory().gtProperty(
079                            propertyName, otherPropertyName);
080            }
081    
082            public static Criterion ilike(String propertyName, Object value) {
083                    return getRestrictionsFactory().ilike(propertyName, value);
084            }
085    
086            public static Criterion in(String propertyName, Collection<Object> values) {
087                    return getRestrictionsFactory().in(propertyName, values);
088            }
089    
090            public static Criterion in(String propertyName, Object[] values) {
091                    return getRestrictionsFactory().in(propertyName, values);
092            }
093    
094            public static Criterion isEmpty(String propertyName) {
095                    return getRestrictionsFactory().isEmpty(propertyName);
096            }
097    
098            public static Criterion isNotEmpty(String propertyName) {
099                    return getRestrictionsFactory().isNotEmpty(propertyName);
100            }
101    
102            public static Criterion isNotNull(String propertyName) {
103                    return getRestrictionsFactory().isNotNull(propertyName);
104            }
105    
106            public static Criterion isNull(String propertyName) {
107                    return getRestrictionsFactory().isNull(propertyName);
108            }
109    
110            public static Criterion le(String propertyName, Object value) {
111                    return getRestrictionsFactory().le(propertyName, value);
112            }
113    
114            public static Criterion leProperty(
115                    String propertyName, String otherPropertyName) {
116    
117                    return getRestrictionsFactory().leProperty(
118                            propertyName, otherPropertyName);
119            }
120    
121            public static Criterion like(String propertyName, Object value) {
122                    return getRestrictionsFactory().like(propertyName, value);
123            }
124    
125            public static Criterion lt(String propertyName, Object value) {
126                    return getRestrictionsFactory().lt(propertyName, value);
127            }
128    
129            public static Criterion ltProperty(
130                    String propertyName, String otherPropertyName) {
131    
132                    return getRestrictionsFactory().ltProperty(
133                            propertyName, otherPropertyName);
134            }
135    
136            public static Criterion ne(String propertyName, Object value) {
137                    return getRestrictionsFactory().ne(propertyName, value);
138            }
139    
140            public static Criterion neProperty(
141                    String propertyName, String otherPropertyName) {
142    
143                    return getRestrictionsFactory().neProperty(
144                            propertyName, otherPropertyName);
145            }
146    
147            public static Criterion not(Criterion expression) {
148                    return getRestrictionsFactory().not(expression);
149            }
150    
151            public static Criterion or(Criterion lhs, Criterion rhs) {
152                    return getRestrictionsFactory().or(lhs, rhs);
153            }
154    
155            public void setRestrictionsFactory(
156                    RestrictionsFactory restrictionsFactory) {
157    
158                    _restrictionsFactory = restrictionsFactory;
159            }
160    
161            public static Criterion sizeEq(String propertyName, int size) {
162                    return getRestrictionsFactory().sizeEq(propertyName, size);
163            }
164    
165            public static Criterion sizeGe(String propertyName, int size) {
166                    return getRestrictionsFactory().sizeGe(propertyName, size);
167            }
168    
169            public static Criterion sizeGt(String propertyName, int size) {
170                    return getRestrictionsFactory().sizeGt(propertyName, size);
171            }
172    
173            public static Criterion sizeLe(String propertyName, int size) {
174                    return getRestrictionsFactory().sizeLe(propertyName, size);
175            }
176    
177            public static Criterion sizeLt(String propertyName, int size) {
178                    return getRestrictionsFactory().sizeLt(propertyName, size);
179            }
180    
181            public static Criterion sizeNe(String propertyName, int size) {
182                    return getRestrictionsFactory().sizeNe(propertyName, size);
183            }
184    
185            private static RestrictionsFactory _restrictionsFactory;
186    
187    }