001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.model.PasswordTracker;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the password tracker service. This utility wraps {@link com.liferay.portal.service.persistence.impl.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.
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 PasswordTrackerPersistence
037     * @see com.liferay.portal.service.persistence.impl.PasswordTrackerPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class PasswordTrackerUtil {
042            /*
043             * NOTE FOR DEVELOPERS:
044             *
045             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
046             */
047    
048            /**
049             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
050             */
051            public static void clearCache() {
052                    getPersistence().clearCache();
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
057             */
058            public static void clearCache(PasswordTracker passwordTracker) {
059                    getPersistence().clearCache(passwordTracker);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
064             */
065            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<PasswordTracker> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) {
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<PasswordTracker> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end) {
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<PasswordTracker> orderByComparator) {
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)
098             */
099            public static PasswordTracker update(PasswordTracker passwordTracker) {
100                    return getPersistence().update(passwordTracker);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static PasswordTracker update(PasswordTracker passwordTracker,
107                    ServiceContext serviceContext) {
108                    return getPersistence().update(passwordTracker, serviceContext);
109            }
110    
111            /**
112            * Returns all the password trackers where userId = &#63;.
113            *
114            * @param userId the user ID
115            * @return the matching password trackers
116            */
117            public static List<PasswordTracker> findByUserId(long userId) {
118                    return getPersistence().findByUserId(userId);
119            }
120    
121            /**
122            * Returns a range of all the password trackers where userId = &#63;.
123            *
124            * <p>
125            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PasswordTrackerModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
126            * </p>
127            *
128            * @param userId the user ID
129            * @param start the lower bound of the range of password trackers
130            * @param end the upper bound of the range of password trackers (not inclusive)
131            * @return the range of matching password trackers
132            */
133            public static List<PasswordTracker> findByUserId(long userId, int start,
134                    int end) {
135                    return getPersistence().findByUserId(userId, start, end);
136            }
137    
138            /**
139            * Returns an ordered range of all the password trackers where userId = &#63;.
140            *
141            * <p>
142            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PasswordTrackerModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
143            * </p>
144            *
145            * @param userId the user ID
146            * @param start the lower bound of the range of password trackers
147            * @param end the upper bound of the range of password trackers (not inclusive)
148            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
149            * @return the ordered range of matching password trackers
150            */
151            public static List<PasswordTracker> findByUserId(long userId, int start,
152                    int end, OrderByComparator<PasswordTracker> orderByComparator) {
153                    return getPersistence()
154                                       .findByUserId(userId, start, end, orderByComparator);
155            }
156    
157            /**
158            * Returns the first password tracker in the ordered set where userId = &#63;.
159            *
160            * @param userId the user ID
161            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
162            * @return the first matching password tracker
163            * @throws NoSuchPasswordTrackerException if a matching password tracker could not be found
164            */
165            public static PasswordTracker findByUserId_First(long userId,
166                    OrderByComparator<PasswordTracker> orderByComparator)
167                    throws com.liferay.portal.NoSuchPasswordTrackerException {
168                    return getPersistence().findByUserId_First(userId, orderByComparator);
169            }
170    
171            /**
172            * Returns the first password tracker in the ordered set where userId = &#63;.
173            *
174            * @param userId the user ID
175            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
176            * @return the first matching password tracker, or <code>null</code> if a matching password tracker could not be found
177            */
178            public static PasswordTracker fetchByUserId_First(long userId,
179                    OrderByComparator<PasswordTracker> orderByComparator) {
180                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
181            }
182    
183            /**
184            * Returns the last password tracker in the ordered set where userId = &#63;.
185            *
186            * @param userId the user ID
187            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
188            * @return the last matching password tracker
189            * @throws NoSuchPasswordTrackerException if a matching password tracker could not be found
190            */
191            public static PasswordTracker findByUserId_Last(long userId,
192                    OrderByComparator<PasswordTracker> orderByComparator)
193                    throws com.liferay.portal.NoSuchPasswordTrackerException {
194                    return getPersistence().findByUserId_Last(userId, orderByComparator);
195            }
196    
197            /**
198            * Returns the last password tracker in the ordered set where userId = &#63;.
199            *
200            * @param userId the user ID
201            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
202            * @return the last matching password tracker, or <code>null</code> if a matching password tracker could not be found
203            */
204            public static PasswordTracker fetchByUserId_Last(long userId,
205                    OrderByComparator<PasswordTracker> orderByComparator) {
206                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
207            }
208    
209            /**
210            * Returns the password trackers before and after the current password tracker in the ordered set where userId = &#63;.
211            *
212            * @param passwordTrackerId the primary key of the current password tracker
213            * @param userId the user ID
214            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
215            * @return the previous, current, and next password tracker
216            * @throws NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
217            */
218            public static PasswordTracker[] findByUserId_PrevAndNext(
219                    long passwordTrackerId, long userId,
220                    OrderByComparator<PasswordTracker> orderByComparator)
221                    throws com.liferay.portal.NoSuchPasswordTrackerException {
222                    return getPersistence()
223                                       .findByUserId_PrevAndNext(passwordTrackerId, userId,
224                            orderByComparator);
225            }
226    
227            /**
228            * Removes all the password trackers where userId = &#63; from the database.
229            *
230            * @param userId the user ID
231            */
232            public static void removeByUserId(long userId) {
233                    getPersistence().removeByUserId(userId);
234            }
235    
236            /**
237            * Returns the number of password trackers where userId = &#63;.
238            *
239            * @param userId the user ID
240            * @return the number of matching password trackers
241            */
242            public static int countByUserId(long userId) {
243                    return getPersistence().countByUserId(userId);
244            }
245    
246            /**
247            * Caches the password tracker in the entity cache if it is enabled.
248            *
249            * @param passwordTracker the password tracker
250            */
251            public static void cacheResult(PasswordTracker passwordTracker) {
252                    getPersistence().cacheResult(passwordTracker);
253            }
254    
255            /**
256            * Caches the password trackers in the entity cache if it is enabled.
257            *
258            * @param passwordTrackers the password trackers
259            */
260            public static void cacheResult(List<PasswordTracker> passwordTrackers) {
261                    getPersistence().cacheResult(passwordTrackers);
262            }
263    
264            /**
265            * Creates a new password tracker with the primary key. Does not add the password tracker to the database.
266            *
267            * @param passwordTrackerId the primary key for the new password tracker
268            * @return the new password tracker
269            */
270            public static PasswordTracker create(long passwordTrackerId) {
271                    return getPersistence().create(passwordTrackerId);
272            }
273    
274            /**
275            * Removes the password tracker with the primary key from the database. Also notifies the appropriate model listeners.
276            *
277            * @param passwordTrackerId the primary key of the password tracker
278            * @return the password tracker that was removed
279            * @throws NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
280            */
281            public static PasswordTracker remove(long passwordTrackerId)
282                    throws com.liferay.portal.NoSuchPasswordTrackerException {
283                    return getPersistence().remove(passwordTrackerId);
284            }
285    
286            public static PasswordTracker updateImpl(PasswordTracker passwordTracker) {
287                    return getPersistence().updateImpl(passwordTracker);
288            }
289    
290            /**
291            * Returns the password tracker with the primary key or throws a {@link NoSuchPasswordTrackerException} if it could not be found.
292            *
293            * @param passwordTrackerId the primary key of the password tracker
294            * @return the password tracker
295            * @throws NoSuchPasswordTrackerException if a password tracker with the primary key could not be found
296            */
297            public static PasswordTracker findByPrimaryKey(long passwordTrackerId)
298                    throws com.liferay.portal.NoSuchPasswordTrackerException {
299                    return getPersistence().findByPrimaryKey(passwordTrackerId);
300            }
301    
302            /**
303            * Returns the password tracker with the primary key or returns <code>null</code> if it could not be found.
304            *
305            * @param passwordTrackerId the primary key of the password tracker
306            * @return the password tracker, or <code>null</code> if a password tracker with the primary key could not be found
307            */
308            public static PasswordTracker fetchByPrimaryKey(long passwordTrackerId) {
309                    return getPersistence().fetchByPrimaryKey(passwordTrackerId);
310            }
311    
312            public static java.util.Map<java.io.Serializable, PasswordTracker> fetchByPrimaryKeys(
313                    java.util.Set<java.io.Serializable> primaryKeys) {
314                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
315            }
316    
317            /**
318            * Returns all the password trackers.
319            *
320            * @return the password trackers
321            */
322            public static List<PasswordTracker> findAll() {
323                    return getPersistence().findAll();
324            }
325    
326            /**
327            * Returns a range of all the password trackers.
328            *
329            * <p>
330            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PasswordTrackerModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
331            * </p>
332            *
333            * @param start the lower bound of the range of password trackers
334            * @param end the upper bound of the range of password trackers (not inclusive)
335            * @return the range of password trackers
336            */
337            public static List<PasswordTracker> findAll(int start, int end) {
338                    return getPersistence().findAll(start, end);
339            }
340    
341            /**
342            * Returns an ordered range of all the password trackers.
343            *
344            * <p>
345            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PasswordTrackerModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
346            * </p>
347            *
348            * @param start the lower bound of the range of password trackers
349            * @param end the upper bound of the range of password trackers (not inclusive)
350            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
351            * @return the ordered range of password trackers
352            */
353            public static List<PasswordTracker> findAll(int start, int end,
354                    OrderByComparator<PasswordTracker> orderByComparator) {
355                    return getPersistence().findAll(start, end, orderByComparator);
356            }
357    
358            /**
359            * Removes all the password trackers from the database.
360            */
361            public static void removeAll() {
362                    getPersistence().removeAll();
363            }
364    
365            /**
366            * Returns the number of password trackers.
367            *
368            * @return the number of password trackers
369            */
370            public static int countAll() {
371                    return getPersistence().countAll();
372            }
373    
374            public static PasswordTrackerPersistence getPersistence() {
375                    if (_persistence == null) {
376                            _persistence = (PasswordTrackerPersistence)PortalBeanLocatorUtil.locate(PasswordTrackerPersistence.class.getName());
377    
378                            ReferenceRegistry.registerReference(PasswordTrackerUtil.class,
379                                    "_persistence");
380                    }
381    
382                    return _persistence;
383            }
384    
385            /**
386             * @deprecated As of 6.2.0
387             */
388            @Deprecated
389            public void setPersistence(PasswordTrackerPersistence persistence) {
390            }
391    
392            private static PasswordTrackerPersistence _persistence;
393    }