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.portlet.journal.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.journal.model.JournalArticleResource;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the journal article resource service.
029     *
030     * <p>
031     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see JournalArticleResourcePersistence
036     * @see JournalArticleResourcePersistenceImpl
037     * @generated
038     */
039    public class JournalArticleResourceUtil {
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
042             */
043            public static void clearCache() {
044                    getPersistence().clearCache();
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
049             */
050            public static void clearCache(JournalArticleResource journalArticleResource) {
051                    getPersistence().clearCache(journalArticleResource);
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
056             */
057            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
058                    throws SystemException {
059                    return getPersistence().countWithDynamicQuery(dynamicQuery);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
064             */
065            public static List<JournalArticleResource> findWithDynamicQuery(
066                    DynamicQuery dynamicQuery) throws SystemException {
067                    return getPersistence().findWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
072             */
073            public static List<JournalArticleResource> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery, int start, int end)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
081             */
082            public static List<JournalArticleResource> findWithDynamicQuery(
083                    DynamicQuery dynamicQuery, int start, int end,
084                    OrderByComparator orderByComparator) throws SystemException {
085                    return getPersistence()
086                                       .findWithDynamicQuery(dynamicQuery, start, end,
087                            orderByComparator);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
092             */
093            public static JournalArticleResource remove(
094                    JournalArticleResource journalArticleResource)
095                    throws SystemException {
096                    return getPersistence().remove(journalArticleResource);
097            }
098    
099            /**
100             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
101             */
102            public static JournalArticleResource update(
103                    JournalArticleResource journalArticleResource, boolean merge)
104                    throws SystemException {
105                    return getPersistence().update(journalArticleResource, merge);
106            }
107    
108            /**
109             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
110             */
111            public static JournalArticleResource update(
112                    JournalArticleResource journalArticleResource, boolean merge,
113                    ServiceContext serviceContext) throws SystemException {
114                    return getPersistence()
115                                       .update(journalArticleResource, merge, serviceContext);
116            }
117    
118            /**
119            * Caches the journal article resource in the entity cache if it is enabled.
120            *
121            * @param journalArticleResource the journal article resource to cache
122            */
123            public static void cacheResult(
124                    com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource) {
125                    getPersistence().cacheResult(journalArticleResource);
126            }
127    
128            /**
129            * Caches the journal article resources in the entity cache if it is enabled.
130            *
131            * @param journalArticleResources the journal article resources to cache
132            */
133            public static void cacheResult(
134                    java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> journalArticleResources) {
135                    getPersistence().cacheResult(journalArticleResources);
136            }
137    
138            /**
139            * Creates a new journal article resource with the primary key.
140            *
141            * @param resourcePrimKey the primary key for the new journal article resource
142            * @return the new journal article resource
143            */
144            public static com.liferay.portlet.journal.model.JournalArticleResource create(
145                    long resourcePrimKey) {
146                    return getPersistence().create(resourcePrimKey);
147            }
148    
149            /**
150            * Removes the journal article resource with the primary key from the database. Also notifies the appropriate model listeners.
151            *
152            * @param resourcePrimKey the primary key of the journal article resource to remove
153            * @return the journal article resource that was removed
154            * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a journal article resource with the primary key could not be found
155            * @throws SystemException if a system exception occurred
156            */
157            public static com.liferay.portlet.journal.model.JournalArticleResource remove(
158                    long resourcePrimKey)
159                    throws com.liferay.portal.kernel.exception.SystemException,
160                            com.liferay.portlet.journal.NoSuchArticleResourceException {
161                    return getPersistence().remove(resourcePrimKey);
162            }
163    
164            public static com.liferay.portlet.journal.model.JournalArticleResource updateImpl(
165                    com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource,
166                    boolean merge)
167                    throws com.liferay.portal.kernel.exception.SystemException {
168                    return getPersistence().updateImpl(journalArticleResource, merge);
169            }
170    
171            /**
172            * Finds the journal article resource with the primary key or throws a {@link com.liferay.portlet.journal.NoSuchArticleResourceException} if it could not be found.
173            *
174            * @param resourcePrimKey the primary key of the journal article resource to find
175            * @return the journal article resource
176            * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a journal article resource with the primary key could not be found
177            * @throws SystemException if a system exception occurred
178            */
179            public static com.liferay.portlet.journal.model.JournalArticleResource findByPrimaryKey(
180                    long resourcePrimKey)
181                    throws com.liferay.portal.kernel.exception.SystemException,
182                            com.liferay.portlet.journal.NoSuchArticleResourceException {
183                    return getPersistence().findByPrimaryKey(resourcePrimKey);
184            }
185    
186            /**
187            * Finds the journal article resource with the primary key or returns <code>null</code> if it could not be found.
188            *
189            * @param resourcePrimKey the primary key of the journal article resource to find
190            * @return the journal article resource, or <code>null</code> if a journal article resource with the primary key could not be found
191            * @throws SystemException if a system exception occurred
192            */
193            public static com.liferay.portlet.journal.model.JournalArticleResource fetchByPrimaryKey(
194                    long resourcePrimKey)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence().fetchByPrimaryKey(resourcePrimKey);
197            }
198    
199            /**
200            * Finds all the journal article resources where groupId = &#63;.
201            *
202            * @param groupId the group id to search with
203            * @return the matching journal article resources
204            * @throws SystemException if a system exception occurred
205            */
206            public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId(
207                    long groupId)
208                    throws com.liferay.portal.kernel.exception.SystemException {
209                    return getPersistence().findByGroupId(groupId);
210            }
211    
212            /**
213            * Finds a range of all the journal article resources where groupId = &#63;.
214            *
215            * <p>
216            * 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
217            * </p>
218            *
219            * @param groupId the group id to search with
220            * @param start the lower bound of the range of journal article resources to return
221            * @param end the upper bound of the range of journal article resources to return (not inclusive)
222            * @return the range of matching journal article resources
223            * @throws SystemException if a system exception occurred
224            */
225            public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId(
226                    long groupId, int start, int end)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().findByGroupId(groupId, start, end);
229            }
230    
231            /**
232            * Finds an ordered range of all the journal article resources where groupId = &#63;.
233            *
234            * <p>
235            * 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
236            * </p>
237            *
238            * @param groupId the group id to search with
239            * @param start the lower bound of the range of journal article resources to return
240            * @param end the upper bound of the range of journal article resources to return (not inclusive)
241            * @param orderByComparator the comparator to order the results by
242            * @return the ordered range of matching journal article resources
243            * @throws SystemException if a system exception occurred
244            */
245            public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId(
246                    long groupId, int start, int end,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.kernel.exception.SystemException {
249                    return getPersistence()
250                                       .findByGroupId(groupId, start, end, orderByComparator);
251            }
252    
253            /**
254            * Finds the first journal article resource in the ordered set where groupId = &#63;.
255            *
256            * <p>
257            * 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
258            * </p>
259            *
260            * @param groupId the group id to search with
261            * @param orderByComparator the comparator to order the set by
262            * @return the first matching journal article resource
263            * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a matching journal article resource could not be found
264            * @throws SystemException if a system exception occurred
265            */
266            public static com.liferay.portlet.journal.model.JournalArticleResource findByGroupId_First(
267                    long groupId,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.kernel.exception.SystemException,
270                            com.liferay.portlet.journal.NoSuchArticleResourceException {
271                    return getPersistence().findByGroupId_First(groupId, orderByComparator);
272            }
273    
274            /**
275            * Finds the last journal article resource in the ordered set where groupId = &#63;.
276            *
277            * <p>
278            * 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
279            * </p>
280            *
281            * @param groupId the group id to search with
282            * @param orderByComparator the comparator to order the set by
283            * @return the last matching journal article resource
284            * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a matching journal article resource could not be found
285            * @throws SystemException if a system exception occurred
286            */
287            public static com.liferay.portlet.journal.model.JournalArticleResource findByGroupId_Last(
288                    long groupId,
289                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
290                    throws com.liferay.portal.kernel.exception.SystemException,
291                            com.liferay.portlet.journal.NoSuchArticleResourceException {
292                    return getPersistence().findByGroupId_Last(groupId, orderByComparator);
293            }
294    
295            /**
296            * Finds the journal article resources before and after the current journal article resource in the ordered set where groupId = &#63;.
297            *
298            * <p>
299            * 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
300            * </p>
301            *
302            * @param resourcePrimKey the primary key of the current journal article resource
303            * @param groupId the group id to search with
304            * @param orderByComparator the comparator to order the set by
305            * @return the previous, current, and next journal article resource
306            * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a journal article resource with the primary key could not be found
307            * @throws SystemException if a system exception occurred
308            */
309            public static com.liferay.portlet.journal.model.JournalArticleResource[] findByGroupId_PrevAndNext(
310                    long resourcePrimKey, long groupId,
311                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
312                    throws com.liferay.portal.kernel.exception.SystemException,
313                            com.liferay.portlet.journal.NoSuchArticleResourceException {
314                    return getPersistence()
315                                       .findByGroupId_PrevAndNext(resourcePrimKey, groupId,
316                            orderByComparator);
317            }
318    
319            /**
320            * Finds the journal article resource where groupId = &#63; and articleId = &#63; or throws a {@link com.liferay.portlet.journal.NoSuchArticleResourceException} if it could not be found.
321            *
322            * @param groupId the group id to search with
323            * @param articleId the article id to search with
324            * @return the matching journal article resource
325            * @throws com.liferay.portlet.journal.NoSuchArticleResourceException if a matching journal article resource could not be found
326            * @throws SystemException if a system exception occurred
327            */
328            public static com.liferay.portlet.journal.model.JournalArticleResource findByG_A(
329                    long groupId, java.lang.String articleId)
330                    throws com.liferay.portal.kernel.exception.SystemException,
331                            com.liferay.portlet.journal.NoSuchArticleResourceException {
332                    return getPersistence().findByG_A(groupId, articleId);
333            }
334    
335            /**
336            * Finds the journal article resource where groupId = &#63; and articleId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
337            *
338            * @param groupId the group id to search with
339            * @param articleId the article id to search with
340            * @return the matching journal article resource, or <code>null</code> if a matching journal article resource could not be found
341            * @throws SystemException if a system exception occurred
342            */
343            public static com.liferay.portlet.journal.model.JournalArticleResource fetchByG_A(
344                    long groupId, java.lang.String articleId)
345                    throws com.liferay.portal.kernel.exception.SystemException {
346                    return getPersistence().fetchByG_A(groupId, articleId);
347            }
348    
349            /**
350            * Finds the journal article resource where groupId = &#63; and articleId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
351            *
352            * @param groupId the group id to search with
353            * @param articleId the article id to search with
354            * @return the matching journal article resource, or <code>null</code> if a matching journal article resource could not be found
355            * @throws SystemException if a system exception occurred
356            */
357            public static com.liferay.portlet.journal.model.JournalArticleResource fetchByG_A(
358                    long groupId, java.lang.String articleId, boolean retrieveFromCache)
359                    throws com.liferay.portal.kernel.exception.SystemException {
360                    return getPersistence().fetchByG_A(groupId, articleId, retrieveFromCache);
361            }
362    
363            /**
364            * Finds all the journal article resources.
365            *
366            * @return the journal article resources
367            * @throws SystemException if a system exception occurred
368            */
369            public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll()
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getPersistence().findAll();
372            }
373    
374            /**
375            * Finds a range of all the journal article resources.
376            *
377            * <p>
378            * 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
379            * </p>
380            *
381            * @param start the lower bound of the range of journal article resources to return
382            * @param end the upper bound of the range of journal article resources to return (not inclusive)
383            * @return the range of journal article resources
384            * @throws SystemException if a system exception occurred
385            */
386            public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll(
387                    int start, int end)
388                    throws com.liferay.portal.kernel.exception.SystemException {
389                    return getPersistence().findAll(start, end);
390            }
391    
392            /**
393            * Finds an ordered range of all the journal article resources.
394            *
395            * <p>
396            * 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
397            * </p>
398            *
399            * @param start the lower bound of the range of journal article resources to return
400            * @param end the upper bound of the range of journal article resources to return (not inclusive)
401            * @param orderByComparator the comparator to order the results by
402            * @return the ordered range of journal article resources
403            * @throws SystemException if a system exception occurred
404            */
405            public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll(
406                    int start, int end,
407                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
408                    throws com.liferay.portal.kernel.exception.SystemException {
409                    return getPersistence().findAll(start, end, orderByComparator);
410            }
411    
412            /**
413            * Removes all the journal article resources where groupId = &#63; from the database.
414            *
415            * @param groupId the group id to search with
416            * @throws SystemException if a system exception occurred
417            */
418            public static void removeByGroupId(long groupId)
419                    throws com.liferay.portal.kernel.exception.SystemException {
420                    getPersistence().removeByGroupId(groupId);
421            }
422    
423            /**
424            * Removes the journal article resource where groupId = &#63; and articleId = &#63; from the database.
425            *
426            * @param groupId the group id to search with
427            * @param articleId the article id to search with
428            * @throws SystemException if a system exception occurred
429            */
430            public static void removeByG_A(long groupId, java.lang.String articleId)
431                    throws com.liferay.portal.kernel.exception.SystemException,
432                            com.liferay.portlet.journal.NoSuchArticleResourceException {
433                    getPersistence().removeByG_A(groupId, articleId);
434            }
435    
436            /**
437            * Removes all the journal article resources from the database.
438            *
439            * @throws SystemException if a system exception occurred
440            */
441            public static void removeAll()
442                    throws com.liferay.portal.kernel.exception.SystemException {
443                    getPersistence().removeAll();
444            }
445    
446            /**
447            * Counts all the journal article resources where groupId = &#63;.
448            *
449            * @param groupId the group id to search with
450            * @return the number of matching journal article resources
451            * @throws SystemException if a system exception occurred
452            */
453            public static int countByGroupId(long groupId)
454                    throws com.liferay.portal.kernel.exception.SystemException {
455                    return getPersistence().countByGroupId(groupId);
456            }
457    
458            /**
459            * Counts all the journal article resources where groupId = &#63; and articleId = &#63;.
460            *
461            * @param groupId the group id to search with
462            * @param articleId the article id to search with
463            * @return the number of matching journal article resources
464            * @throws SystemException if a system exception occurred
465            */
466            public static int countByG_A(long groupId, java.lang.String articleId)
467                    throws com.liferay.portal.kernel.exception.SystemException {
468                    return getPersistence().countByG_A(groupId, articleId);
469            }
470    
471            /**
472            * Counts all the journal article resources.
473            *
474            * @return the number of journal article resources
475            * @throws SystemException if a system exception occurred
476            */
477            public static int countAll()
478                    throws com.liferay.portal.kernel.exception.SystemException {
479                    return getPersistence().countAll();
480            }
481    
482            public static JournalArticleResourcePersistence getPersistence() {
483                    if (_persistence == null) {
484                            _persistence = (JournalArticleResourcePersistence)PortalBeanLocatorUtil.locate(JournalArticleResourcePersistence.class.getName());
485                    }
486    
487                    return _persistence;
488            }
489    
490            public void setPersistence(JournalArticleResourcePersistence persistence) {
491                    _persistence = persistence;
492            }
493    
494            private static JournalArticleResourcePersistence _persistence;
495    }