001 /** 002 * Copyright (c) 2000-2012 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.UserIdMapper; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * 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. 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 UserIdMapperPersistence 036 * @see UserIdMapperPersistenceImpl 037 * @generated 038 */ 039 public class UserIdMapperUtil { 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(UserIdMapper userIdMapper) { 057 getPersistence().clearCache(userIdMapper); 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<UserIdMapper> 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<UserIdMapper> 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<UserIdMapper> 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 UserIdMapper update(UserIdMapper userIdMapper, boolean merge) 100 throws SystemException { 101 return getPersistence().update(userIdMapper, merge); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 106 */ 107 public static UserIdMapper update(UserIdMapper userIdMapper, boolean merge, 108 ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(userIdMapper, merge, serviceContext); 110 } 111 112 /** 113 * Caches the user ID mapper in the entity cache if it is enabled. 114 * 115 * @param userIdMapper the user ID mapper 116 */ 117 public static void cacheResult( 118 com.liferay.portal.model.UserIdMapper userIdMapper) { 119 getPersistence().cacheResult(userIdMapper); 120 } 121 122 /** 123 * Caches the user ID mappers in the entity cache if it is enabled. 124 * 125 * @param userIdMappers the user ID mappers 126 */ 127 public static void cacheResult( 128 java.util.List<com.liferay.portal.model.UserIdMapper> userIdMappers) { 129 getPersistence().cacheResult(userIdMappers); 130 } 131 132 /** 133 * Creates a new user ID mapper with the primary key. Does not add the user ID mapper to the database. 134 * 135 * @param userIdMapperId the primary key for the new user ID mapper 136 * @return the new user ID mapper 137 */ 138 public static com.liferay.portal.model.UserIdMapper create( 139 long userIdMapperId) { 140 return getPersistence().create(userIdMapperId); 141 } 142 143 /** 144 * Removes the user ID mapper with the primary key from the database. Also notifies the appropriate model listeners. 145 * 146 * @param userIdMapperId the primary key of the user ID mapper 147 * @return the user ID mapper that was removed 148 * @throws com.liferay.portal.NoSuchUserIdMapperException if a user ID mapper with the primary key could not be found 149 * @throws SystemException if a system exception occurred 150 */ 151 public static com.liferay.portal.model.UserIdMapper remove( 152 long userIdMapperId) 153 throws com.liferay.portal.NoSuchUserIdMapperException, 154 com.liferay.portal.kernel.exception.SystemException { 155 return getPersistence().remove(userIdMapperId); 156 } 157 158 public static com.liferay.portal.model.UserIdMapper updateImpl( 159 com.liferay.portal.model.UserIdMapper userIdMapper, boolean merge) 160 throws com.liferay.portal.kernel.exception.SystemException { 161 return getPersistence().updateImpl(userIdMapper, merge); 162 } 163 164 /** 165 * Returns the user ID mapper with the primary key or throws a {@link com.liferay.portal.NoSuchUserIdMapperException} if it could not be found. 166 * 167 * @param userIdMapperId the primary key of the user ID mapper 168 * @return the user ID mapper 169 * @throws com.liferay.portal.NoSuchUserIdMapperException if a user ID mapper with the primary key could not be found 170 * @throws SystemException if a system exception occurred 171 */ 172 public static com.liferay.portal.model.UserIdMapper findByPrimaryKey( 173 long userIdMapperId) 174 throws com.liferay.portal.NoSuchUserIdMapperException, 175 com.liferay.portal.kernel.exception.SystemException { 176 return getPersistence().findByPrimaryKey(userIdMapperId); 177 } 178 179 /** 180 * Returns the user ID mapper with the primary key or returns <code>null</code> if it could not be found. 181 * 182 * @param userIdMapperId the primary key of the user ID mapper 183 * @return the user ID mapper, or <code>null</code> if a user ID mapper with the primary key could not be found 184 * @throws SystemException if a system exception occurred 185 */ 186 public static com.liferay.portal.model.UserIdMapper fetchByPrimaryKey( 187 long userIdMapperId) 188 throws com.liferay.portal.kernel.exception.SystemException { 189 return getPersistence().fetchByPrimaryKey(userIdMapperId); 190 } 191 192 /** 193 * Returns all the user ID mappers where userId = ?. 194 * 195 * @param userId the user ID 196 * @return the matching user ID mappers 197 * @throws SystemException if a system exception occurred 198 */ 199 public static java.util.List<com.liferay.portal.model.UserIdMapper> 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 user ID mappers where userId = ?. 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 user ID mappers 213 * @param end the upper bound of the range of user ID mappers (not inclusive) 214 * @return the range of matching user ID mappers 215 * @throws SystemException if a system exception occurred 216 */ 217 public static java.util.List<com.liferay.portal.model.UserIdMapper> 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 user ID mappers where userId = ?. 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 user ID mappers 232 * @param end the upper bound of the range of user ID mappers (not inclusive) 233 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 234 * @return the ordered range of matching user ID mappers 235 * @throws SystemException if a system exception occurred 236 */ 237 public static java.util.List<com.liferay.portal.model.UserIdMapper> 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 user ID mapper in the ordered set where userId = ?. 247 * 248 * <p> 249 * 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. 250 * </p> 251 * 252 * @param userId the user ID 253 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 254 * @return the first matching user ID mapper 255 * @throws com.liferay.portal.NoSuchUserIdMapperException if a matching user ID mapper could not be found 256 * @throws SystemException if a system exception occurred 257 */ 258 public static com.liferay.portal.model.UserIdMapper findByUserId_First( 259 long userId, 260 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 261 throws com.liferay.portal.NoSuchUserIdMapperException, 262 com.liferay.portal.kernel.exception.SystemException { 263 return getPersistence().findByUserId_First(userId, orderByComparator); 264 } 265 266 /** 267 * Returns the last user ID mapper in the ordered set where userId = ?. 268 * 269 * <p> 270 * 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. 271 * </p> 272 * 273 * @param userId the user ID 274 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 275 * @return the last matching user ID mapper 276 * @throws com.liferay.portal.NoSuchUserIdMapperException if a matching user ID mapper could not be found 277 * @throws SystemException if a system exception occurred 278 */ 279 public static com.liferay.portal.model.UserIdMapper findByUserId_Last( 280 long userId, 281 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 282 throws com.liferay.portal.NoSuchUserIdMapperException, 283 com.liferay.portal.kernel.exception.SystemException { 284 return getPersistence().findByUserId_Last(userId, orderByComparator); 285 } 286 287 /** 288 * Returns the user ID mappers before and after the current user ID mapper in the ordered set where userId = ?. 289 * 290 * <p> 291 * 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. 292 * </p> 293 * 294 * @param userIdMapperId the primary key of the current user ID mapper 295 * @param userId the user ID 296 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 297 * @return the previous, current, and next user ID mapper 298 * @throws com.liferay.portal.NoSuchUserIdMapperException if a user ID mapper with the primary key could not be found 299 * @throws SystemException if a system exception occurred 300 */ 301 public static com.liferay.portal.model.UserIdMapper[] findByUserId_PrevAndNext( 302 long userIdMapperId, long userId, 303 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 304 throws com.liferay.portal.NoSuchUserIdMapperException, 305 com.liferay.portal.kernel.exception.SystemException { 306 return getPersistence() 307 .findByUserId_PrevAndNext(userIdMapperId, userId, 308 orderByComparator); 309 } 310 311 /** 312 * Returns the user ID mapper where userId = ? and type = ? or throws a {@link com.liferay.portal.NoSuchUserIdMapperException} if it could not be found. 313 * 314 * @param userId the user ID 315 * @param type the type 316 * @return the matching user ID mapper 317 * @throws com.liferay.portal.NoSuchUserIdMapperException if a matching user ID mapper could not be found 318 * @throws SystemException if a system exception occurred 319 */ 320 public static com.liferay.portal.model.UserIdMapper findByU_T(long userId, 321 java.lang.String type) 322 throws com.liferay.portal.NoSuchUserIdMapperException, 323 com.liferay.portal.kernel.exception.SystemException { 324 return getPersistence().findByU_T(userId, type); 325 } 326 327 /** 328 * Returns the user ID mapper where userId = ? and type = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 329 * 330 * @param userId the user ID 331 * @param type the type 332 * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found 333 * @throws SystemException if a system exception occurred 334 */ 335 public static com.liferay.portal.model.UserIdMapper fetchByU_T( 336 long userId, java.lang.String type) 337 throws com.liferay.portal.kernel.exception.SystemException { 338 return getPersistence().fetchByU_T(userId, type); 339 } 340 341 /** 342 * 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. 343 * 344 * @param userId the user ID 345 * @param type the type 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 * @throws SystemException if a system exception occurred 349 */ 350 public static com.liferay.portal.model.UserIdMapper fetchByU_T( 351 long userId, java.lang.String type, boolean retrieveFromCache) 352 throws com.liferay.portal.kernel.exception.SystemException { 353 return getPersistence().fetchByU_T(userId, type, retrieveFromCache); 354 } 355 356 /** 357 * Returns the user ID mapper where type = ? and externalUserId = ? or throws a {@link com.liferay.portal.NoSuchUserIdMapperException} if it could not be found. 358 * 359 * @param type the type 360 * @param externalUserId the external user ID 361 * @return the matching user ID mapper 362 * @throws com.liferay.portal.NoSuchUserIdMapperException if a matching user ID mapper could not be found 363 * @throws SystemException if a system exception occurred 364 */ 365 public static com.liferay.portal.model.UserIdMapper findByT_E( 366 java.lang.String type, java.lang.String externalUserId) 367 throws com.liferay.portal.NoSuchUserIdMapperException, 368 com.liferay.portal.kernel.exception.SystemException { 369 return getPersistence().findByT_E(type, externalUserId); 370 } 371 372 /** 373 * Returns the user ID mapper where type = ? and externalUserId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 374 * 375 * @param type the type 376 * @param externalUserId the external user ID 377 * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found 378 * @throws SystemException if a system exception occurred 379 */ 380 public static com.liferay.portal.model.UserIdMapper fetchByT_E( 381 java.lang.String type, java.lang.String externalUserId) 382 throws com.liferay.portal.kernel.exception.SystemException { 383 return getPersistence().fetchByT_E(type, externalUserId); 384 } 385 386 /** 387 * 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. 388 * 389 * @param type the type 390 * @param externalUserId the external user ID 391 * @param retrieveFromCache whether to use the finder cache 392 * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found 393 * @throws SystemException if a system exception occurred 394 */ 395 public static com.liferay.portal.model.UserIdMapper fetchByT_E( 396 java.lang.String type, java.lang.String externalUserId, 397 boolean retrieveFromCache) 398 throws com.liferay.portal.kernel.exception.SystemException { 399 return getPersistence() 400 .fetchByT_E(type, externalUserId, retrieveFromCache); 401 } 402 403 /** 404 * Returns all the user ID mappers. 405 * 406 * @return the user ID mappers 407 * @throws SystemException if a system exception occurred 408 */ 409 public static java.util.List<com.liferay.portal.model.UserIdMapper> findAll() 410 throws com.liferay.portal.kernel.exception.SystemException { 411 return getPersistence().findAll(); 412 } 413 414 /** 415 * Returns a range of all the user ID mappers. 416 * 417 * <p> 418 * 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. 419 * </p> 420 * 421 * @param start the lower bound of the range of user ID mappers 422 * @param end the upper bound of the range of user ID mappers (not inclusive) 423 * @return the range of user ID mappers 424 * @throws SystemException if a system exception occurred 425 */ 426 public static java.util.List<com.liferay.portal.model.UserIdMapper> findAll( 427 int start, int end) 428 throws com.liferay.portal.kernel.exception.SystemException { 429 return getPersistence().findAll(start, end); 430 } 431 432 /** 433 * Returns an ordered range of all the user ID mappers. 434 * 435 * <p> 436 * 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. 437 * </p> 438 * 439 * @param start the lower bound of the range of user ID mappers 440 * @param end the upper bound of the range of user ID mappers (not inclusive) 441 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 442 * @return the ordered range of user ID mappers 443 * @throws SystemException if a system exception occurred 444 */ 445 public static java.util.List<com.liferay.portal.model.UserIdMapper> findAll( 446 int start, int end, 447 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 448 throws com.liferay.portal.kernel.exception.SystemException { 449 return getPersistence().findAll(start, end, orderByComparator); 450 } 451 452 /** 453 * Removes all the user ID mappers where userId = ? from the database. 454 * 455 * @param userId the user ID 456 * @throws SystemException if a system exception occurred 457 */ 458 public static void removeByUserId(long userId) 459 throws com.liferay.portal.kernel.exception.SystemException { 460 getPersistence().removeByUserId(userId); 461 } 462 463 /** 464 * Removes the user ID mapper where userId = ? and type = ? from the database. 465 * 466 * @param userId the user ID 467 * @param type the type 468 * @throws SystemException if a system exception occurred 469 */ 470 public static void removeByU_T(long userId, java.lang.String type) 471 throws com.liferay.portal.NoSuchUserIdMapperException, 472 com.liferay.portal.kernel.exception.SystemException { 473 getPersistence().removeByU_T(userId, type); 474 } 475 476 /** 477 * Removes the user ID mapper where type = ? and externalUserId = ? from the database. 478 * 479 * @param type the type 480 * @param externalUserId the external user ID 481 * @throws SystemException if a system exception occurred 482 */ 483 public static void removeByT_E(java.lang.String type, 484 java.lang.String externalUserId) 485 throws com.liferay.portal.NoSuchUserIdMapperException, 486 com.liferay.portal.kernel.exception.SystemException { 487 getPersistence().removeByT_E(type, externalUserId); 488 } 489 490 /** 491 * Removes all the user ID mappers from the database. 492 * 493 * @throws SystemException if a system exception occurred 494 */ 495 public static void removeAll() 496 throws com.liferay.portal.kernel.exception.SystemException { 497 getPersistence().removeAll(); 498 } 499 500 /** 501 * Returns the number of user ID mappers where userId = ?. 502 * 503 * @param userId the user ID 504 * @return the number of matching user ID mappers 505 * @throws SystemException if a system exception occurred 506 */ 507 public static int countByUserId(long userId) 508 throws com.liferay.portal.kernel.exception.SystemException { 509 return getPersistence().countByUserId(userId); 510 } 511 512 /** 513 * Returns the number of user ID mappers where userId = ? and type = ?. 514 * 515 * @param userId the user ID 516 * @param type the type 517 * @return the number of matching user ID mappers 518 * @throws SystemException if a system exception occurred 519 */ 520 public static int countByU_T(long userId, java.lang.String type) 521 throws com.liferay.portal.kernel.exception.SystemException { 522 return getPersistence().countByU_T(userId, type); 523 } 524 525 /** 526 * Returns the number of user ID mappers where type = ? and externalUserId = ?. 527 * 528 * @param type the type 529 * @param externalUserId the external user ID 530 * @return the number of matching user ID mappers 531 * @throws SystemException if a system exception occurred 532 */ 533 public static int countByT_E(java.lang.String type, 534 java.lang.String externalUserId) 535 throws com.liferay.portal.kernel.exception.SystemException { 536 return getPersistence().countByT_E(type, externalUserId); 537 } 538 539 /** 540 * Returns the number of user ID mappers. 541 * 542 * @return the number of user ID mappers 543 * @throws SystemException if a system exception occurred 544 */ 545 public static int countAll() 546 throws com.liferay.portal.kernel.exception.SystemException { 547 return getPersistence().countAll(); 548 } 549 550 public static UserIdMapperPersistence getPersistence() { 551 if (_persistence == null) { 552 _persistence = (UserIdMapperPersistence)PortalBeanLocatorUtil.locate(UserIdMapperPersistence.class.getName()); 553 554 ReferenceRegistry.registerReference(UserIdMapperUtil.class, 555 "_persistence"); 556 } 557 558 return _persistence; 559 } 560 561 public void setPersistence(UserIdMapperPersistence persistence) { 562 _persistence = persistence; 563 564 ReferenceRegistry.registerReference(UserIdMapperUtil.class, 565 "_persistence"); 566 } 567 568 private static UserIdMapperPersistence _persistence; 569 }