001
014
015 package com.liferay.portlet.shopping.service.persistence;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019 import com.liferay.portal.kernel.exception.SystemException;
020 import com.liferay.portal.kernel.util.OrderByComparator;
021 import com.liferay.portal.service.ServiceContext;
022
023 import com.liferay.portlet.shopping.model.ShoppingCart;
024
025 import java.util.List;
026
027
033 public class ShoppingCartUtil {
034
037 public static void clearCache() {
038 getPersistence().clearCache();
039 }
040
041
044 public static void clearCache(ShoppingCart shoppingCart) {
045 getPersistence().clearCache(shoppingCart);
046 }
047
048
051 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
052 throws SystemException {
053 return getPersistence().countWithDynamicQuery(dynamicQuery);
054 }
055
056
059 public static List<ShoppingCart> findWithDynamicQuery(
060 DynamicQuery dynamicQuery) throws SystemException {
061 return getPersistence().findWithDynamicQuery(dynamicQuery);
062 }
063
064
067 public static List<ShoppingCart> 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<ShoppingCart> 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 ShoppingCart remove(ShoppingCart shoppingCart)
088 throws SystemException {
089 return getPersistence().remove(shoppingCart);
090 }
091
092
095 public static ShoppingCart update(ShoppingCart shoppingCart, boolean merge)
096 throws SystemException {
097 return getPersistence().update(shoppingCart, merge);
098 }
099
100
103 public static ShoppingCart update(ShoppingCart shoppingCart, boolean merge,
104 ServiceContext serviceContext) throws SystemException {
105 return getPersistence().update(shoppingCart, merge, serviceContext);
106 }
107
108 public static void cacheResult(
109 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) {
110 getPersistence().cacheResult(shoppingCart);
111 }
112
113 public static void cacheResult(
114 java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts) {
115 getPersistence().cacheResult(shoppingCarts);
116 }
117
118 public static com.liferay.portlet.shopping.model.ShoppingCart create(
119 long cartId) {
120 return getPersistence().create(cartId);
121 }
122
123 public static com.liferay.portlet.shopping.model.ShoppingCart remove(
124 long cartId)
125 throws com.liferay.portal.kernel.exception.SystemException,
126 com.liferay.portlet.shopping.NoSuchCartException {
127 return getPersistence().remove(cartId);
128 }
129
130 public static com.liferay.portlet.shopping.model.ShoppingCart updateImpl(
131 com.liferay.portlet.shopping.model.ShoppingCart shoppingCart,
132 boolean merge)
133 throws com.liferay.portal.kernel.exception.SystemException {
134 return getPersistence().updateImpl(shoppingCart, merge);
135 }
136
137 public static com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey(
138 long cartId)
139 throws com.liferay.portal.kernel.exception.SystemException,
140 com.liferay.portlet.shopping.NoSuchCartException {
141 return getPersistence().findByPrimaryKey(cartId);
142 }
143
144 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey(
145 long cartId) throws com.liferay.portal.kernel.exception.SystemException {
146 return getPersistence().fetchByPrimaryKey(cartId);
147 }
148
149 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
150 long groupId)
151 throws com.liferay.portal.kernel.exception.SystemException {
152 return getPersistence().findByGroupId(groupId);
153 }
154
155 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
156 long groupId, int start, int end)
157 throws com.liferay.portal.kernel.exception.SystemException {
158 return getPersistence().findByGroupId(groupId, start, end);
159 }
160
161 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
162 long groupId, int start, int end,
163 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
164 throws com.liferay.portal.kernel.exception.SystemException {
165 return getPersistence()
166 .findByGroupId(groupId, start, end, orderByComparator);
167 }
168
169 public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First(
170 long groupId,
171 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
172 throws com.liferay.portal.kernel.exception.SystemException,
173 com.liferay.portlet.shopping.NoSuchCartException {
174 return getPersistence().findByGroupId_First(groupId, orderByComparator);
175 }
176
177 public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last(
178 long groupId,
179 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
180 throws com.liferay.portal.kernel.exception.SystemException,
181 com.liferay.portlet.shopping.NoSuchCartException {
182 return getPersistence().findByGroupId_Last(groupId, orderByComparator);
183 }
184
185 public static com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext(
186 long cartId, long groupId,
187 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
188 throws com.liferay.portal.kernel.exception.SystemException,
189 com.liferay.portlet.shopping.NoSuchCartException {
190 return getPersistence()
191 .findByGroupId_PrevAndNext(cartId, groupId, orderByComparator);
192 }
193
194 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
195 long userId) throws com.liferay.portal.kernel.exception.SystemException {
196 return getPersistence().findByUserId(userId);
197 }
198
199 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
200 long userId, int start, int end)
201 throws com.liferay.portal.kernel.exception.SystemException {
202 return getPersistence().findByUserId(userId, start, end);
203 }
204
205 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
206 long userId, int start, int end,
207 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
208 throws com.liferay.portal.kernel.exception.SystemException {
209 return getPersistence()
210 .findByUserId(userId, start, end, orderByComparator);
211 }
212
213 public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First(
214 long userId,
215 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
216 throws com.liferay.portal.kernel.exception.SystemException,
217 com.liferay.portlet.shopping.NoSuchCartException {
218 return getPersistence().findByUserId_First(userId, orderByComparator);
219 }
220
221 public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last(
222 long userId,
223 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
224 throws com.liferay.portal.kernel.exception.SystemException,
225 com.liferay.portlet.shopping.NoSuchCartException {
226 return getPersistence().findByUserId_Last(userId, orderByComparator);
227 }
228
229 public static com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext(
230 long cartId, long userId,
231 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
232 throws com.liferay.portal.kernel.exception.SystemException,
233 com.liferay.portlet.shopping.NoSuchCartException {
234 return getPersistence()
235 .findByUserId_PrevAndNext(cartId, userId, orderByComparator);
236 }
237
238 public static com.liferay.portlet.shopping.model.ShoppingCart findByG_U(
239 long groupId, long userId)
240 throws com.liferay.portal.kernel.exception.SystemException,
241 com.liferay.portlet.shopping.NoSuchCartException {
242 return getPersistence().findByG_U(groupId, userId);
243 }
244
245 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
246 long groupId, long userId)
247 throws com.liferay.portal.kernel.exception.SystemException {
248 return getPersistence().fetchByG_U(groupId, userId);
249 }
250
251 public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
252 long groupId, long userId, boolean retrieveFromCache)
253 throws com.liferay.portal.kernel.exception.SystemException {
254 return getPersistence().fetchByG_U(groupId, userId, retrieveFromCache);
255 }
256
257 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll()
258 throws com.liferay.portal.kernel.exception.SystemException {
259 return getPersistence().findAll();
260 }
261
262 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
263 int start, int end)
264 throws com.liferay.portal.kernel.exception.SystemException {
265 return getPersistence().findAll(start, end);
266 }
267
268 public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
269 int start, int end,
270 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
271 throws com.liferay.portal.kernel.exception.SystemException {
272 return getPersistence().findAll(start, end, orderByComparator);
273 }
274
275 public static void removeByGroupId(long groupId)
276 throws com.liferay.portal.kernel.exception.SystemException {
277 getPersistence().removeByGroupId(groupId);
278 }
279
280 public static void removeByUserId(long userId)
281 throws com.liferay.portal.kernel.exception.SystemException {
282 getPersistence().removeByUserId(userId);
283 }
284
285 public static void removeByG_U(long groupId, long userId)
286 throws com.liferay.portal.kernel.exception.SystemException,
287 com.liferay.portlet.shopping.NoSuchCartException {
288 getPersistence().removeByG_U(groupId, userId);
289 }
290
291 public static void removeAll()
292 throws com.liferay.portal.kernel.exception.SystemException {
293 getPersistence().removeAll();
294 }
295
296 public static int countByGroupId(long groupId)
297 throws com.liferay.portal.kernel.exception.SystemException {
298 return getPersistence().countByGroupId(groupId);
299 }
300
301 public static int countByUserId(long userId)
302 throws com.liferay.portal.kernel.exception.SystemException {
303 return getPersistence().countByUserId(userId);
304 }
305
306 public static int countByG_U(long groupId, long userId)
307 throws com.liferay.portal.kernel.exception.SystemException {
308 return getPersistence().countByG_U(groupId, userId);
309 }
310
311 public static int countAll()
312 throws com.liferay.portal.kernel.exception.SystemException {
313 return getPersistence().countAll();
314 }
315
316 public static ShoppingCartPersistence getPersistence() {
317 if (_persistence == null) {
318 _persistence = (ShoppingCartPersistence)PortalBeanLocatorUtil.locate(ShoppingCartPersistence.class.getName());
319 }
320
321 return _persistence;
322 }
323
324 public void setPersistence(ShoppingCartPersistence persistence) {
325 _persistence = persistence;
326 }
327
328 private static ShoppingCartPersistence _persistence;
329 }