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.portal.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.model.PasswordTracker;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the password tracker service. This utility wraps {@link PasswordTrackerPersistenceImpl} 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.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see PasswordTrackerPersistence
036     * @see PasswordTrackerPersistenceImpl
037     * @generated
038     */
039    public class PasswordTrackerUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(PasswordTracker passwordTracker) {
057                    getPersistence().clearCache(passwordTracker);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<PasswordTracker> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<PasswordTracker> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    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<PasswordTracker> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) 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 PasswordTracker update(PasswordTracker passwordTracker,
100                    boolean merge) throws SystemException {
101                    return getPersistence().update(passwordTracker, merge);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
106             */
107            public static PasswordTracker update(PasswordTracker passwordTracker,
108                    boolean merge, ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(passwordTracker, merge, serviceContext);
110            }
111    
112            /**
113            * Caches the password tracker in the entity cache if it is enabled.
114            *
115            * @param passwordTracker the password tracker
116            */
117            public static void cacheResult(
118                    com.liferay.portal.model.PasswordTracker passwordTracker) {
119                    getPersistence().cacheResult(passwordTracker);
120            }
121    
122            /**
123            * Caches the password trackers in the entity cache if it is enabled.
124            *
125            * @param passwordTrackers the password trackers
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portal.model.PasswordTracker> passwordTrackers) {
129                    getPersistence().cacheResult(passwordTrackers);
130            }
131    
132            /**
133            * Creates a new password tracker with the primary key. Does not add the password tracker to the database.
134            *
135            * @param passwordTrackerId the primary key for the new password tracker
136            * @return the new password tracker
137            */
138            public static com.liferay.portal.model.PasswordTracker create(
139                    long passwordTrackerId) {
140                    return getPersistence().create(passwordTrackerId);
141            }
142    
143            /**
144            * Removes the password tracker with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param passwordTrackerId the primary key of the password tracker
147            * @return the password tracker that was removed
148            * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portal.model.PasswordTracker remove(
152                    long passwordTrackerId)
153                    throws com.liferay.portal.NoSuchPasswordTrackerException,
154                            com.liferay.portal.kernel.exception.SystemException {
155                    return getPersistence().remove(passwordTrackerId);
156            }
157    
158            public static com.liferay.portal.model.PasswordTracker updateImpl(
159                    com.liferay.portal.model.PasswordTracker passwordTracker, boolean merge)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence().updateImpl(passwordTracker, merge);
162            }
163    
164            /**
165            * Returns the password tracker with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordTrackerException} if it could not be found.
166            *
167            * @param passwordTrackerId the primary key of the password tracker
168            * @return the password tracker
169            * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public static com.liferay.portal.model.PasswordTracker findByPrimaryKey(
173                    long passwordTrackerId)
174                    throws com.liferay.portal.NoSuchPasswordTrackerException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getPersistence().findByPrimaryKey(passwordTrackerId);
177            }
178    
179            /**
180            * Returns the password tracker with the primary key or returns <code>null</code> if it could not be found.
181            *
182            * @param passwordTrackerId the primary key of the password tracker
183            * @return the password tracker, or <code>null</code> if a password tracker with the primary key could not be found
184            * @throws SystemException if a system exception occurred
185            */
186            public static com.liferay.portal.model.PasswordTracker fetchByPrimaryKey(
187                    long passwordTrackerId)
188                    throws com.liferay.portal.kernel.exception.SystemException {
189                    return getPersistence().fetchByPrimaryKey(passwordTrackerId);
190            }
191    
192            /**
193            * Returns all the password trackers where userId = &#63;.
194            *
195            * @param userId the user ID
196            * @return the matching password trackers
197            * @throws SystemException if a system exception occurred
198            */
199            public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId(
200                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
201                    return getPersistence().findByUserId(userId);
202            }
203    
204            /**
205            * Returns a range of all the password trackers where userId = &#63;.
206            *
207            * <p>
208            * 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.
209            * </p>
210            *
211            * @param userId the user ID
212            * @param start the lower bound of the range of password trackers
213            * @param end the upper bound of the range of password trackers (not inclusive)
214            * @return the range of matching password trackers
215            * @throws SystemException if a system exception occurred
216            */
217            public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId(
218                    long userId, int start, int end)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getPersistence().findByUserId(userId, start, end);
221            }
222    
223            /**
224            * Returns an ordered range of all the password trackers where userId = &#63;.
225            *
226            * <p>
227            * 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.
228            * </p>
229            *
230            * @param userId the user ID
231            * @param start the lower bound of the range of password trackers
232            * @param end the upper bound of the range of password trackers (not inclusive)
233            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
234            * @return the ordered range of matching password trackers
235            * @throws SystemException if a system exception occurred
236            */
237            public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId(
238                    long userId, int start, int end,
239                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
240                    throws com.liferay.portal.kernel.exception.SystemException {
241                    return getPersistence()
242                                       .findByUserId(userId, start, end, orderByComparator);
243            }
244    
245            /**
246            * Returns the first password tracker in the ordered set where userId = &#63;.
247            *
248            * @param userId the user ID
249            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
250            * @return the first matching password tracker
251            * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portal.model.PasswordTracker findByUserId_First(
255                    long userId,
256                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
257                    throws com.liferay.portal.NoSuchPasswordTrackerException,
258                            com.liferay.portal.kernel.exception.SystemException {
259                    return getPersistence().findByUserId_First(userId, orderByComparator);
260            }
261    
262            /**
263            * Returns the first password tracker in the ordered set where userId = &#63;.
264            *
265            * @param userId the user ID
266            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
267            * @return the first matching password tracker, or <code>null</code> if a matching password tracker could not be found
268            * @throws SystemException if a system exception occurred
269            */
270            public static com.liferay.portal.model.PasswordTracker fetchByUserId_First(
271                    long userId,
272                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
273                    throws com.liferay.portal.kernel.exception.SystemException {
274                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
275            }
276    
277            /**
278            * Returns the last password tracker in the ordered set where userId = &#63;.
279            *
280            * @param userId the user ID
281            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
282            * @return the last matching password tracker
283            * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found
284            * @throws SystemException if a system exception occurred
285            */
286            public static com.liferay.portal.model.PasswordTracker findByUserId_Last(
287                    long userId,
288                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
289                    throws com.liferay.portal.NoSuchPasswordTrackerException,
290                            com.liferay.portal.kernel.exception.SystemException {
291                    return getPersistence().findByUserId_Last(userId, orderByComparator);
292            }
293    
294            /**
295            * Returns the last password tracker in the ordered set where userId = &#63;.
296            *
297            * @param userId the user ID
298            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
299            * @return the last matching password tracker, or <code>null</code> if a matching password tracker could not be found
300            * @throws SystemException if a system exception occurred
301            */
302            public static com.liferay.portal.model.PasswordTracker fetchByUserId_Last(
303                    long userId,
304                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
305                    throws com.liferay.portal.kernel.exception.SystemException {
306                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
307            }
308    
309            /**
310            * Returns the password trackers before and after the current password tracker in the ordered set where userId = &#63;.
311            *
312            * @param passwordTrackerId the primary key of the current password tracker
313            * @param userId the user ID
314            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
315            * @return the previous, current, and next password tracker
316            * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public static com.liferay.portal.model.PasswordTracker[] findByUserId_PrevAndNext(
320                    long passwordTrackerId, long userId,
321                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
322                    throws com.liferay.portal.NoSuchPasswordTrackerException,
323                            com.liferay.portal.kernel.exception.SystemException {
324                    return getPersistence()
325                                       .findByUserId_PrevAndNext(passwordTrackerId, userId,
326                            orderByComparator);
327            }
328    
329            /**
330            * Returns all the password trackers.
331            *
332            * @return the password trackers
333            * @throws SystemException if a system exception occurred
334            */
335            public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll()
336                    throws com.liferay.portal.kernel.exception.SystemException {
337                    return getPersistence().findAll();
338            }
339    
340            /**
341            * Returns a range of all the password trackers.
342            *
343            * <p>
344            * 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.
345            * </p>
346            *
347            * @param start the lower bound of the range of password trackers
348            * @param end the upper bound of the range of password trackers (not inclusive)
349            * @return the range of password trackers
350            * @throws SystemException if a system exception occurred
351            */
352            public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll(
353                    int start, int end)
354                    throws com.liferay.portal.kernel.exception.SystemException {
355                    return getPersistence().findAll(start, end);
356            }
357    
358            /**
359            * Returns an ordered range of all the password trackers.
360            *
361            * <p>
362            * 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.
363            * </p>
364            *
365            * @param start the lower bound of the range of password trackers
366            * @param end the upper bound of the range of password trackers (not inclusive)
367            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
368            * @return the ordered range of password trackers
369            * @throws SystemException if a system exception occurred
370            */
371            public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll(
372                    int start, int end,
373                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
374                    throws com.liferay.portal.kernel.exception.SystemException {
375                    return getPersistence().findAll(start, end, orderByComparator);
376            }
377    
378            /**
379            * Removes all the password trackers where userId = &#63; from the database.
380            *
381            * @param userId the user ID
382            * @throws SystemException if a system exception occurred
383            */
384            public static void removeByUserId(long userId)
385                    throws com.liferay.portal.kernel.exception.SystemException {
386                    getPersistence().removeByUserId(userId);
387            }
388    
389            /**
390            * Removes all the password trackers from the database.
391            *
392            * @throws SystemException if a system exception occurred
393            */
394            public static void removeAll()
395                    throws com.liferay.portal.kernel.exception.SystemException {
396                    getPersistence().removeAll();
397            }
398    
399            /**
400            * Returns the number of password trackers where userId = &#63;.
401            *
402            * @param userId the user ID
403            * @return the number of matching password trackers
404            * @throws SystemException if a system exception occurred
405            */
406            public static int countByUserId(long userId)
407                    throws com.liferay.portal.kernel.exception.SystemException {
408                    return getPersistence().countByUserId(userId);
409            }
410    
411            /**
412            * Returns the number of password trackers.
413            *
414            * @return the number of password trackers
415            * @throws SystemException if a system exception occurred
416            */
417            public static int countAll()
418                    throws com.liferay.portal.kernel.exception.SystemException {
419                    return getPersistence().countAll();
420            }
421    
422            public static PasswordTrackerPersistence getPersistence() {
423                    if (_persistence == null) {
424                            _persistence = (PasswordTrackerPersistence)PortalBeanLocatorUtil.locate(PasswordTrackerPersistence.class.getName());
425    
426                            ReferenceRegistry.registerReference(PasswordTrackerUtil.class,
427                                    "_persistence");
428                    }
429    
430                    return _persistence;
431            }
432    
433            /**
434             * @deprecated
435             */
436            public void setPersistence(PasswordTrackerPersistence persistence) {
437            }
438    
439            private static PasswordTrackerPersistence _persistence;
440    }