001    /**
002     * Copyright (c) 2000-2011 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.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
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
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
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            * Returns 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
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            * Returns 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
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            * Returns all the wiki page resources where uuid = &#63;.
204            *
205            * @param uuid the uuid
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            * Returns 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
223            * @param start the lower bound of the range of wiki page resources
224            * @param end the upper bound of the range of wiki page resources (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            * Returns 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
242            * @param start the lower bound of the range of wiki page resources
243            * @param end the upper bound of the range of wiki page resources (not inclusive)
244            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
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            * Returns 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
263            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
284            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
306            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
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            * Returns 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
325            * @param title the title
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            * Returns 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
341            * @param title the title
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            * Returns 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
355            * @param title the title
356            * @param retrieveFromCache whether to use the finder cache
357            * @return the matching wiki page resource, or <code>null</code> if a matching wiki page resource could not be found
358            * @throws SystemException if a system exception occurred
359            */
360            public static com.liferay.portlet.wiki.model.WikiPageResource fetchByN_T(
361                    long nodeId, java.lang.String title, boolean retrieveFromCache)
362                    throws com.liferay.portal.kernel.exception.SystemException {
363                    return getPersistence().fetchByN_T(nodeId, title, retrieveFromCache);
364            }
365    
366            /**
367            * Returns all the wiki page resources.
368            *
369            * @return the wiki page resources
370            * @throws SystemException if a system exception occurred
371            */
372            public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findAll()
373                    throws com.liferay.portal.kernel.exception.SystemException {
374                    return getPersistence().findAll();
375            }
376    
377            /**
378            * Returns a range of all the wiki page resources.
379            *
380            * <p>
381            * 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.
382            * </p>
383            *
384            * @param start the lower bound of the range of wiki page resources
385            * @param end the upper bound of the range of wiki page resources (not inclusive)
386            * @return the range of wiki page resources
387            * @throws SystemException if a system exception occurred
388            */
389            public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findAll(
390                    int start, int end)
391                    throws com.liferay.portal.kernel.exception.SystemException {
392                    return getPersistence().findAll(start, end);
393            }
394    
395            /**
396            * Returns an ordered range of all the wiki page resources.
397            *
398            * <p>
399            * 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.
400            * </p>
401            *
402            * @param start the lower bound of the range of wiki page resources
403            * @param end the upper bound of the range of wiki page resources (not inclusive)
404            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
405            * @return the ordered range of wiki page resources
406            * @throws SystemException if a system exception occurred
407            */
408            public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findAll(
409                    int start, int end,
410                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getPersistence().findAll(start, end, orderByComparator);
413            }
414    
415            /**
416            * Removes all the wiki page resources where uuid = &#63; from the database.
417            *
418            * @param uuid the uuid
419            * @throws SystemException if a system exception occurred
420            */
421            public static void removeByUuid(java.lang.String uuid)
422                    throws com.liferay.portal.kernel.exception.SystemException {
423                    getPersistence().removeByUuid(uuid);
424            }
425    
426            /**
427            * Removes the wiki page resource where nodeId = &#63; and title = &#63; from the database.
428            *
429            * @param nodeId the node ID
430            * @param title the title
431            * @throws SystemException if a system exception occurred
432            */
433            public static void removeByN_T(long nodeId, java.lang.String title)
434                    throws com.liferay.portal.kernel.exception.SystemException,
435                            com.liferay.portlet.wiki.NoSuchPageResourceException {
436                    getPersistence().removeByN_T(nodeId, title);
437            }
438    
439            /**
440            * Removes all the wiki page resources from the database.
441            *
442            * @throws SystemException if a system exception occurred
443            */
444            public static void removeAll()
445                    throws com.liferay.portal.kernel.exception.SystemException {
446                    getPersistence().removeAll();
447            }
448    
449            /**
450            * Returns the number of wiki page resources where uuid = &#63;.
451            *
452            * @param uuid the uuid
453            * @return the number of matching wiki page resources
454            * @throws SystemException if a system exception occurred
455            */
456            public static int countByUuid(java.lang.String uuid)
457                    throws com.liferay.portal.kernel.exception.SystemException {
458                    return getPersistence().countByUuid(uuid);
459            }
460    
461            /**
462            * Returns the number of wiki page resources where nodeId = &#63; and title = &#63;.
463            *
464            * @param nodeId the node ID
465            * @param title the title
466            * @return the number of matching wiki page resources
467            * @throws SystemException if a system exception occurred
468            */
469            public static int countByN_T(long nodeId, java.lang.String title)
470                    throws com.liferay.portal.kernel.exception.SystemException {
471                    return getPersistence().countByN_T(nodeId, title);
472            }
473    
474            /**
475            * Returns the number of wiki page resources.
476            *
477            * @return the number of wiki page resources
478            * @throws SystemException if a system exception occurred
479            */
480            public static int countAll()
481                    throws com.liferay.portal.kernel.exception.SystemException {
482                    return getPersistence().countAll();
483            }
484    
485            public static WikiPageResourcePersistence getPersistence() {
486                    if (_persistence == null) {
487                            _persistence = (WikiPageResourcePersistence)PortalBeanLocatorUtil.locate(WikiPageResourcePersistence.class.getName());
488    
489                            ReferenceRegistry.registerReference(WikiPageResourceUtil.class,
490                                    "_persistence");
491                    }
492    
493                    return _persistence;
494            }
495    
496            public void setPersistence(WikiPageResourcePersistence persistence) {
497                    _persistence = persistence;
498    
499                    ReferenceRegistry.registerReference(WikiPageResourceUtil.class,
500                            "_persistence");
501            }
502    
503            private static WikiPageResourcePersistence _persistence;
504    }