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