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