001
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
033 public class CounterUtil {
034
037 public static void clearCache() {
038 getPersistence().clearCache();
039 }
040
041
044 public static void clearCache(Counter counter) {
045 getPersistence().clearCache(counter);
046 }
047
048
051 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
052 throws SystemException {
053 return getPersistence().countWithDynamicQuery(dynamicQuery);
054 }
055
056
059 public static List<Counter> findWithDynamicQuery(DynamicQuery dynamicQuery)
060 throws SystemException {
061 return getPersistence().findWithDynamicQuery(dynamicQuery);
062 }
063
064
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
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
087 public static Counter remove(Counter counter) throws SystemException {
088 return getPersistence().remove(counter);
089 }
090
091
094 public static Counter update(Counter counter, boolean merge)
095 throws SystemException {
096 return getPersistence().update(counter, merge);
097 }
098
099
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 }