001    /**
002     * Copyright (c) 2000-2013 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 com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    import java.util.Collection;
020    import java.util.Map;
021    
022    /**
023     * @author Raymond Aug??
024     */
025    public class RestrictionsFactoryUtil {
026    
027            public static Criterion allEq(Map<String, Criterion> propertyNameValues) {
028                    return getRestrictionsFactory().allEq(propertyNameValues);
029            }
030    
031            public static Criterion and(Criterion lhs, Criterion rhs) {
032                    return getRestrictionsFactory().and(lhs, rhs);
033            }
034    
035            public static Criterion between(String propertyName, Object lo, Object hi) {
036                    return getRestrictionsFactory().between(propertyName, lo, hi);
037            }
038    
039            public static Conjunction conjunction() {
040                    return getRestrictionsFactory().conjunction();
041            }
042    
043            public static Disjunction disjunction() {
044                    return getRestrictionsFactory().disjunction();
045            }
046    
047            public static Criterion eq(String propertyName, Object value) {
048                    return getRestrictionsFactory().eq(propertyName, value);
049            }
050    
051            public static Criterion eqProperty(
052                    String propertyName, String otherPropertyName) {
053    
054                    return getRestrictionsFactory().eqProperty(
055                            propertyName, otherPropertyName);
056            }
057    
058            public static Criterion ge(String propertyName, Object value) {
059                    return getRestrictionsFactory().ge(propertyName, value);
060            }
061    
062            public static Criterion geProperty(
063                    String propertyName, String otherPropertyName) {
064    
065                    return getRestrictionsFactory().geProperty(
066                            propertyName, otherPropertyName);
067            }
068    
069            public static RestrictionsFactory getRestrictionsFactory() {
070                    PortalRuntimePermission.checkGetBeanProperty(
071                            RestrictionsFactoryUtil.class);
072    
073                    return _restrictionsFactory;
074            }
075    
076            public static Criterion gt(String propertyName, Object value) {
077                    return getRestrictionsFactory().gt(propertyName, value);
078            }
079    
080            public static Criterion gtProperty(
081                    String propertyName, String otherPropertyName) {
082    
083                    return getRestrictionsFactory().gtProperty(
084                            propertyName, otherPropertyName);
085            }
086    
087            public static Criterion ilike(String propertyName, Object value) {
088                    return getRestrictionsFactory().ilike(propertyName, value);
089            }
090    
091            public static Criterion in(String propertyName, Collection<?> values) {
092                    return getRestrictionsFactory().in(propertyName, values);
093            }
094    
095            public static Criterion in(String propertyName, Object[] values) {
096                    return getRestrictionsFactory().in(propertyName, values);
097            }
098    
099            public static Criterion isEmpty(String propertyName) {
100                    return getRestrictionsFactory().isEmpty(propertyName);
101            }
102    
103            public static Criterion isNotEmpty(String propertyName) {
104                    return getRestrictionsFactory().isNotEmpty(propertyName);
105            }
106    
107            public static Criterion isNotNull(String propertyName) {
108                    return getRestrictionsFactory().isNotNull(propertyName);
109            }
110    
111            public static Criterion isNull(String propertyName) {
112                    return getRestrictionsFactory().isNull(propertyName);
113            }
114    
115            public static Criterion le(String propertyName, Object value) {
116                    return getRestrictionsFactory().le(propertyName, value);
117            }
118    
119            public static Criterion leProperty(
120                    String propertyName, String otherPropertyName) {
121    
122                    return getRestrictionsFactory().leProperty(
123                            propertyName, otherPropertyName);
124            }
125    
126            public static Criterion like(String propertyName, Object value) {
127                    return getRestrictionsFactory().like(propertyName, value);
128            }
129    
130            public static Criterion lt(String propertyName, Object value) {
131                    return getRestrictionsFactory().lt(propertyName, value);
132            }
133    
134            public static Criterion ltProperty(
135                    String propertyName, String otherPropertyName) {
136    
137                    return getRestrictionsFactory().ltProperty(
138                            propertyName, otherPropertyName);
139            }
140    
141            public static Criterion ne(String propertyName, Object value) {
142                    return getRestrictionsFactory().ne(propertyName, value);
143            }
144    
145            public static Criterion neProperty(
146                    String propertyName, String otherPropertyName) {
147    
148                    return getRestrictionsFactory().neProperty(
149                            propertyName, otherPropertyName);
150            }
151    
152            public static Criterion not(Criterion expression) {
153                    return getRestrictionsFactory().not(expression);
154            }
155    
156            public static Criterion or(Criterion lhs, Criterion rhs) {
157                    return getRestrictionsFactory().or(lhs, rhs);
158            }
159    
160            public static Criterion sizeEq(String propertyName, int size) {
161                    return getRestrictionsFactory().sizeEq(propertyName, size);
162            }
163    
164            public static Criterion sizeGe(String propertyName, int size) {
165                    return getRestrictionsFactory().sizeGe(propertyName, size);
166            }
167    
168            public static Criterion sizeGt(String propertyName, int size) {
169                    return getRestrictionsFactory().sizeGt(propertyName, size);
170            }
171    
172            public static Criterion sizeLe(String propertyName, int size) {
173                    return getRestrictionsFactory().sizeLe(propertyName, size);
174            }
175    
176            public static Criterion sizeLt(String propertyName, int size) {
177                    return getRestrictionsFactory().sizeLt(propertyName, size);
178            }
179    
180            public static Criterion sizeNe(String propertyName, int size) {
181                    return getRestrictionsFactory().sizeNe(propertyName, size);
182            }
183    
184            public static Criterion sqlRestriction(String sql) {
185                    return getRestrictionsFactory().sqlRestriction(sql);
186            }
187    
188            public static Criterion sqlRestriction(
189                    String sql, Object value, Type type) {
190    
191                    return getRestrictionsFactory().sqlRestriction(sql, value, type);
192            }
193    
194            public static Criterion sqlRestriction(
195                    String sql, Object[] values, Type[] types) {
196    
197                    return getRestrictionsFactory().sqlRestriction(sql, values, types);
198            }
199    
200            public void setRestrictionsFactory(
201                    RestrictionsFactory restrictionsFactory) {
202    
203                    PortalRuntimePermission.checkSetBeanProperty(getClass());
204    
205                    _restrictionsFactory = restrictionsFactory;
206            }
207    
208            private static RestrictionsFactory _restrictionsFactory;
209    
210    }