001    /**
002     * Copyright (c) 2000-present 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.portlet.shopping.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.service.persistence.BasePersistence;
020    
021    import com.liferay.portlet.shopping.model.ShoppingItem;
022    
023    /**
024     * The persistence interface for the shopping item service.
025     *
026     * <p>
027     * Caching information and settings can be found in <code>portal.properties</code>
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see com.liferay.portlet.shopping.service.persistence.impl.ShoppingItemPersistenceImpl
032     * @see ShoppingItemUtil
033     * @generated
034     */
035    @ProviderType
036    public interface ShoppingItemPersistence extends BasePersistence<ShoppingItem> {
037            /*
038             * NOTE FOR DEVELOPERS:
039             *
040             * Never modify or reference this interface directly. Always use {@link ShoppingItemUtil} to access the shopping item persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
041             */
042    
043            /**
044            * Returns the shopping item where smallImageId = &#63; or throws a {@link NoSuchItemException} if it could not be found.
045            *
046            * @param smallImageId the small image ID
047            * @return the matching shopping item
048            * @throws NoSuchItemException if a matching shopping item could not be found
049            */
050            public ShoppingItem findBySmallImageId(long smallImageId)
051                    throws com.liferay.portlet.shopping.NoSuchItemException;
052    
053            /**
054            * Returns the shopping item where smallImageId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
055            *
056            * @param smallImageId the small image ID
057            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
058            */
059            public ShoppingItem fetchBySmallImageId(long smallImageId);
060    
061            /**
062            * Returns the shopping item where smallImageId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
063            *
064            * @param smallImageId the small image ID
065            * @param retrieveFromCache whether to use the finder cache
066            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
067            */
068            public ShoppingItem fetchBySmallImageId(long smallImageId,
069                    boolean retrieveFromCache);
070    
071            /**
072            * Removes the shopping item where smallImageId = &#63; from the database.
073            *
074            * @param smallImageId the small image ID
075            * @return the shopping item that was removed
076            */
077            public ShoppingItem removeBySmallImageId(long smallImageId)
078                    throws com.liferay.portlet.shopping.NoSuchItemException;
079    
080            /**
081            * Returns the number of shopping items where smallImageId = &#63;.
082            *
083            * @param smallImageId the small image ID
084            * @return the number of matching shopping items
085            */
086            public int countBySmallImageId(long smallImageId);
087    
088            /**
089            * Returns the shopping item where mediumImageId = &#63; or throws a {@link NoSuchItemException} if it could not be found.
090            *
091            * @param mediumImageId the medium image ID
092            * @return the matching shopping item
093            * @throws NoSuchItemException if a matching shopping item could not be found
094            */
095            public ShoppingItem findByMediumImageId(long mediumImageId)
096                    throws com.liferay.portlet.shopping.NoSuchItemException;
097    
098            /**
099            * Returns the shopping item where mediumImageId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
100            *
101            * @param mediumImageId the medium image ID
102            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
103            */
104            public ShoppingItem fetchByMediumImageId(long mediumImageId);
105    
106            /**
107            * Returns the shopping item where mediumImageId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
108            *
109            * @param mediumImageId the medium image ID
110            * @param retrieveFromCache whether to use the finder cache
111            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
112            */
113            public ShoppingItem fetchByMediumImageId(long mediumImageId,
114                    boolean retrieveFromCache);
115    
116            /**
117            * Removes the shopping item where mediumImageId = &#63; from the database.
118            *
119            * @param mediumImageId the medium image ID
120            * @return the shopping item that was removed
121            */
122            public ShoppingItem removeByMediumImageId(long mediumImageId)
123                    throws com.liferay.portlet.shopping.NoSuchItemException;
124    
125            /**
126            * Returns the number of shopping items where mediumImageId = &#63;.
127            *
128            * @param mediumImageId the medium image ID
129            * @return the number of matching shopping items
130            */
131            public int countByMediumImageId(long mediumImageId);
132    
133            /**
134            * Returns the shopping item where largeImageId = &#63; or throws a {@link NoSuchItemException} if it could not be found.
135            *
136            * @param largeImageId the large image ID
137            * @return the matching shopping item
138            * @throws NoSuchItemException if a matching shopping item could not be found
139            */
140            public ShoppingItem findByLargeImageId(long largeImageId)
141                    throws com.liferay.portlet.shopping.NoSuchItemException;
142    
143            /**
144            * Returns the shopping item where largeImageId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
145            *
146            * @param largeImageId the large image ID
147            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
148            */
149            public ShoppingItem fetchByLargeImageId(long largeImageId);
150    
151            /**
152            * Returns the shopping item where largeImageId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
153            *
154            * @param largeImageId the large image ID
155            * @param retrieveFromCache whether to use the finder cache
156            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
157            */
158            public ShoppingItem fetchByLargeImageId(long largeImageId,
159                    boolean retrieveFromCache);
160    
161            /**
162            * Removes the shopping item where largeImageId = &#63; from the database.
163            *
164            * @param largeImageId the large image ID
165            * @return the shopping item that was removed
166            */
167            public ShoppingItem removeByLargeImageId(long largeImageId)
168                    throws com.liferay.portlet.shopping.NoSuchItemException;
169    
170            /**
171            * Returns the number of shopping items where largeImageId = &#63;.
172            *
173            * @param largeImageId the large image ID
174            * @return the number of matching shopping items
175            */
176            public int countByLargeImageId(long largeImageId);
177    
178            /**
179            * Returns all the shopping items where groupId = &#63; and categoryId = &#63;.
180            *
181            * @param groupId the group ID
182            * @param categoryId the category ID
183            * @return the matching shopping items
184            */
185            public java.util.List<ShoppingItem> findByG_C(long groupId, long categoryId);
186    
187            /**
188            * Returns a range of all the shopping items where groupId = &#63; and categoryId = &#63;.
189            *
190            * <p>
191            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
192            * </p>
193            *
194            * @param groupId the group ID
195            * @param categoryId the category ID
196            * @param start the lower bound of the range of shopping items
197            * @param end the upper bound of the range of shopping items (not inclusive)
198            * @return the range of matching shopping items
199            */
200            public java.util.List<ShoppingItem> findByG_C(long groupId,
201                    long categoryId, int start, int end);
202    
203            /**
204            * Returns an ordered range of all the shopping items where groupId = &#63; and categoryId = &#63;.
205            *
206            * <p>
207            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
208            * </p>
209            *
210            * @param groupId the group ID
211            * @param categoryId the category ID
212            * @param start the lower bound of the range of shopping items
213            * @param end the upper bound of the range of shopping items (not inclusive)
214            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
215            * @return the ordered range of matching shopping items
216            */
217            public java.util.List<ShoppingItem> findByG_C(long groupId,
218                    long categoryId, int start, int end,
219                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator);
220    
221            /**
222            * Returns the first shopping item in the ordered set where groupId = &#63; and categoryId = &#63;.
223            *
224            * @param groupId the group ID
225            * @param categoryId the category ID
226            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
227            * @return the first matching shopping item
228            * @throws NoSuchItemException if a matching shopping item could not be found
229            */
230            public ShoppingItem findByG_C_First(long groupId, long categoryId,
231                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator)
232                    throws com.liferay.portlet.shopping.NoSuchItemException;
233    
234            /**
235            * Returns the first shopping item in the ordered set where groupId = &#63; and categoryId = &#63;.
236            *
237            * @param groupId the group ID
238            * @param categoryId the category ID
239            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
240            * @return the first matching shopping item, or <code>null</code> if a matching shopping item could not be found
241            */
242            public ShoppingItem fetchByG_C_First(long groupId, long categoryId,
243                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator);
244    
245            /**
246            * Returns the last shopping item in the ordered set where groupId = &#63; and categoryId = &#63;.
247            *
248            * @param groupId the group ID
249            * @param categoryId the category ID
250            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
251            * @return the last matching shopping item
252            * @throws NoSuchItemException if a matching shopping item could not be found
253            */
254            public ShoppingItem findByG_C_Last(long groupId, long categoryId,
255                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator)
256                    throws com.liferay.portlet.shopping.NoSuchItemException;
257    
258            /**
259            * Returns the last shopping item in the ordered set where groupId = &#63; and categoryId = &#63;.
260            *
261            * @param groupId the group ID
262            * @param categoryId the category ID
263            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
264            * @return the last matching shopping item, or <code>null</code> if a matching shopping item could not be found
265            */
266            public ShoppingItem fetchByG_C_Last(long groupId, long categoryId,
267                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator);
268    
269            /**
270            * Returns the shopping items before and after the current shopping item in the ordered set where groupId = &#63; and categoryId = &#63;.
271            *
272            * @param itemId the primary key of the current shopping item
273            * @param groupId the group ID
274            * @param categoryId the category ID
275            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
276            * @return the previous, current, and next shopping item
277            * @throws NoSuchItemException if a shopping item with the primary key could not be found
278            */
279            public ShoppingItem[] findByG_C_PrevAndNext(long itemId, long groupId,
280                    long categoryId,
281                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator)
282                    throws com.liferay.portlet.shopping.NoSuchItemException;
283    
284            /**
285            * Returns all the shopping items that the user has permission to view where groupId = &#63; and categoryId = &#63;.
286            *
287            * @param groupId the group ID
288            * @param categoryId the category ID
289            * @return the matching shopping items that the user has permission to view
290            */
291            public java.util.List<ShoppingItem> filterFindByG_C(long groupId,
292                    long categoryId);
293    
294            /**
295            * Returns a range of all the shopping items that the user has permission to view where groupId = &#63; and categoryId = &#63;.
296            *
297            * <p>
298            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
299            * </p>
300            *
301            * @param groupId the group ID
302            * @param categoryId the category ID
303            * @param start the lower bound of the range of shopping items
304            * @param end the upper bound of the range of shopping items (not inclusive)
305            * @return the range of matching shopping items that the user has permission to view
306            */
307            public java.util.List<ShoppingItem> filterFindByG_C(long groupId,
308                    long categoryId, int start, int end);
309    
310            /**
311            * Returns an ordered range of all the shopping items that the user has permissions to view where groupId = &#63; and categoryId = &#63;.
312            *
313            * <p>
314            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
315            * </p>
316            *
317            * @param groupId the group ID
318            * @param categoryId the category ID
319            * @param start the lower bound of the range of shopping items
320            * @param end the upper bound of the range of shopping items (not inclusive)
321            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
322            * @return the ordered range of matching shopping items that the user has permission to view
323            */
324            public java.util.List<ShoppingItem> filterFindByG_C(long groupId,
325                    long categoryId, int start, int end,
326                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator);
327    
328            /**
329            * Returns the shopping items before and after the current shopping item in the ordered set of shopping items that the user has permission to view where groupId = &#63; and categoryId = &#63;.
330            *
331            * @param itemId the primary key of the current shopping item
332            * @param groupId the group ID
333            * @param categoryId the category ID
334            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
335            * @return the previous, current, and next shopping item
336            * @throws NoSuchItemException if a shopping item with the primary key could not be found
337            */
338            public ShoppingItem[] filterFindByG_C_PrevAndNext(long itemId,
339                    long groupId, long categoryId,
340                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator)
341                    throws com.liferay.portlet.shopping.NoSuchItemException;
342    
343            /**
344            * Removes all the shopping items where groupId = &#63; and categoryId = &#63; from the database.
345            *
346            * @param groupId the group ID
347            * @param categoryId the category ID
348            */
349            public void removeByG_C(long groupId, long categoryId);
350    
351            /**
352            * Returns the number of shopping items where groupId = &#63; and categoryId = &#63;.
353            *
354            * @param groupId the group ID
355            * @param categoryId the category ID
356            * @return the number of matching shopping items
357            */
358            public int countByG_C(long groupId, long categoryId);
359    
360            /**
361            * Returns the number of shopping items that the user has permission to view where groupId = &#63; and categoryId = &#63;.
362            *
363            * @param groupId the group ID
364            * @param categoryId the category ID
365            * @return the number of matching shopping items that the user has permission to view
366            */
367            public int filterCountByG_C(long groupId, long categoryId);
368    
369            /**
370            * Returns the shopping item where companyId = &#63; and sku = &#63; or throws a {@link NoSuchItemException} if it could not be found.
371            *
372            * @param companyId the company ID
373            * @param sku the sku
374            * @return the matching shopping item
375            * @throws NoSuchItemException if a matching shopping item could not be found
376            */
377            public ShoppingItem findByC_S(long companyId, java.lang.String sku)
378                    throws com.liferay.portlet.shopping.NoSuchItemException;
379    
380            /**
381            * Returns the shopping item where companyId = &#63; and sku = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
382            *
383            * @param companyId the company ID
384            * @param sku the sku
385            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
386            */
387            public ShoppingItem fetchByC_S(long companyId, java.lang.String sku);
388    
389            /**
390            * Returns the shopping item where companyId = &#63; and sku = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
391            *
392            * @param companyId the company ID
393            * @param sku the sku
394            * @param retrieveFromCache whether to use the finder cache
395            * @return the matching shopping item, or <code>null</code> if a matching shopping item could not be found
396            */
397            public ShoppingItem fetchByC_S(long companyId, java.lang.String sku,
398                    boolean retrieveFromCache);
399    
400            /**
401            * Removes the shopping item where companyId = &#63; and sku = &#63; from the database.
402            *
403            * @param companyId the company ID
404            * @param sku the sku
405            * @return the shopping item that was removed
406            */
407            public ShoppingItem removeByC_S(long companyId, java.lang.String sku)
408                    throws com.liferay.portlet.shopping.NoSuchItemException;
409    
410            /**
411            * Returns the number of shopping items where companyId = &#63; and sku = &#63;.
412            *
413            * @param companyId the company ID
414            * @param sku the sku
415            * @return the number of matching shopping items
416            */
417            public int countByC_S(long companyId, java.lang.String sku);
418    
419            /**
420            * Caches the shopping item in the entity cache if it is enabled.
421            *
422            * @param shoppingItem the shopping item
423            */
424            public void cacheResult(ShoppingItem shoppingItem);
425    
426            /**
427            * Caches the shopping items in the entity cache if it is enabled.
428            *
429            * @param shoppingItems the shopping items
430            */
431            public void cacheResult(java.util.List<ShoppingItem> shoppingItems);
432    
433            /**
434            * Creates a new shopping item with the primary key. Does not add the shopping item to the database.
435            *
436            * @param itemId the primary key for the new shopping item
437            * @return the new shopping item
438            */
439            public ShoppingItem create(long itemId);
440    
441            /**
442            * Removes the shopping item with the primary key from the database. Also notifies the appropriate model listeners.
443            *
444            * @param itemId the primary key of the shopping item
445            * @return the shopping item that was removed
446            * @throws NoSuchItemException if a shopping item with the primary key could not be found
447            */
448            public ShoppingItem remove(long itemId)
449                    throws com.liferay.portlet.shopping.NoSuchItemException;
450    
451            public ShoppingItem updateImpl(ShoppingItem shoppingItem);
452    
453            /**
454            * Returns the shopping item with the primary key or throws a {@link NoSuchItemException} if it could not be found.
455            *
456            * @param itemId the primary key of the shopping item
457            * @return the shopping item
458            * @throws NoSuchItemException if a shopping item with the primary key could not be found
459            */
460            public ShoppingItem findByPrimaryKey(long itemId)
461                    throws com.liferay.portlet.shopping.NoSuchItemException;
462    
463            /**
464            * Returns the shopping item with the primary key or returns <code>null</code> if it could not be found.
465            *
466            * @param itemId the primary key of the shopping item
467            * @return the shopping item, or <code>null</code> if a shopping item with the primary key could not be found
468            */
469            public ShoppingItem fetchByPrimaryKey(long itemId);
470    
471            @Override
472            public java.util.Map<java.io.Serializable, ShoppingItem> fetchByPrimaryKeys(
473                    java.util.Set<java.io.Serializable> primaryKeys);
474    
475            /**
476            * Returns all the shopping items.
477            *
478            * @return the shopping items
479            */
480            public java.util.List<ShoppingItem> findAll();
481    
482            /**
483            * Returns a range of all the shopping items.
484            *
485            * <p>
486            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
487            * </p>
488            *
489            * @param start the lower bound of the range of shopping items
490            * @param end the upper bound of the range of shopping items (not inclusive)
491            * @return the range of shopping items
492            */
493            public java.util.List<ShoppingItem> findAll(int start, int end);
494    
495            /**
496            * Returns an ordered range of all the shopping items.
497            *
498            * <p>
499            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
500            * </p>
501            *
502            * @param start the lower bound of the range of shopping items
503            * @param end the upper bound of the range of shopping items (not inclusive)
504            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
505            * @return the ordered range of shopping items
506            */
507            public java.util.List<ShoppingItem> findAll(int start, int end,
508                    com.liferay.portal.kernel.util.OrderByComparator<ShoppingItem> orderByComparator);
509    
510            /**
511            * Removes all the shopping items from the database.
512            */
513            public void removeAll();
514    
515            /**
516            * Returns the number of shopping items.
517            *
518            * @return the number of shopping items
519            */
520            public int countAll();
521    }