001    /**
002     * Copyright (c) 2000-2012 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.documentlibrary.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.documentlibrary.model.DLSync;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the d l sync service. This utility wraps {@link DLSyncPersistenceImpl} 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 DLSyncPersistence
037     * @see DLSyncPersistenceImpl
038     * @generated
039     */
040    public class DLSyncUtil {
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(DLSync dlSync) {
058                    getPersistence().clearCache(dlSync);
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<DLSync> findWithDynamicQuery(DynamicQuery dynamicQuery)
073                    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<DLSync> findWithDynamicQuery(DynamicQuery dynamicQuery,
081                    int start, int end) throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<DLSync> findWithDynamicQuery(DynamicQuery dynamicQuery,
089                    int start, int end, OrderByComparator orderByComparator)
090                    throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
098             */
099            public static DLSync update(DLSync dlSync, boolean merge)
100                    throws SystemException {
101                    return getPersistence().update(dlSync, merge);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
106             */
107            public static DLSync update(DLSync dlSync, boolean merge,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(dlSync, merge, serviceContext);
110            }
111    
112            /**
113            * Caches the d l sync in the entity cache if it is enabled.
114            *
115            * @param dlSync the d l sync
116            */
117            public static void cacheResult(
118                    com.liferay.portlet.documentlibrary.model.DLSync dlSync) {
119                    getPersistence().cacheResult(dlSync);
120            }
121    
122            /**
123            * Caches the d l syncs in the entity cache if it is enabled.
124            *
125            * @param dlSyncs the d l syncs
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> dlSyncs) {
129                    getPersistence().cacheResult(dlSyncs);
130            }
131    
132            /**
133            * Creates a new d l sync with the primary key. Does not add the d l sync to the database.
134            *
135            * @param syncId the primary key for the new d l sync
136            * @return the new d l sync
137            */
138            public static com.liferay.portlet.documentlibrary.model.DLSync create(
139                    long syncId) {
140                    return getPersistence().create(syncId);
141            }
142    
143            /**
144            * Removes the d l sync with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param syncId the primary key of the d l sync
147            * @return the d l sync that was removed
148            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a d l sync with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portlet.documentlibrary.model.DLSync remove(
152                    long syncId)
153                    throws com.liferay.portal.kernel.exception.SystemException,
154                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
155                    return getPersistence().remove(syncId);
156            }
157    
158            public static com.liferay.portlet.documentlibrary.model.DLSync updateImpl(
159                    com.liferay.portlet.documentlibrary.model.DLSync dlSync, boolean merge)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence().updateImpl(dlSync, merge);
162            }
163    
164            /**
165            * Returns the d l sync with the primary key or throws a {@link com.liferay.portlet.documentlibrary.NoSuchSyncException} if it could not be found.
166            *
167            * @param syncId the primary key of the d l sync
168            * @return the d l sync
169            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a d l sync with the primary key could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public static com.liferay.portlet.documentlibrary.model.DLSync findByPrimaryKey(
173                    long syncId)
174                    throws com.liferay.portal.kernel.exception.SystemException,
175                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
176                    return getPersistence().findByPrimaryKey(syncId);
177            }
178    
179            /**
180            * Returns the d l sync with the primary key or returns <code>null</code> if it could not be found.
181            *
182            * @param syncId the primary key of the d l sync
183            * @return the d l sync, or <code>null</code> if a d l sync with the primary key could not be found
184            * @throws SystemException if a system exception occurred
185            */
186            public static com.liferay.portlet.documentlibrary.model.DLSync fetchByPrimaryKey(
187                    long syncId) throws com.liferay.portal.kernel.exception.SystemException {
188                    return getPersistence().fetchByPrimaryKey(syncId);
189            }
190    
191            /**
192            * Returns the d l sync where fileId = &#63; or throws a {@link com.liferay.portlet.documentlibrary.NoSuchSyncException} if it could not be found.
193            *
194            * @param fileId the file ID
195            * @return the matching d l sync
196            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found
197            * @throws SystemException if a system exception occurred
198            */
199            public static com.liferay.portlet.documentlibrary.model.DLSync findByFileId(
200                    long fileId)
201                    throws com.liferay.portal.kernel.exception.SystemException,
202                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
203                    return getPersistence().findByFileId(fileId);
204            }
205    
206            /**
207            * Returns the d l sync where fileId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
208            *
209            * @param fileId the file ID
210            * @return the matching d l sync, or <code>null</code> if a matching d l sync could not be found
211            * @throws SystemException if a system exception occurred
212            */
213            public static com.liferay.portlet.documentlibrary.model.DLSync fetchByFileId(
214                    long fileId) throws com.liferay.portal.kernel.exception.SystemException {
215                    return getPersistence().fetchByFileId(fileId);
216            }
217    
218            /**
219            * Returns the d l sync where fileId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
220            *
221            * @param fileId the file ID
222            * @param retrieveFromCache whether to use the finder cache
223            * @return the matching d l sync, or <code>null</code> if a matching d l sync could not be found
224            * @throws SystemException if a system exception occurred
225            */
226            public static com.liferay.portlet.documentlibrary.model.DLSync fetchByFileId(
227                    long fileId, boolean retrieveFromCache)
228                    throws com.liferay.portal.kernel.exception.SystemException {
229                    return getPersistence().fetchByFileId(fileId, retrieveFromCache);
230            }
231    
232            /**
233            * Returns all the d l syncs where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
234            *
235            * @param companyId the company ID
236            * @param modifiedDate the modified date
237            * @param repositoryId the repository ID
238            * @return the matching d l syncs
239            * @throws SystemException if a system exception occurred
240            */
241            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findByC_M_R(
242                    long companyId, java.util.Date modifiedDate, long repositoryId)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getPersistence()
245                                       .findByC_M_R(companyId, modifiedDate, repositoryId);
246            }
247    
248            /**
249            * Returns a range of all the d l syncs where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
250            *
251            * <p>
252            * 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.
253            * </p>
254            *
255            * @param companyId the company ID
256            * @param modifiedDate the modified date
257            * @param repositoryId the repository ID
258            * @param start the lower bound of the range of d l syncs
259            * @param end the upper bound of the range of d l syncs (not inclusive)
260            * @return the range of matching d l syncs
261            * @throws SystemException if a system exception occurred
262            */
263            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findByC_M_R(
264                    long companyId, java.util.Date modifiedDate, long repositoryId,
265                    int start, int end)
266                    throws com.liferay.portal.kernel.exception.SystemException {
267                    return getPersistence()
268                                       .findByC_M_R(companyId, modifiedDate, repositoryId, start,
269                            end);
270            }
271    
272            /**
273            * Returns an ordered range of all the d l syncs where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
274            *
275            * <p>
276            * 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.
277            * </p>
278            *
279            * @param companyId the company ID
280            * @param modifiedDate the modified date
281            * @param repositoryId the repository ID
282            * @param start the lower bound of the range of d l syncs
283            * @param end the upper bound of the range of d l syncs (not inclusive)
284            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
285            * @return the ordered range of matching d l syncs
286            * @throws SystemException if a system exception occurred
287            */
288            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findByC_M_R(
289                    long companyId, java.util.Date modifiedDate, long repositoryId,
290                    int start, int end,
291                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
292                    throws com.liferay.portal.kernel.exception.SystemException {
293                    return getPersistence()
294                                       .findByC_M_R(companyId, modifiedDate, repositoryId, start,
295                            end, orderByComparator);
296            }
297    
298            /**
299            * Returns the first d l sync in the ordered set where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
300            *
301            * <p>
302            * 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.
303            * </p>
304            *
305            * @param companyId the company ID
306            * @param modifiedDate the modified date
307            * @param repositoryId the repository ID
308            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
309            * @return the first matching d l sync
310            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found
311            * @throws SystemException if a system exception occurred
312            */
313            public static com.liferay.portlet.documentlibrary.model.DLSync findByC_M_R_First(
314                    long companyId, java.util.Date modifiedDate, long repositoryId,
315                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
316                    throws com.liferay.portal.kernel.exception.SystemException,
317                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
318                    return getPersistence()
319                                       .findByC_M_R_First(companyId, modifiedDate, repositoryId,
320                            orderByComparator);
321            }
322    
323            /**
324            * Returns the last d l sync in the ordered set where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
325            *
326            * <p>
327            * 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.
328            * </p>
329            *
330            * @param companyId the company ID
331            * @param modifiedDate the modified date
332            * @param repositoryId the repository ID
333            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
334            * @return the last matching d l sync
335            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found
336            * @throws SystemException if a system exception occurred
337            */
338            public static com.liferay.portlet.documentlibrary.model.DLSync findByC_M_R_Last(
339                    long companyId, java.util.Date modifiedDate, long repositoryId,
340                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
341                    throws com.liferay.portal.kernel.exception.SystemException,
342                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
343                    return getPersistence()
344                                       .findByC_M_R_Last(companyId, modifiedDate, repositoryId,
345                            orderByComparator);
346            }
347    
348            /**
349            * Returns the d l syncs before and after the current d l sync in the ordered set where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
350            *
351            * <p>
352            * 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.
353            * </p>
354            *
355            * @param syncId the primary key of the current d l sync
356            * @param companyId the company ID
357            * @param modifiedDate the modified date
358            * @param repositoryId the repository ID
359            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
360            * @return the previous, current, and next d l sync
361            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a d l sync with the primary key could not be found
362            * @throws SystemException if a system exception occurred
363            */
364            public static com.liferay.portlet.documentlibrary.model.DLSync[] findByC_M_R_PrevAndNext(
365                    long syncId, long companyId, java.util.Date modifiedDate,
366                    long repositoryId,
367                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
368                    throws com.liferay.portal.kernel.exception.SystemException,
369                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
370                    return getPersistence()
371                                       .findByC_M_R_PrevAndNext(syncId, companyId, modifiedDate,
372                            repositoryId, orderByComparator);
373            }
374    
375            /**
376            * Returns all the d l syncs.
377            *
378            * @return the d l syncs
379            * @throws SystemException if a system exception occurred
380            */
381            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll()
382                    throws com.liferay.portal.kernel.exception.SystemException {
383                    return getPersistence().findAll();
384            }
385    
386            /**
387            * Returns a range of all the d l syncs.
388            *
389            * <p>
390            * 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.
391            * </p>
392            *
393            * @param start the lower bound of the range of d l syncs
394            * @param end the upper bound of the range of d l syncs (not inclusive)
395            * @return the range of d l syncs
396            * @throws SystemException if a system exception occurred
397            */
398            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll(
399                    int start, int end)
400                    throws com.liferay.portal.kernel.exception.SystemException {
401                    return getPersistence().findAll(start, end);
402            }
403    
404            /**
405            * Returns an ordered range of all the d l syncs.
406            *
407            * <p>
408            * 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.
409            * </p>
410            *
411            * @param start the lower bound of the range of d l syncs
412            * @param end the upper bound of the range of d l syncs (not inclusive)
413            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
414            * @return the ordered range of d l syncs
415            * @throws SystemException if a system exception occurred
416            */
417            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll(
418                    int start, int end,
419                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
420                    throws com.liferay.portal.kernel.exception.SystemException {
421                    return getPersistence().findAll(start, end, orderByComparator);
422            }
423    
424            /**
425            * Removes the d l sync where fileId = &#63; from the database.
426            *
427            * @param fileId the file ID
428            * @throws SystemException if a system exception occurred
429            */
430            public static void removeByFileId(long fileId)
431                    throws com.liferay.portal.kernel.exception.SystemException,
432                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
433                    getPersistence().removeByFileId(fileId);
434            }
435    
436            /**
437            * Removes all the d l syncs where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63; from the database.
438            *
439            * @param companyId the company ID
440            * @param modifiedDate the modified date
441            * @param repositoryId the repository ID
442            * @throws SystemException if a system exception occurred
443            */
444            public static void removeByC_M_R(long companyId,
445                    java.util.Date modifiedDate, long repositoryId)
446                    throws com.liferay.portal.kernel.exception.SystemException {
447                    getPersistence().removeByC_M_R(companyId, modifiedDate, repositoryId);
448            }
449    
450            /**
451            * Removes all the d l syncs from the database.
452            *
453            * @throws SystemException if a system exception occurred
454            */
455            public static void removeAll()
456                    throws com.liferay.portal.kernel.exception.SystemException {
457                    getPersistence().removeAll();
458            }
459    
460            /**
461            * Returns the number of d l syncs where fileId = &#63;.
462            *
463            * @param fileId the file ID
464            * @return the number of matching d l syncs
465            * @throws SystemException if a system exception occurred
466            */
467            public static int countByFileId(long fileId)
468                    throws com.liferay.portal.kernel.exception.SystemException {
469                    return getPersistence().countByFileId(fileId);
470            }
471    
472            /**
473            * Returns the number of d l syncs where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
474            *
475            * @param companyId the company ID
476            * @param modifiedDate the modified date
477            * @param repositoryId the repository ID
478            * @return the number of matching d l syncs
479            * @throws SystemException if a system exception occurred
480            */
481            public static int countByC_M_R(long companyId, java.util.Date modifiedDate,
482                    long repositoryId)
483                    throws com.liferay.portal.kernel.exception.SystemException {
484                    return getPersistence()
485                                       .countByC_M_R(companyId, modifiedDate, repositoryId);
486            }
487    
488            /**
489            * Returns the number of d l syncs.
490            *
491            * @return the number of d l syncs
492            * @throws SystemException if a system exception occurred
493            */
494            public static int countAll()
495                    throws com.liferay.portal.kernel.exception.SystemException {
496                    return getPersistence().countAll();
497            }
498    
499            public static DLSyncPersistence getPersistence() {
500                    if (_persistence == null) {
501                            _persistence = (DLSyncPersistence)PortalBeanLocatorUtil.locate(DLSyncPersistence.class.getName());
502    
503                            ReferenceRegistry.registerReference(DLSyncUtil.class, "_persistence");
504                    }
505    
506                    return _persistence;
507            }
508    
509            public void setPersistence(DLSyncPersistence persistence) {
510                    _persistence = persistence;
511    
512                    ReferenceRegistry.registerReference(DLSyncUtil.class, "_persistence");
513            }
514    
515            private static DLSyncPersistence _persistence;
516    }