1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.counter.service.persistence;
16  
17  import com.liferay.counter.model.Counter;
18  
19  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
20  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
21  import com.liferay.portal.kernel.exception.SystemException;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="CounterUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       CounterPersistence
35   * @see       CounterPersistenceImpl
36   * @generated
37   */
38  public class CounterUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(Counter)
48       */
49      public static void clearCache(Counter counter) {
50          getPersistence().clearCache(counter);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public long countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Counter> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Counter> findWithDynamicQuery(
73          DynamicQuery dynamicQuery, int start, int end)
74          throws SystemException {
75          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
76      }
77  
78      /**
79       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
80       */
81      public static Counter remove(Counter counter) throws SystemException {
82          return getPersistence().remove(counter);
83      }
84  
85      /**
86       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
87       */
88      public static Counter update(Counter counter, boolean merge)
89          throws SystemException {
90          return getPersistence().update(counter, merge);
91      }
92  
93      public static void cacheResult(com.liferay.counter.model.Counter counter) {
94          getPersistence().cacheResult(counter);
95      }
96  
97      public static void cacheResult(
98          java.util.List<com.liferay.counter.model.Counter> counters) {
99          getPersistence().cacheResult(counters);
100     }
101 
102     public static com.liferay.counter.model.Counter create(
103         java.lang.String name) {
104         return getPersistence().create(name);
105     }
106 
107     public static com.liferay.counter.model.Counter remove(
108         java.lang.String name)
109         throws com.liferay.counter.NoSuchCounterException,
110             com.liferay.portal.kernel.exception.SystemException {
111         return getPersistence().remove(name);
112     }
113 
114     public static com.liferay.counter.model.Counter updateImpl(
115         com.liferay.counter.model.Counter counter, boolean merge)
116         throws com.liferay.portal.kernel.exception.SystemException {
117         return getPersistence().updateImpl(counter, merge);
118     }
119 
120     public static com.liferay.counter.model.Counter findByPrimaryKey(
121         java.lang.String name)
122         throws com.liferay.counter.NoSuchCounterException,
123             com.liferay.portal.kernel.exception.SystemException {
124         return getPersistence().findByPrimaryKey(name);
125     }
126 
127     public static com.liferay.counter.model.Counter fetchByPrimaryKey(
128         java.lang.String name)
129         throws com.liferay.portal.kernel.exception.SystemException {
130         return getPersistence().fetchByPrimaryKey(name);
131     }
132 
133     public static java.util.List<com.liferay.counter.model.Counter> findAll()
134         throws com.liferay.portal.kernel.exception.SystemException {
135         return getPersistence().findAll();
136     }
137 
138     public static java.util.List<com.liferay.counter.model.Counter> findAll(
139         int start, int end)
140         throws com.liferay.portal.kernel.exception.SystemException {
141         return getPersistence().findAll(start, end);
142     }
143 
144     public static java.util.List<com.liferay.counter.model.Counter> findAll(
145         int start, int end,
146         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
147         throws com.liferay.portal.kernel.exception.SystemException {
148         return getPersistence().findAll(start, end, orderByComparator);
149     }
150 
151     public static void removeAll()
152         throws com.liferay.portal.kernel.exception.SystemException {
153         getPersistence().removeAll();
154     }
155 
156     public static int countAll()
157         throws com.liferay.portal.kernel.exception.SystemException {
158         return getPersistence().countAll();
159     }
160 
161     public static CounterPersistence getPersistence() {
162         if (_persistence == null) {
163             _persistence = (CounterPersistence)PortalBeanLocatorUtil.locate(CounterPersistence.class.getName());
164         }
165 
166         return _persistence;
167     }
168 
169     public void setPersistence(CounterPersistence persistence) {
170         _persistence = persistence;
171     }
172 
173     private static CounterPersistence _persistence;
174 }