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.UserIdMapper;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the user ID mapper service. This utility wraps {@link com.liferay.portal.service.persistence.impl.UserIdMapperPersistenceImpl} 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 UserIdMapperPersistence
037     * @see com.liferay.portal.service.persistence.impl.UserIdMapperPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class UserIdMapperUtil {
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(UserIdMapper userIdMapper) {
059                    getPersistence().clearCache(userIdMapper);
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<UserIdMapper> 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<UserIdMapper> 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<UserIdMapper> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator<UserIdMapper> 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 UserIdMapper update(UserIdMapper userIdMapper) {
100                    return getPersistence().update(userIdMapper);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static UserIdMapper update(UserIdMapper userIdMapper,
107                    ServiceContext serviceContext) {
108                    return getPersistence().update(userIdMapper, serviceContext);
109            }
110    
111            /**
112            * Returns all the user ID mappers where userId = &#63;.
113            *
114            * @param userId the user ID
115            * @return the matching user ID mappers
116            */
117            public static List<UserIdMapper> findByUserId(long userId) {
118                    return getPersistence().findByUserId(userId);
119            }
120    
121            /**
122            * Returns a range of all the user ID mappers 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 UserIdMapperModelImpl}. 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 user ID mappers
130            * @param end the upper bound of the range of user ID mappers (not inclusive)
131            * @return the range of matching user ID mappers
132            */
133            public static List<UserIdMapper> 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 user ID mappers 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 UserIdMapperModelImpl}. 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 user ID mappers
147            * @param end the upper bound of the range of user ID mappers (not inclusive)
148            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
149            * @return the ordered range of matching user ID mappers
150            */
151            public static List<UserIdMapper> findByUserId(long userId, int start,
152                    int end, OrderByComparator<UserIdMapper> orderByComparator) {
153                    return getPersistence()
154                                       .findByUserId(userId, start, end, orderByComparator);
155            }
156    
157            /**
158            * Returns the first user ID mapper 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 user ID mapper
163            * @throws NoSuchUserIdMapperException if a matching user ID mapper could not be found
164            */
165            public static UserIdMapper findByUserId_First(long userId,
166                    OrderByComparator<UserIdMapper> orderByComparator)
167                    throws com.liferay.portal.NoSuchUserIdMapperException {
168                    return getPersistence().findByUserId_First(userId, orderByComparator);
169            }
170    
171            /**
172            * Returns the first user ID mapper 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 user ID mapper, or <code>null</code> if a matching user ID mapper could not be found
177            */
178            public static UserIdMapper fetchByUserId_First(long userId,
179                    OrderByComparator<UserIdMapper> orderByComparator) {
180                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
181            }
182    
183            /**
184            * Returns the last user ID mapper 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 user ID mapper
189            * @throws NoSuchUserIdMapperException if a matching user ID mapper could not be found
190            */
191            public static UserIdMapper findByUserId_Last(long userId,
192                    OrderByComparator<UserIdMapper> orderByComparator)
193                    throws com.liferay.portal.NoSuchUserIdMapperException {
194                    return getPersistence().findByUserId_Last(userId, orderByComparator);
195            }
196    
197            /**
198            * Returns the last user ID mapper 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 user ID mapper, or <code>null</code> if a matching user ID mapper could not be found
203            */
204            public static UserIdMapper fetchByUserId_Last(long userId,
205                    OrderByComparator<UserIdMapper> orderByComparator) {
206                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
207            }
208    
209            /**
210            * Returns the user ID mappers before and after the current user ID mapper in the ordered set where userId = &#63;.
211            *
212            * @param userIdMapperId the primary key of the current user ID mapper
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 user ID mapper
216            * @throws NoSuchUserIdMapperException if a user ID mapper with the primary key could not be found
217            */
218            public static UserIdMapper[] findByUserId_PrevAndNext(long userIdMapperId,
219                    long userId, OrderByComparator<UserIdMapper> orderByComparator)
220                    throws com.liferay.portal.NoSuchUserIdMapperException {
221                    return getPersistence()
222                                       .findByUserId_PrevAndNext(userIdMapperId, userId,
223                            orderByComparator);
224            }
225    
226            /**
227            * Removes all the user ID mappers where userId = &#63; from the database.
228            *
229            * @param userId the user ID
230            */
231            public static void removeByUserId(long userId) {
232                    getPersistence().removeByUserId(userId);
233            }
234    
235            /**
236            * Returns the number of user ID mappers where userId = &#63;.
237            *
238            * @param userId the user ID
239            * @return the number of matching user ID mappers
240            */
241            public static int countByUserId(long userId) {
242                    return getPersistence().countByUserId(userId);
243            }
244    
245            /**
246            * Returns the user ID mapper where userId = &#63; and type = &#63; or throws a {@link NoSuchUserIdMapperException} if it could not be found.
247            *
248            * @param userId the user ID
249            * @param type the type
250            * @return the matching user ID mapper
251            * @throws NoSuchUserIdMapperException if a matching user ID mapper could not be found
252            */
253            public static UserIdMapper findByU_T(long userId, java.lang.String type)
254                    throws com.liferay.portal.NoSuchUserIdMapperException {
255                    return getPersistence().findByU_T(userId, type);
256            }
257    
258            /**
259            * Returns the user ID mapper where userId = &#63; and type = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
260            *
261            * @param userId the user ID
262            * @param type the type
263            * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found
264            */
265            public static UserIdMapper fetchByU_T(long userId, java.lang.String type) {
266                    return getPersistence().fetchByU_T(userId, type);
267            }
268    
269            /**
270            * Returns the user ID mapper where userId = &#63; and type = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
271            *
272            * @param userId the user ID
273            * @param type the type
274            * @param retrieveFromCache whether to use the finder cache
275            * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found
276            */
277            public static UserIdMapper fetchByU_T(long userId, java.lang.String type,
278                    boolean retrieveFromCache) {
279                    return getPersistence().fetchByU_T(userId, type, retrieveFromCache);
280            }
281    
282            /**
283            * Removes the user ID mapper where userId = &#63; and type = &#63; from the database.
284            *
285            * @param userId the user ID
286            * @param type the type
287            * @return the user ID mapper that was removed
288            */
289            public static UserIdMapper removeByU_T(long userId, java.lang.String type)
290                    throws com.liferay.portal.NoSuchUserIdMapperException {
291                    return getPersistence().removeByU_T(userId, type);
292            }
293    
294            /**
295            * Returns the number of user ID mappers where userId = &#63; and type = &#63;.
296            *
297            * @param userId the user ID
298            * @param type the type
299            * @return the number of matching user ID mappers
300            */
301            public static int countByU_T(long userId, java.lang.String type) {
302                    return getPersistence().countByU_T(userId, type);
303            }
304    
305            /**
306            * Returns the user ID mapper where type = &#63; and externalUserId = &#63; or throws a {@link NoSuchUserIdMapperException} if it could not be found.
307            *
308            * @param type the type
309            * @param externalUserId the external user ID
310            * @return the matching user ID mapper
311            * @throws NoSuchUserIdMapperException if a matching user ID mapper could not be found
312            */
313            public static UserIdMapper findByT_E(java.lang.String type,
314                    java.lang.String externalUserId)
315                    throws com.liferay.portal.NoSuchUserIdMapperException {
316                    return getPersistence().findByT_E(type, externalUserId);
317            }
318    
319            /**
320            * Returns the user ID mapper where type = &#63; and externalUserId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
321            *
322            * @param type the type
323            * @param externalUserId the external user ID
324            * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found
325            */
326            public static UserIdMapper fetchByT_E(java.lang.String type,
327                    java.lang.String externalUserId) {
328                    return getPersistence().fetchByT_E(type, externalUserId);
329            }
330    
331            /**
332            * Returns the user ID mapper where type = &#63; and externalUserId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
333            *
334            * @param type the type
335            * @param externalUserId the external user ID
336            * @param retrieveFromCache whether to use the finder cache
337            * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found
338            */
339            public static UserIdMapper fetchByT_E(java.lang.String type,
340                    java.lang.String externalUserId, boolean retrieveFromCache) {
341                    return getPersistence()
342                                       .fetchByT_E(type, externalUserId, retrieveFromCache);
343            }
344    
345            /**
346            * Removes the user ID mapper where type = &#63; and externalUserId = &#63; from the database.
347            *
348            * @param type the type
349            * @param externalUserId the external user ID
350            * @return the user ID mapper that was removed
351            */
352            public static UserIdMapper removeByT_E(java.lang.String type,
353                    java.lang.String externalUserId)
354                    throws com.liferay.portal.NoSuchUserIdMapperException {
355                    return getPersistence().removeByT_E(type, externalUserId);
356            }
357    
358            /**
359            * Returns the number of user ID mappers where type = &#63; and externalUserId = &#63;.
360            *
361            * @param type the type
362            * @param externalUserId the external user ID
363            * @return the number of matching user ID mappers
364            */
365            public static int countByT_E(java.lang.String type,
366                    java.lang.String externalUserId) {
367                    return getPersistence().countByT_E(type, externalUserId);
368            }
369    
370            /**
371            * Caches the user ID mapper in the entity cache if it is enabled.
372            *
373            * @param userIdMapper the user ID mapper
374            */
375            public static void cacheResult(UserIdMapper userIdMapper) {
376                    getPersistence().cacheResult(userIdMapper);
377            }
378    
379            /**
380            * Caches the user ID mappers in the entity cache if it is enabled.
381            *
382            * @param userIdMappers the user ID mappers
383            */
384            public static void cacheResult(List<UserIdMapper> userIdMappers) {
385                    getPersistence().cacheResult(userIdMappers);
386            }
387    
388            /**
389            * Creates a new user ID mapper with the primary key. Does not add the user ID mapper to the database.
390            *
391            * @param userIdMapperId the primary key for the new user ID mapper
392            * @return the new user ID mapper
393            */
394            public static UserIdMapper create(long userIdMapperId) {
395                    return getPersistence().create(userIdMapperId);
396            }
397    
398            /**
399            * Removes the user ID mapper with the primary key from the database. Also notifies the appropriate model listeners.
400            *
401            * @param userIdMapperId the primary key of the user ID mapper
402            * @return the user ID mapper that was removed
403            * @throws NoSuchUserIdMapperException if a user ID mapper with the primary key could not be found
404            */
405            public static UserIdMapper remove(long userIdMapperId)
406                    throws com.liferay.portal.NoSuchUserIdMapperException {
407                    return getPersistence().remove(userIdMapperId);
408            }
409    
410            public static UserIdMapper updateImpl(UserIdMapper userIdMapper) {
411                    return getPersistence().updateImpl(userIdMapper);
412            }
413    
414            /**
415            * Returns the user ID mapper with the primary key or throws a {@link NoSuchUserIdMapperException} if it could not be found.
416            *
417            * @param userIdMapperId the primary key of the user ID mapper
418            * @return the user ID mapper
419            * @throws NoSuchUserIdMapperException if a user ID mapper with the primary key could not be found
420            */
421            public static UserIdMapper findByPrimaryKey(long userIdMapperId)
422                    throws com.liferay.portal.NoSuchUserIdMapperException {
423                    return getPersistence().findByPrimaryKey(userIdMapperId);
424            }
425    
426            /**
427            * Returns the user ID mapper with the primary key or returns <code>null</code> if it could not be found.
428            *
429            * @param userIdMapperId the primary key of the user ID mapper
430            * @return the user ID mapper, or <code>null</code> if a user ID mapper with the primary key could not be found
431            */
432            public static UserIdMapper fetchByPrimaryKey(long userIdMapperId) {
433                    return getPersistence().fetchByPrimaryKey(userIdMapperId);
434            }
435    
436            public static java.util.Map<java.io.Serializable, UserIdMapper> fetchByPrimaryKeys(
437                    java.util.Set<java.io.Serializable> primaryKeys) {
438                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
439            }
440    
441            /**
442            * Returns all the user ID mappers.
443            *
444            * @return the user ID mappers
445            */
446            public static List<UserIdMapper> findAll() {
447                    return getPersistence().findAll();
448            }
449    
450            /**
451            * Returns a range of all the user ID mappers.
452            *
453            * <p>
454            * 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 UserIdMapperModelImpl}. 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.
455            * </p>
456            *
457            * @param start the lower bound of the range of user ID mappers
458            * @param end the upper bound of the range of user ID mappers (not inclusive)
459            * @return the range of user ID mappers
460            */
461            public static List<UserIdMapper> findAll(int start, int end) {
462                    return getPersistence().findAll(start, end);
463            }
464    
465            /**
466            * Returns an ordered range of all the user ID mappers.
467            *
468            * <p>
469            * 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 UserIdMapperModelImpl}. 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.
470            * </p>
471            *
472            * @param start the lower bound of the range of user ID mappers
473            * @param end the upper bound of the range of user ID mappers (not inclusive)
474            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
475            * @return the ordered range of user ID mappers
476            */
477            public static List<UserIdMapper> findAll(int start, int end,
478                    OrderByComparator<UserIdMapper> orderByComparator) {
479                    return getPersistence().findAll(start, end, orderByComparator);
480            }
481    
482            /**
483            * Removes all the user ID mappers from the database.
484            */
485            public static void removeAll() {
486                    getPersistence().removeAll();
487            }
488    
489            /**
490            * Returns the number of user ID mappers.
491            *
492            * @return the number of user ID mappers
493            */
494            public static int countAll() {
495                    return getPersistence().countAll();
496            }
497    
498            public static UserIdMapperPersistence getPersistence() {
499                    if (_persistence == null) {
500                            _persistence = (UserIdMapperPersistence)PortalBeanLocatorUtil.locate(UserIdMapperPersistence.class.getName());
501    
502                            ReferenceRegistry.registerReference(UserIdMapperUtil.class,
503                                    "_persistence");
504                    }
505    
506                    return _persistence;
507            }
508    
509            /**
510             * @deprecated As of 6.2.0
511             */
512            @Deprecated
513            public void setPersistence(UserIdMapperPersistence persistence) {
514            }
515    
516            private static UserIdMapperPersistence _persistence;
517    }