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.portlet.dynamicdatamapping.storage.query;
016    
017    import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
018    
019    /**
020     * @author Marcellus Tavares
021     */
022    public class ConditionFactoryUtil {
023    
024            public static Junction conjunction() {
025                    return getConditionFactory().conjunction();
026            }
027    
028            public static Junction disjunction() {
029                    return getConditionFactory().disjunction();
030            }
031    
032            public static Condition eq(String name, Object value) {
033                    return getConditionFactory().eq(name, value);
034            }
035    
036            public static ConditionFactory getConditionFactory() {
037                    PortalRuntimePermission.checkGetBeanProperty(
038                            ConditionFactoryUtil.class);
039    
040                    return _conditionFactory;
041            }
042    
043            public static Condition gt(String name, Object value) {
044                    return getConditionFactory().gt(name, value);
045            }
046    
047            public static Condition gte(String name, Object value) {
048                    return getConditionFactory().gte(name, value);
049            }
050    
051            public static Condition in(String name, Object value) {
052                    return getConditionFactory().in(name, value);
053            }
054    
055            public static Condition like(String name, Object value) {
056                    return getConditionFactory().like(name, value);
057            }
058    
059            public static Condition lt(String name, Object value) {
060                    return getConditionFactory().lt(name, value);
061            }
062    
063            public static Condition lte(String name, Object value) {
064                    return getConditionFactory().lte(name, value);
065            }
066    
067            public static Condition ne(String name, Object value) {
068                    return getConditionFactory().ne(name, value);
069            }
070    
071            public static Condition notIn(String name, Object value) {
072                    return getConditionFactory().notIn(name, value);
073            }
074    
075            public void setConditionFactory(ConditionFactory conditionFactory) {
076                    PortalRuntimePermission.checkSetBeanProperty(getClass());
077    
078                    _conditionFactory = conditionFactory;
079            }
080    
081            private static ConditionFactory _conditionFactory;
082    
083    }