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.Subscription; 022 import com.liferay.portal.service.ServiceContext; 023 024 import java.util.List; 025 026 /** 027 * The persistence utility for the subscription service. This utility wraps {@link SubscriptionPersistenceImpl} 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 SubscriptionPersistence 039 * @see SubscriptionPersistenceImpl 040 * @generated 041 */ 042 public class SubscriptionUtil { 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(Subscription subscription) { 054 getPersistence().clearCache(subscription); 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<Subscription> 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<Subscription> 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<Subscription> 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 Subscription remove(Subscription subscription) 097 throws SystemException { 098 return getPersistence().remove(subscription); 099 } 100 101 /** 102 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 103 */ 104 public static Subscription update(Subscription subscription, boolean merge) 105 throws SystemException { 106 return getPersistence().update(subscription, merge); 107 } 108 109 /** 110 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 111 */ 112 public static Subscription update(Subscription subscription, boolean merge, 113 ServiceContext serviceContext) throws SystemException { 114 return getPersistence().update(subscription, merge, serviceContext); 115 } 116 117 /** 118 * Caches the subscription in the entity cache if it is enabled. 119 * 120 * @param subscription the subscription to cache 121 */ 122 public static void cacheResult( 123 com.liferay.portal.model.Subscription subscription) { 124 getPersistence().cacheResult(subscription); 125 } 126 127 /** 128 * Caches the subscriptions in the entity cache if it is enabled. 129 * 130 * @param subscriptions the subscriptions to cache 131 */ 132 public static void cacheResult( 133 java.util.List<com.liferay.portal.model.Subscription> subscriptions) { 134 getPersistence().cacheResult(subscriptions); 135 } 136 137 /** 138 * Creates a new subscription with the primary key. Does not add the subscription to the database. 139 * 140 * @param subscriptionId the primary key for the new subscription 141 * @return the new subscription 142 */ 143 public static com.liferay.portal.model.Subscription create( 144 long subscriptionId) { 145 return getPersistence().create(subscriptionId); 146 } 147 148 /** 149 * Removes the subscription with the primary key from the database. Also notifies the appropriate model listeners. 150 * 151 * @param subscriptionId the primary key of the subscription to remove 152 * @return the subscription that was removed 153 * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found 154 * @throws SystemException if a system exception occurred 155 */ 156 public static com.liferay.portal.model.Subscription remove( 157 long subscriptionId) 158 throws com.liferay.portal.NoSuchSubscriptionException, 159 com.liferay.portal.kernel.exception.SystemException { 160 return getPersistence().remove(subscriptionId); 161 } 162 163 public static com.liferay.portal.model.Subscription updateImpl( 164 com.liferay.portal.model.Subscription subscription, boolean merge) 165 throws com.liferay.portal.kernel.exception.SystemException { 166 return getPersistence().updateImpl(subscription, merge); 167 } 168 169 /** 170 * Finds the subscription with the primary key or throws a {@link com.liferay.portal.NoSuchSubscriptionException} if it could not be found. 171 * 172 * @param subscriptionId the primary key of the subscription to find 173 * @return the subscription 174 * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found 175 * @throws SystemException if a system exception occurred 176 */ 177 public static com.liferay.portal.model.Subscription findByPrimaryKey( 178 long subscriptionId) 179 throws com.liferay.portal.NoSuchSubscriptionException, 180 com.liferay.portal.kernel.exception.SystemException { 181 return getPersistence().findByPrimaryKey(subscriptionId); 182 } 183 184 /** 185 * Finds the subscription with the primary key or returns <code>null</code> if it could not be found. 186 * 187 * @param subscriptionId the primary key of the subscription to find 188 * @return the subscription, or <code>null</code> if a subscription with the primary key could not be found 189 * @throws SystemException if a system exception occurred 190 */ 191 public static com.liferay.portal.model.Subscription fetchByPrimaryKey( 192 long subscriptionId) 193 throws com.liferay.portal.kernel.exception.SystemException { 194 return getPersistence().fetchByPrimaryKey(subscriptionId); 195 } 196 197 /** 198 * Finds all the subscriptions where userId = ?. 199 * 200 * @param userId the user id to search with 201 * @return the matching subscriptions 202 * @throws SystemException if a system exception occurred 203 */ 204 public static java.util.List<com.liferay.portal.model.Subscription> 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 subscriptions 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 subscriptions to return 218 * @param end the upper bound of the range of subscriptions to return (not inclusive) 219 * @return the range of matching subscriptions 220 * @throws SystemException if a system exception occurred 221 */ 222 public static java.util.List<com.liferay.portal.model.Subscription> 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 subscriptions 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 subscriptions to return 237 * @param end the upper bound of the range of subscriptions to return (not inclusive) 238 * @param orderByComparator the comparator to order the results by 239 * @return the ordered range of matching subscriptions 240 * @throws SystemException if a system exception occurred 241 */ 242 public static java.util.List<com.liferay.portal.model.Subscription> 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 subscription 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 subscription 260 * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found 261 * @throws SystemException if a system exception occurred 262 */ 263 public static com.liferay.portal.model.Subscription findByUserId_First( 264 long userId, 265 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 266 throws com.liferay.portal.NoSuchSubscriptionException, 267 com.liferay.portal.kernel.exception.SystemException { 268 return getPersistence().findByUserId_First(userId, orderByComparator); 269 } 270 271 /** 272 * Finds the last subscription 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 subscription 281 * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found 282 * @throws SystemException if a system exception occurred 283 */ 284 public static com.liferay.portal.model.Subscription findByUserId_Last( 285 long userId, 286 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 287 throws com.liferay.portal.NoSuchSubscriptionException, 288 com.liferay.portal.kernel.exception.SystemException { 289 return getPersistence().findByUserId_Last(userId, orderByComparator); 290 } 291 292 /** 293 * Finds the subscriptions before and after the current subscription 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 subscriptionId the primary key of the current subscription 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 subscription 303 * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found 304 * @throws SystemException if a system exception occurred 305 */ 306 public static com.liferay.portal.model.Subscription[] findByUserId_PrevAndNext( 307 long subscriptionId, long userId, 308 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 309 throws com.liferay.portal.NoSuchSubscriptionException, 310 com.liferay.portal.kernel.exception.SystemException { 311 return getPersistence() 312 .findByUserId_PrevAndNext(subscriptionId, userId, 313 orderByComparator); 314 } 315 316 /** 317 * Finds all the subscriptions where userId = ? and classNameId = ?. 318 * 319 * @param userId the user id to search with 320 * @param classNameId the class name id to search with 321 * @return the matching subscriptions 322 * @throws SystemException if a system exception occurred 323 */ 324 public static java.util.List<com.liferay.portal.model.Subscription> findByU_C( 325 long userId, long classNameId) 326 throws com.liferay.portal.kernel.exception.SystemException { 327 return getPersistence().findByU_C(userId, classNameId); 328 } 329 330 /** 331 * Finds a range of all the subscriptions where userId = ? and classNameId = ?. 332 * 333 * <p> 334 * 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. 335 * </p> 336 * 337 * @param userId the user id to search with 338 * @param classNameId the class name id to search with 339 * @param start the lower bound of the range of subscriptions to return 340 * @param end the upper bound of the range of subscriptions to return (not inclusive) 341 * @return the range of matching subscriptions 342 * @throws SystemException if a system exception occurred 343 */ 344 public static java.util.List<com.liferay.portal.model.Subscription> findByU_C( 345 long userId, long classNameId, int start, int end) 346 throws com.liferay.portal.kernel.exception.SystemException { 347 return getPersistence().findByU_C(userId, classNameId, start, end); 348 } 349 350 /** 351 * Finds an ordered range of all the subscriptions where userId = ? and classNameId = ?. 352 * 353 * <p> 354 * 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. 355 * </p> 356 * 357 * @param userId the user id to search with 358 * @param classNameId the class name id to search with 359 * @param start the lower bound of the range of subscriptions to return 360 * @param end the upper bound of the range of subscriptions to return (not inclusive) 361 * @param orderByComparator the comparator to order the results by 362 * @return the ordered range of matching subscriptions 363 * @throws SystemException if a system exception occurred 364 */ 365 public static java.util.List<com.liferay.portal.model.Subscription> findByU_C( 366 long userId, long classNameId, int start, int end, 367 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 368 throws com.liferay.portal.kernel.exception.SystemException { 369 return getPersistence() 370 .findByU_C(userId, classNameId, start, end, orderByComparator); 371 } 372 373 /** 374 * Finds the first subscription in the ordered set where userId = ? and classNameId = ?. 375 * 376 * <p> 377 * 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. 378 * </p> 379 * 380 * @param userId the user id to search with 381 * @param classNameId the class name id to search with 382 * @param orderByComparator the comparator to order the set by 383 * @return the first matching subscription 384 * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found 385 * @throws SystemException if a system exception occurred 386 */ 387 public static com.liferay.portal.model.Subscription findByU_C_First( 388 long userId, long classNameId, 389 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 390 throws com.liferay.portal.NoSuchSubscriptionException, 391 com.liferay.portal.kernel.exception.SystemException { 392 return getPersistence() 393 .findByU_C_First(userId, classNameId, orderByComparator); 394 } 395 396 /** 397 * Finds the last subscription in the ordered set where userId = ? and classNameId = ?. 398 * 399 * <p> 400 * 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. 401 * </p> 402 * 403 * @param userId the user id to search with 404 * @param classNameId the class name id to search with 405 * @param orderByComparator the comparator to order the set by 406 * @return the last matching subscription 407 * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found 408 * @throws SystemException if a system exception occurred 409 */ 410 public static com.liferay.portal.model.Subscription findByU_C_Last( 411 long userId, long classNameId, 412 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 413 throws com.liferay.portal.NoSuchSubscriptionException, 414 com.liferay.portal.kernel.exception.SystemException { 415 return getPersistence() 416 .findByU_C_Last(userId, classNameId, orderByComparator); 417 } 418 419 /** 420 * Finds the subscriptions before and after the current subscription in the ordered set where userId = ? and classNameId = ?. 421 * 422 * <p> 423 * 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. 424 * </p> 425 * 426 * @param subscriptionId the primary key of the current subscription 427 * @param userId the user id to search with 428 * @param classNameId the class name id to search with 429 * @param orderByComparator the comparator to order the set by 430 * @return the previous, current, and next subscription 431 * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found 432 * @throws SystemException if a system exception occurred 433 */ 434 public static com.liferay.portal.model.Subscription[] findByU_C_PrevAndNext( 435 long subscriptionId, long userId, long classNameId, 436 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 437 throws com.liferay.portal.NoSuchSubscriptionException, 438 com.liferay.portal.kernel.exception.SystemException { 439 return getPersistence() 440 .findByU_C_PrevAndNext(subscriptionId, userId, classNameId, 441 orderByComparator); 442 } 443 444 /** 445 * Finds all the subscriptions where companyId = ? and classNameId = ? and classPK = ?. 446 * 447 * @param companyId the company id to search with 448 * @param classNameId the class name id to search with 449 * @param classPK the class p k to search with 450 * @return the matching subscriptions 451 * @throws SystemException if a system exception occurred 452 */ 453 public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C( 454 long companyId, long classNameId, long classPK) 455 throws com.liferay.portal.kernel.exception.SystemException { 456 return getPersistence().findByC_C_C(companyId, classNameId, classPK); 457 } 458 459 /** 460 * Finds a range of all the subscriptions where companyId = ? and classNameId = ? and classPK = ?. 461 * 462 * <p> 463 * 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. 464 * </p> 465 * 466 * @param companyId the company id to search with 467 * @param classNameId the class name id to search with 468 * @param classPK the class p k to search with 469 * @param start the lower bound of the range of subscriptions to return 470 * @param end the upper bound of the range of subscriptions to return (not inclusive) 471 * @return the range of matching subscriptions 472 * @throws SystemException if a system exception occurred 473 */ 474 public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C( 475 long companyId, long classNameId, long classPK, int start, int end) 476 throws com.liferay.portal.kernel.exception.SystemException { 477 return getPersistence() 478 .findByC_C_C(companyId, classNameId, classPK, start, end); 479 } 480 481 /** 482 * Finds an ordered range of all the subscriptions where companyId = ? and classNameId = ? and classPK = ?. 483 * 484 * <p> 485 * 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. 486 * </p> 487 * 488 * @param companyId the company id to search with 489 * @param classNameId the class name id to search with 490 * @param classPK the class p k to search with 491 * @param start the lower bound of the range of subscriptions to return 492 * @param end the upper bound of the range of subscriptions to return (not inclusive) 493 * @param orderByComparator the comparator to order the results by 494 * @return the ordered range of matching subscriptions 495 * @throws SystemException if a system exception occurred 496 */ 497 public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C( 498 long companyId, long classNameId, long classPK, int start, int end, 499 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 500 throws com.liferay.portal.kernel.exception.SystemException { 501 return getPersistence() 502 .findByC_C_C(companyId, classNameId, classPK, start, end, 503 orderByComparator); 504 } 505 506 /** 507 * Finds the first subscription in the ordered set where companyId = ? and classNameId = ? and classPK = ?. 508 * 509 * <p> 510 * 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. 511 * </p> 512 * 513 * @param companyId the company id to search with 514 * @param classNameId the class name id to search with 515 * @param classPK the class p k to search with 516 * @param orderByComparator the comparator to order the set by 517 * @return the first matching subscription 518 * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found 519 * @throws SystemException if a system exception occurred 520 */ 521 public static com.liferay.portal.model.Subscription findByC_C_C_First( 522 long companyId, long classNameId, long classPK, 523 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 524 throws com.liferay.portal.NoSuchSubscriptionException, 525 com.liferay.portal.kernel.exception.SystemException { 526 return getPersistence() 527 .findByC_C_C_First(companyId, classNameId, classPK, 528 orderByComparator); 529 } 530 531 /** 532 * Finds the last subscription in the ordered set where companyId = ? and classNameId = ? and classPK = ?. 533 * 534 * <p> 535 * 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. 536 * </p> 537 * 538 * @param companyId the company id to search with 539 * @param classNameId the class name id to search with 540 * @param classPK the class p k to search with 541 * @param orderByComparator the comparator to order the set by 542 * @return the last matching subscription 543 * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found 544 * @throws SystemException if a system exception occurred 545 */ 546 public static com.liferay.portal.model.Subscription findByC_C_C_Last( 547 long companyId, long classNameId, long classPK, 548 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 549 throws com.liferay.portal.NoSuchSubscriptionException, 550 com.liferay.portal.kernel.exception.SystemException { 551 return getPersistence() 552 .findByC_C_C_Last(companyId, classNameId, classPK, 553 orderByComparator); 554 } 555 556 /** 557 * Finds the subscriptions before and after the current subscription in the ordered set where companyId = ? and classNameId = ? and classPK = ?. 558 * 559 * <p> 560 * 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. 561 * </p> 562 * 563 * @param subscriptionId the primary key of the current subscription 564 * @param companyId the company id to search with 565 * @param classNameId the class name id to search with 566 * @param classPK the class p k to search with 567 * @param orderByComparator the comparator to order the set by 568 * @return the previous, current, and next subscription 569 * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found 570 * @throws SystemException if a system exception occurred 571 */ 572 public static com.liferay.portal.model.Subscription[] findByC_C_C_PrevAndNext( 573 long subscriptionId, long companyId, long classNameId, long classPK, 574 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 575 throws com.liferay.portal.NoSuchSubscriptionException, 576 com.liferay.portal.kernel.exception.SystemException { 577 return getPersistence() 578 .findByC_C_C_PrevAndNext(subscriptionId, companyId, 579 classNameId, classPK, orderByComparator); 580 } 581 582 /** 583 * Finds the subscription where companyId = ? and userId = ? and classNameId = ? and classPK = ? or throws a {@link com.liferay.portal.NoSuchSubscriptionException} if it could not be found. 584 * 585 * @param companyId the company id to search with 586 * @param userId the user id to search with 587 * @param classNameId the class name id to search with 588 * @param classPK the class p k to search with 589 * @return the matching subscription 590 * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found 591 * @throws SystemException if a system exception occurred 592 */ 593 public static com.liferay.portal.model.Subscription findByC_U_C_C( 594 long companyId, long userId, long classNameId, long classPK) 595 throws com.liferay.portal.NoSuchSubscriptionException, 596 com.liferay.portal.kernel.exception.SystemException { 597 return getPersistence() 598 .findByC_U_C_C(companyId, userId, classNameId, classPK); 599 } 600 601 /** 602 * Finds the subscription where companyId = ? and userId = ? and classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 603 * 604 * @param companyId the company id to search with 605 * @param userId the user id to search with 606 * @param classNameId the class name id to search with 607 * @param classPK the class p k to search with 608 * @return the matching subscription, or <code>null</code> if a matching subscription could not be found 609 * @throws SystemException if a system exception occurred 610 */ 611 public static com.liferay.portal.model.Subscription fetchByC_U_C_C( 612 long companyId, long userId, long classNameId, long classPK) 613 throws com.liferay.portal.kernel.exception.SystemException { 614 return getPersistence() 615 .fetchByC_U_C_C(companyId, userId, classNameId, classPK); 616 } 617 618 /** 619 * Finds the subscription where companyId = ? and userId = ? and classNameId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 620 * 621 * @param companyId the company id to search with 622 * @param userId the user id to search with 623 * @param classNameId the class name id to search with 624 * @param classPK the class p k to search with 625 * @return the matching subscription, or <code>null</code> if a matching subscription could not be found 626 * @throws SystemException if a system exception occurred 627 */ 628 public static com.liferay.portal.model.Subscription fetchByC_U_C_C( 629 long companyId, long userId, long classNameId, long classPK, 630 boolean retrieveFromCache) 631 throws com.liferay.portal.kernel.exception.SystemException { 632 return getPersistence() 633 .fetchByC_U_C_C(companyId, userId, classNameId, classPK, 634 retrieveFromCache); 635 } 636 637 /** 638 * Finds all the subscriptions. 639 * 640 * @return the subscriptions 641 * @throws SystemException if a system exception occurred 642 */ 643 public static java.util.List<com.liferay.portal.model.Subscription> findAll() 644 throws com.liferay.portal.kernel.exception.SystemException { 645 return getPersistence().findAll(); 646 } 647 648 /** 649 * Finds a range of all the subscriptions. 650 * 651 * <p> 652 * 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. 653 * </p> 654 * 655 * @param start the lower bound of the range of subscriptions to return 656 * @param end the upper bound of the range of subscriptions to return (not inclusive) 657 * @return the range of subscriptions 658 * @throws SystemException if a system exception occurred 659 */ 660 public static java.util.List<com.liferay.portal.model.Subscription> findAll( 661 int start, int end) 662 throws com.liferay.portal.kernel.exception.SystemException { 663 return getPersistence().findAll(start, end); 664 } 665 666 /** 667 * Finds an ordered range of all the subscriptions. 668 * 669 * <p> 670 * 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. 671 * </p> 672 * 673 * @param start the lower bound of the range of subscriptions to return 674 * @param end the upper bound of the range of subscriptions to return (not inclusive) 675 * @param orderByComparator the comparator to order the results by 676 * @return the ordered range of subscriptions 677 * @throws SystemException if a system exception occurred 678 */ 679 public static java.util.List<com.liferay.portal.model.Subscription> findAll( 680 int start, int end, 681 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 682 throws com.liferay.portal.kernel.exception.SystemException { 683 return getPersistence().findAll(start, end, orderByComparator); 684 } 685 686 /** 687 * Removes all the subscriptions where userId = ? from the database. 688 * 689 * @param userId the user id to search with 690 * @throws SystemException if a system exception occurred 691 */ 692 public static void removeByUserId(long userId) 693 throws com.liferay.portal.kernel.exception.SystemException { 694 getPersistence().removeByUserId(userId); 695 } 696 697 /** 698 * Removes all the subscriptions where userId = ? and classNameId = ? from the database. 699 * 700 * @param userId the user id to search with 701 * @param classNameId the class name id to search with 702 * @throws SystemException if a system exception occurred 703 */ 704 public static void removeByU_C(long userId, long classNameId) 705 throws com.liferay.portal.kernel.exception.SystemException { 706 getPersistence().removeByU_C(userId, classNameId); 707 } 708 709 /** 710 * Removes all the subscriptions where companyId = ? and classNameId = ? and classPK = ? from the database. 711 * 712 * @param companyId the company id to search with 713 * @param classNameId the class name id to search with 714 * @param classPK the class p k to search with 715 * @throws SystemException if a system exception occurred 716 */ 717 public static void removeByC_C_C(long companyId, long classNameId, 718 long classPK) 719 throws com.liferay.portal.kernel.exception.SystemException { 720 getPersistence().removeByC_C_C(companyId, classNameId, classPK); 721 } 722 723 /** 724 * Removes the subscription where companyId = ? and userId = ? and classNameId = ? and classPK = ? from the database. 725 * 726 * @param companyId the company id to search with 727 * @param userId the user id to search with 728 * @param classNameId the class name id to search with 729 * @param classPK the class p k to search with 730 * @throws SystemException if a system exception occurred 731 */ 732 public static void removeByC_U_C_C(long companyId, long userId, 733 long classNameId, long classPK) 734 throws com.liferay.portal.NoSuchSubscriptionException, 735 com.liferay.portal.kernel.exception.SystemException { 736 getPersistence().removeByC_U_C_C(companyId, userId, classNameId, classPK); 737 } 738 739 /** 740 * Removes all the subscriptions from the database. 741 * 742 * @throws SystemException if a system exception occurred 743 */ 744 public static void removeAll() 745 throws com.liferay.portal.kernel.exception.SystemException { 746 getPersistence().removeAll(); 747 } 748 749 /** 750 * Counts all the subscriptions where userId = ?. 751 * 752 * @param userId the user id to search with 753 * @return the number of matching subscriptions 754 * @throws SystemException if a system exception occurred 755 */ 756 public static int countByUserId(long userId) 757 throws com.liferay.portal.kernel.exception.SystemException { 758 return getPersistence().countByUserId(userId); 759 } 760 761 /** 762 * Counts all the subscriptions where userId = ? and classNameId = ?. 763 * 764 * @param userId the user id to search with 765 * @param classNameId the class name id to search with 766 * @return the number of matching subscriptions 767 * @throws SystemException if a system exception occurred 768 */ 769 public static int countByU_C(long userId, long classNameId) 770 throws com.liferay.portal.kernel.exception.SystemException { 771 return getPersistence().countByU_C(userId, classNameId); 772 } 773 774 /** 775 * Counts all the subscriptions where companyId = ? and classNameId = ? and classPK = ?. 776 * 777 * @param companyId the company id to search with 778 * @param classNameId the class name id to search with 779 * @param classPK the class p k to search with 780 * @return the number of matching subscriptions 781 * @throws SystemException if a system exception occurred 782 */ 783 public static int countByC_C_C(long companyId, long classNameId, 784 long classPK) 785 throws com.liferay.portal.kernel.exception.SystemException { 786 return getPersistence().countByC_C_C(companyId, classNameId, classPK); 787 } 788 789 /** 790 * Counts all the subscriptions where companyId = ? and userId = ? and classNameId = ? and classPK = ?. 791 * 792 * @param companyId the company id to search with 793 * @param userId the user id to search with 794 * @param classNameId the class name id to search with 795 * @param classPK the class p k to search with 796 * @return the number of matching subscriptions 797 * @throws SystemException if a system exception occurred 798 */ 799 public static int countByC_U_C_C(long companyId, long userId, 800 long classNameId, long classPK) 801 throws com.liferay.portal.kernel.exception.SystemException { 802 return getPersistence() 803 .countByC_U_C_C(companyId, userId, classNameId, classPK); 804 } 805 806 /** 807 * Counts all the subscriptions. 808 * 809 * @return the number of subscriptions 810 * @throws SystemException if a system exception occurred 811 */ 812 public static int countAll() 813 throws com.liferay.portal.kernel.exception.SystemException { 814 return getPersistence().countAll(); 815 } 816 817 public static SubscriptionPersistence getPersistence() { 818 if (_persistence == null) { 819 _persistence = (SubscriptionPersistence)PortalBeanLocatorUtil.locate(SubscriptionPersistence.class.getName()); 820 } 821 822 return _persistence; 823 } 824 825 public void setPersistence(SubscriptionPersistence persistence) { 826 _persistence = persistence; 827 } 828 829 private static SubscriptionPersistence _persistence; 830 }