001    /**
002     * Copyright (c) 2000-2013 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            * @param companyId the company ID
302            * @param modifiedDate the modified date
303            * @param repositoryId the repository ID
304            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
305            * @return the first matching d l sync
306            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found
307            * @throws SystemException if a system exception occurred
308            */
309            public static com.liferay.portlet.documentlibrary.model.DLSync findByC_M_R_First(
310                    long companyId, java.util.Date modifiedDate, long repositoryId,
311                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
312                    throws com.liferay.portal.kernel.exception.SystemException,
313                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
314                    return getPersistence()
315                                       .findByC_M_R_First(companyId, modifiedDate, repositoryId,
316                            orderByComparator);
317            }
318    
319            /**
320            * Returns the first d l sync in the ordered set where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
321            *
322            * @param companyId the company ID
323            * @param modifiedDate the modified date
324            * @param repositoryId the repository ID
325            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
326            * @return the first matching d l sync, or <code>null</code> if a matching d l sync could not be found
327            * @throws SystemException if a system exception occurred
328            */
329            public static com.liferay.portlet.documentlibrary.model.DLSync fetchByC_M_R_First(
330                    long companyId, java.util.Date modifiedDate, long repositoryId,
331                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
332                    throws com.liferay.portal.kernel.exception.SystemException {
333                    return getPersistence()
334                                       .fetchByC_M_R_First(companyId, modifiedDate, repositoryId,
335                            orderByComparator);
336            }
337    
338            /**
339            * Returns the last d l sync in the ordered set where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
340            *
341            * @param companyId the company ID
342            * @param modifiedDate the modified date
343            * @param repositoryId the repository ID
344            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
345            * @return the last matching d l sync
346            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a matching d l sync could not be found
347            * @throws SystemException if a system exception occurred
348            */
349            public static com.liferay.portlet.documentlibrary.model.DLSync findByC_M_R_Last(
350                    long companyId, java.util.Date modifiedDate, long repositoryId,
351                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
352                    throws com.liferay.portal.kernel.exception.SystemException,
353                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
354                    return getPersistence()
355                                       .findByC_M_R_Last(companyId, modifiedDate, repositoryId,
356                            orderByComparator);
357            }
358    
359            /**
360            * Returns the last d l sync in the ordered set where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
361            *
362            * @param companyId the company ID
363            * @param modifiedDate the modified date
364            * @param repositoryId the repository ID
365            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
366            * @return the last matching d l sync, or <code>null</code> if a matching d l sync could not be found
367            * @throws SystemException if a system exception occurred
368            */
369            public static com.liferay.portlet.documentlibrary.model.DLSync fetchByC_M_R_Last(
370                    long companyId, java.util.Date modifiedDate, long repositoryId,
371                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    return getPersistence()
374                                       .fetchByC_M_R_Last(companyId, modifiedDate, repositoryId,
375                            orderByComparator);
376            }
377    
378            /**
379            * 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;.
380            *
381            * @param syncId the primary key of the current d l sync
382            * @param companyId the company ID
383            * @param modifiedDate the modified date
384            * @param repositoryId the repository ID
385            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
386            * @return the previous, current, and next d l sync
387            * @throws com.liferay.portlet.documentlibrary.NoSuchSyncException if a d l sync with the primary key could not be found
388            * @throws SystemException if a system exception occurred
389            */
390            public static com.liferay.portlet.documentlibrary.model.DLSync[] findByC_M_R_PrevAndNext(
391                    long syncId, long companyId, java.util.Date modifiedDate,
392                    long repositoryId,
393                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
394                    throws com.liferay.portal.kernel.exception.SystemException,
395                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
396                    return getPersistence()
397                                       .findByC_M_R_PrevAndNext(syncId, companyId, modifiedDate,
398                            repositoryId, orderByComparator);
399            }
400    
401            /**
402            * Returns all the d l syncs.
403            *
404            * @return the d l syncs
405            * @throws SystemException if a system exception occurred
406            */
407            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll()
408                    throws com.liferay.portal.kernel.exception.SystemException {
409                    return getPersistence().findAll();
410            }
411    
412            /**
413            * Returns a range of all the d l syncs.
414            *
415            * <p>
416            * 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.
417            * </p>
418            *
419            * @param start the lower bound of the range of d l syncs
420            * @param end the upper bound of the range of d l syncs (not inclusive)
421            * @return the range of d l syncs
422            * @throws SystemException if a system exception occurred
423            */
424            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll(
425                    int start, int end)
426                    throws com.liferay.portal.kernel.exception.SystemException {
427                    return getPersistence().findAll(start, end);
428            }
429    
430            /**
431            * Returns an ordered range of all the d l syncs.
432            *
433            * <p>
434            * 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.
435            * </p>
436            *
437            * @param start the lower bound of the range of d l syncs
438            * @param end the upper bound of the range of d l syncs (not inclusive)
439            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
440            * @return the ordered range of d l syncs
441            * @throws SystemException if a system exception occurred
442            */
443            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLSync> findAll(
444                    int start, int end,
445                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
446                    throws com.liferay.portal.kernel.exception.SystemException {
447                    return getPersistence().findAll(start, end, orderByComparator);
448            }
449    
450            /**
451            * Removes the d l sync where fileId = &#63; from the database.
452            *
453            * @param fileId the file ID
454            * @return the d l sync that was removed
455            * @throws SystemException if a system exception occurred
456            */
457            public static com.liferay.portlet.documentlibrary.model.DLSync removeByFileId(
458                    long fileId)
459                    throws com.liferay.portal.kernel.exception.SystemException,
460                            com.liferay.portlet.documentlibrary.NoSuchSyncException {
461                    return getPersistence().removeByFileId(fileId);
462            }
463    
464            /**
465            * Removes all the d l syncs where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63; from the database.
466            *
467            * @param companyId the company ID
468            * @param modifiedDate the modified date
469            * @param repositoryId the repository ID
470            * @throws SystemException if a system exception occurred
471            */
472            public static void removeByC_M_R(long companyId,
473                    java.util.Date modifiedDate, long repositoryId)
474                    throws com.liferay.portal.kernel.exception.SystemException {
475                    getPersistence().removeByC_M_R(companyId, modifiedDate, repositoryId);
476            }
477    
478            /**
479            * Removes all the d l syncs from the database.
480            *
481            * @throws SystemException if a system exception occurred
482            */
483            public static void removeAll()
484                    throws com.liferay.portal.kernel.exception.SystemException {
485                    getPersistence().removeAll();
486            }
487    
488            /**
489            * Returns the number of d l syncs where fileId = &#63;.
490            *
491            * @param fileId the file ID
492            * @return the number of matching d l syncs
493            * @throws SystemException if a system exception occurred
494            */
495            public static int countByFileId(long fileId)
496                    throws com.liferay.portal.kernel.exception.SystemException {
497                    return getPersistence().countByFileId(fileId);
498            }
499    
500            /**
501            * Returns the number of d l syncs where companyId = &#63; and modifiedDate &ge; &#63; and repositoryId = &#63;.
502            *
503            * @param companyId the company ID
504            * @param modifiedDate the modified date
505            * @param repositoryId the repository ID
506            * @return the number of matching d l syncs
507            * @throws SystemException if a system exception occurred
508            */
509            public static int countByC_M_R(long companyId, java.util.Date modifiedDate,
510                    long repositoryId)
511                    throws com.liferay.portal.kernel.exception.SystemException {
512                    return getPersistence()
513                                       .countByC_M_R(companyId, modifiedDate, repositoryId);
514            }
515    
516            /**
517            * Returns the number of d l syncs.
518            *
519            * @return the number of d l syncs
520            * @throws SystemException if a system exception occurred
521            */
522            public static int countAll()
523                    throws com.liferay.portal.kernel.exception.SystemException {
524                    return getPersistence().countAll();
525            }
526    
527            public static DLSyncPersistence getPersistence() {
528                    if (_persistence == null) {
529                            _persistence = (DLSyncPersistence)PortalBeanLocatorUtil.locate(DLSyncPersistence.class.getName());
530    
531                            ReferenceRegistry.registerReference(DLSyncUtil.class, "_persistence");
532                    }
533    
534                    return _persistence;
535            }
536    
537            /**
538             * @deprecated
539             */
540            public void setPersistence(DLSyncPersistence persistence) {
541            }
542    
543            private static DLSyncPersistence _persistence;
544    }