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