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    /**
018     * @author Brian Wing Shun Chan
019     */
020    public class ProjectionFactoryUtil {
021    
022            public static Projection alias(Projection projection, String alias) {
023                    return getProjectionFactory().alias(projection, alias);
024            }
025    
026            public static Projection avg(String propertyName) {
027                    return getProjectionFactory().avg(propertyName);
028            }
029    
030            public static Projection count(String propertyName) {
031                    return getProjectionFactory().count(propertyName);
032            }
033    
034            public static Projection countDistinct(String propertyName) {
035                    return getProjectionFactory().countDistinct(propertyName);
036            }
037    
038            public static Projection distinct(Projection projection) {
039                    return getProjectionFactory().distinct(projection);
040            }
041    
042            public static ProjectionFactory getProjectionFactory() {
043                    return _projectionFactory;
044            }
045    
046            public static Projection groupProperty(String propertyName) {
047                    return getProjectionFactory().groupProperty(propertyName);
048            }
049    
050            public static Projection max(String propertyName) {
051                    return getProjectionFactory().max(propertyName);
052            }
053    
054            public static Projection min(String propertyName) {
055                    return getProjectionFactory().min(propertyName);
056            }
057    
058            public static ProjectionList projectionList() {
059                    return getProjectionFactory().projectionList();
060            }
061    
062            public static Projection property(String propertyName) {
063                    return getProjectionFactory().property(propertyName);
064            }
065    
066            public static Projection rowCount() {
067                    return getProjectionFactory().rowCount();
068            }
069    
070            public static Projection sum(String propertyName) {
071                    return getProjectionFactory().sum(propertyName);
072            }
073    
074            public void setProjectionFactory(ProjectionFactory projectionFactory) {
075                    _projectionFactory = projectionFactory;
076            }
077    
078            private static ProjectionFactory _projectionFactory;
079    
080    }