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