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.counter.service.persistence;
016    
017    import com.liferay.counter.model.Counter;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.exception.SystemException;
022    import com.liferay.portal.kernel.util.OrderByComparator;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * @author    Brian Wing Shun Chan
029     * @see       CounterPersistence
030     * @see       CounterPersistenceImpl
031     * @generated
032     */
033    public class CounterUtil {
034            /**
035             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
036             */
037            public static void clearCache() {
038                    getPersistence().clearCache();
039            }
040    
041            /**
042             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
043             */
044            public static void clearCache(Counter counter) {
045                    getPersistence().clearCache(counter);
046            }
047    
048            /**
049             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
050             */
051            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
052                    throws SystemException {
053                    return getPersistence().countWithDynamicQuery(dynamicQuery);
054            }
055    
056            /**
057             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
058             */
059            public static List<Counter> findWithDynamicQuery(DynamicQuery dynamicQuery)
060                    throws SystemException {
061                    return getPersistence().findWithDynamicQuery(dynamicQuery);
062            }
063    
064            /**
065             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
066             */
067            public static List<Counter> findWithDynamicQuery(
068                    DynamicQuery dynamicQuery, int start, int end)
069                    throws SystemException {
070                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
071            }
072    
073            /**
074             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
075             */
076            public static List<Counter> findWithDynamicQuery(
077                    DynamicQuery dynamicQuery, int start, int end,
078                    OrderByComparator orderByComparator) throws SystemException {
079                    return getPersistence()
080                                       .findWithDynamicQuery(dynamicQuery, start, end,
081                            orderByComparator);
082            }
083    
084            /**
085             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
086             */
087            public static Counter remove(Counter counter) throws SystemException {
088                    return getPersistence().remove(counter);
089            }
090    
091            /**
092             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
093             */
094            public static Counter update(Counter counter, boolean merge)
095                    throws SystemException {
096                    return getPersistence().update(counter, merge);
097            }
098    
099            /**
100             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
101             */
102            public static Counter update(Counter counter, boolean merge,
103                    ServiceContext serviceContext) throws SystemException {
104                    return getPersistence().update(counter, merge, serviceContext);
105            }
106    
107            public static void cacheResult(com.liferay.counter.model.Counter counter) {
108                    getPersistence().cacheResult(counter);
109            }
110    
111            public static void cacheResult(
112                    java.util.List<com.liferay.counter.model.Counter> counters) {
113                    getPersistence().cacheResult(counters);
114            }
115    
116            public static com.liferay.counter.model.Counter create(
117                    java.lang.String name) {
118                    return getPersistence().create(name);
119            }
120    
121            public static com.liferay.counter.model.Counter remove(
122                    java.lang.String name)
123                    throws com.liferay.counter.NoSuchCounterException,
124                            com.liferay.portal.kernel.exception.SystemException {
125                    return getPersistence().remove(name);
126            }
127    
128            public static com.liferay.counter.model.Counter updateImpl(
129                    com.liferay.counter.model.Counter counter, boolean merge)
130                    throws com.liferay.portal.kernel.exception.SystemException {
131                    return getPersistence().updateImpl(counter, merge);
132            }
133    
134            public static com.liferay.counter.model.Counter findByPrimaryKey(
135                    java.lang.String name)
136                    throws com.liferay.counter.NoSuchCounterException,
137                            com.liferay.portal.kernel.exception.SystemException {
138                    return getPersistence().findByPrimaryKey(name);
139            }
140    
141            public static com.liferay.counter.model.Counter fetchByPrimaryKey(
142                    java.lang.String name)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getPersistence().fetchByPrimaryKey(name);
145            }
146    
147            public static java.util.List<com.liferay.counter.model.Counter> findAll()
148                    throws com.liferay.portal.kernel.exception.SystemException {
149                    return getPersistence().findAll();
150            }
151    
152            public static java.util.List<com.liferay.counter.model.Counter> findAll(
153                    int start, int end)
154                    throws com.liferay.portal.kernel.exception.SystemException {
155                    return getPersistence().findAll(start, end);
156            }
157    
158            public static java.util.List<com.liferay.counter.model.Counter> findAll(
159                    int start, int end,
160                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getPersistence().findAll(start, end, orderByComparator);
163            }
164    
165            public static void removeAll()
166                    throws com.liferay.portal.kernel.exception.SystemException {
167                    getPersistence().removeAll();
168            }
169    
170            public static int countAll()
171                    throws com.liferay.portal.kernel.exception.SystemException {
172                    return getPersistence().countAll();
173            }
174    
175            public static CounterPersistence getPersistence() {
176                    if (_persistence == null) {
177                            _persistence = (CounterPersistence)PortalBeanLocatorUtil.locate(CounterPersistence.class.getName());
178                    }
179    
180                    return _persistence;
181            }
182    
183            public void setPersistence(CounterPersistence persistence) {
184                    _persistence = persistence;
185            }
186    
187            private static CounterPersistence _persistence;
188    }