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