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 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 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 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 * Returns 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 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 * Returns 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 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 * Returns all the user ID mappers where userId = ?. 202 * 203 * @param userId the user ID 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 * Returns 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 220 * @param start the lower bound of the range of user ID mappers 221 * @param end the upper bound of the range of user ID mappers (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 * Returns 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 239 * @param start the lower bound of the range of user ID mappers 240 * @param end the upper bound of the range of user ID mappers (not inclusive) 241 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 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 * Returns 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 261 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 282 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 304 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 323 * @param type the type 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 * Returns 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 339 * @param type the type 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 * 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. 351 * 352 * @param userId the user ID 353 * @param type the type 354 * @param retrieveFromCache whether to use the finder cache 355 * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found 356 * @throws SystemException if a system exception occurred 357 */ 358 public static com.liferay.portal.model.UserIdMapper fetchByU_T( 359 long userId, java.lang.String type, boolean retrieveFromCache) 360 throws com.liferay.portal.kernel.exception.SystemException { 361 return getPersistence().fetchByU_T(userId, type, retrieveFromCache); 362 } 363 364 /** 365 * Returns the user ID mapper where type = ? and externalUserId = ? or throws a {@link com.liferay.portal.NoSuchUserIdMapperException} if it could not be found. 366 * 367 * @param type the type 368 * @param externalUserId the external user ID 369 * @return the matching user ID mapper 370 * @throws com.liferay.portal.NoSuchUserIdMapperException if a matching user ID mapper could not be found 371 * @throws SystemException if a system exception occurred 372 */ 373 public static com.liferay.portal.model.UserIdMapper findByT_E( 374 java.lang.String type, java.lang.String externalUserId) 375 throws com.liferay.portal.NoSuchUserIdMapperException, 376 com.liferay.portal.kernel.exception.SystemException { 377 return getPersistence().findByT_E(type, externalUserId); 378 } 379 380 /** 381 * Returns the user ID mapper where type = ? and externalUserId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 382 * 383 * @param type the type 384 * @param externalUserId the external user ID 385 * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found 386 * @throws SystemException if a system exception occurred 387 */ 388 public static com.liferay.portal.model.UserIdMapper fetchByT_E( 389 java.lang.String type, java.lang.String externalUserId) 390 throws com.liferay.portal.kernel.exception.SystemException { 391 return getPersistence().fetchByT_E(type, externalUserId); 392 } 393 394 /** 395 * 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. 396 * 397 * @param type the type 398 * @param externalUserId the external user ID 399 * @param retrieveFromCache whether to use the finder cache 400 * @return the matching user ID mapper, or <code>null</code> if a matching user ID mapper could not be found 401 * @throws SystemException if a system exception occurred 402 */ 403 public static com.liferay.portal.model.UserIdMapper fetchByT_E( 404 java.lang.String type, java.lang.String externalUserId, 405 boolean retrieveFromCache) 406 throws com.liferay.portal.kernel.exception.SystemException { 407 return getPersistence() 408 .fetchByT_E(type, externalUserId, retrieveFromCache); 409 } 410 411 /** 412 * Returns all the user ID mappers. 413 * 414 * @return the user ID mappers 415 * @throws SystemException if a system exception occurred 416 */ 417 public static java.util.List<com.liferay.portal.model.UserIdMapper> findAll() 418 throws com.liferay.portal.kernel.exception.SystemException { 419 return getPersistence().findAll(); 420 } 421 422 /** 423 * Returns a range of all the user ID mappers. 424 * 425 * <p> 426 * 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. 427 * </p> 428 * 429 * @param start the lower bound of the range of user ID mappers 430 * @param end the upper bound of the range of user ID mappers (not inclusive) 431 * @return the range of user ID mappers 432 * @throws SystemException if a system exception occurred 433 */ 434 public static java.util.List<com.liferay.portal.model.UserIdMapper> findAll( 435 int start, int end) 436 throws com.liferay.portal.kernel.exception.SystemException { 437 return getPersistence().findAll(start, end); 438 } 439 440 /** 441 * Returns an ordered range of all the user ID mappers. 442 * 443 * <p> 444 * 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. 445 * </p> 446 * 447 * @param start the lower bound of the range of user ID mappers 448 * @param end the upper bound of the range of user ID mappers (not inclusive) 449 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 450 * @return the ordered range of user ID mappers 451 * @throws SystemException if a system exception occurred 452 */ 453 public static java.util.List<com.liferay.portal.model.UserIdMapper> findAll( 454 int start, int end, 455 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 456 throws com.liferay.portal.kernel.exception.SystemException { 457 return getPersistence().findAll(start, end, orderByComparator); 458 } 459 460 /** 461 * Removes all the user ID mappers where userId = ? from the database. 462 * 463 * @param userId the user ID 464 * @throws SystemException if a system exception occurred 465 */ 466 public static void removeByUserId(long userId) 467 throws com.liferay.portal.kernel.exception.SystemException { 468 getPersistence().removeByUserId(userId); 469 } 470 471 /** 472 * Removes the user ID mapper where userId = ? and type = ? from the database. 473 * 474 * @param userId the user ID 475 * @param type the type 476 * @throws SystemException if a system exception occurred 477 */ 478 public static void removeByU_T(long userId, java.lang.String type) 479 throws com.liferay.portal.NoSuchUserIdMapperException, 480 com.liferay.portal.kernel.exception.SystemException { 481 getPersistence().removeByU_T(userId, type); 482 } 483 484 /** 485 * Removes the user ID mapper where type = ? and externalUserId = ? from the database. 486 * 487 * @param type the type 488 * @param externalUserId the external user ID 489 * @throws SystemException if a system exception occurred 490 */ 491 public static void removeByT_E(java.lang.String type, 492 java.lang.String externalUserId) 493 throws com.liferay.portal.NoSuchUserIdMapperException, 494 com.liferay.portal.kernel.exception.SystemException { 495 getPersistence().removeByT_E(type, externalUserId); 496 } 497 498 /** 499 * Removes all the user ID mappers from the database. 500 * 501 * @throws SystemException if a system exception occurred 502 */ 503 public static void removeAll() 504 throws com.liferay.portal.kernel.exception.SystemException { 505 getPersistence().removeAll(); 506 } 507 508 /** 509 * Returns the number of user ID mappers where userId = ?. 510 * 511 * @param userId the user ID 512 * @return the number of matching user ID mappers 513 * @throws SystemException if a system exception occurred 514 */ 515 public static int countByUserId(long userId) 516 throws com.liferay.portal.kernel.exception.SystemException { 517 return getPersistence().countByUserId(userId); 518 } 519 520 /** 521 * Returns the number of user ID mappers where userId = ? and type = ?. 522 * 523 * @param userId the user ID 524 * @param type the type 525 * @return the number of matching user ID mappers 526 * @throws SystemException if a system exception occurred 527 */ 528 public static int countByU_T(long userId, java.lang.String type) 529 throws com.liferay.portal.kernel.exception.SystemException { 530 return getPersistence().countByU_T(userId, type); 531 } 532 533 /** 534 * Returns the number of user ID mappers where type = ? and externalUserId = ?. 535 * 536 * @param type the type 537 * @param externalUserId the external user ID 538 * @return the number of matching user ID mappers 539 * @throws SystemException if a system exception occurred 540 */ 541 public static int countByT_E(java.lang.String type, 542 java.lang.String externalUserId) 543 throws com.liferay.portal.kernel.exception.SystemException { 544 return getPersistence().countByT_E(type, externalUserId); 545 } 546 547 /** 548 * Returns the number of user ID mappers. 549 * 550 * @return the number of user ID mappers 551 * @throws SystemException if a system exception occurred 552 */ 553 public static int countAll() 554 throws com.liferay.portal.kernel.exception.SystemException { 555 return getPersistence().countAll(); 556 } 557 558 public static UserIdMapperPersistence getPersistence() { 559 if (_persistence == null) { 560 _persistence = (UserIdMapperPersistence)PortalBeanLocatorUtil.locate(UserIdMapperPersistence.class.getName()); 561 562 ReferenceRegistry.registerReference(UserIdMapperUtil.class, 563 "_persistence"); 564 } 565 566 return _persistence; 567 } 568 569 public void setPersistence(UserIdMapperPersistence persistence) { 570 _persistence = persistence; 571 572 ReferenceRegistry.registerReference(UserIdMapperUtil.class, 573 "_persistence"); 574 } 575 576 private static UserIdMapperPersistence _persistence; 577 }