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