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