001 /** 002 * Copyright (c) 2000-2013 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.ResourceBlock; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the resource block service. This utility wraps {@link ResourceBlockPersistenceImpl} 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 ResourceBlockPersistence 036 * @see ResourceBlockPersistenceImpl 037 * @generated 038 */ 039 public class ResourceBlockUtil { 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(ResourceBlock resourceBlock) { 057 getPersistence().clearCache(resourceBlock); 058 } 059 060 /** 061 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 062 */ 063 public static 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<ResourceBlock> 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<ResourceBlock> 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<ResourceBlock> 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) 098 */ 099 public static ResourceBlock update(ResourceBlock resourceBlock) 100 throws SystemException { 101 return getPersistence().update(resourceBlock); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static ResourceBlock update(ResourceBlock resourceBlock, 108 ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(resourceBlock, serviceContext); 110 } 111 112 /** 113 * Returns all the resource blocks where companyId = ? and name = ?. 114 * 115 * @param companyId the company ID 116 * @param name the name 117 * @return the matching resource blocks 118 * @throws SystemException if a system exception occurred 119 */ 120 public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_N( 121 long companyId, java.lang.String name) 122 throws com.liferay.portal.kernel.exception.SystemException { 123 return getPersistence().findByC_N(companyId, name); 124 } 125 126 /** 127 * Returns a range of all the resource blocks where companyId = ? and name = ?. 128 * 129 * <p> 130 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 131 * </p> 132 * 133 * @param companyId the company ID 134 * @param name the name 135 * @param start the lower bound of the range of resource blocks 136 * @param end the upper bound of the range of resource blocks (not inclusive) 137 * @return the range of matching resource blocks 138 * @throws SystemException if a system exception occurred 139 */ 140 public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_N( 141 long companyId, java.lang.String name, int start, int end) 142 throws com.liferay.portal.kernel.exception.SystemException { 143 return getPersistence().findByC_N(companyId, name, start, end); 144 } 145 146 /** 147 * Returns an ordered range of all the resource blocks where companyId = ? and name = ?. 148 * 149 * <p> 150 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 151 * </p> 152 * 153 * @param companyId the company ID 154 * @param name the name 155 * @param start the lower bound of the range of resource blocks 156 * @param end the upper bound of the range of resource blocks (not inclusive) 157 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 158 * @return the ordered range of matching resource blocks 159 * @throws SystemException if a system exception occurred 160 */ 161 public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_N( 162 long companyId, java.lang.String name, int start, int end, 163 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 164 throws com.liferay.portal.kernel.exception.SystemException { 165 return getPersistence() 166 .findByC_N(companyId, name, start, end, orderByComparator); 167 } 168 169 /** 170 * Returns the first resource block in the ordered set where companyId = ? and name = ?. 171 * 172 * @param companyId the company ID 173 * @param name the name 174 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 175 * @return the first matching resource block 176 * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found 177 * @throws SystemException if a system exception occurred 178 */ 179 public static com.liferay.portal.model.ResourceBlock findByC_N_First( 180 long companyId, java.lang.String name, 181 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 182 throws com.liferay.portal.NoSuchResourceBlockException, 183 com.liferay.portal.kernel.exception.SystemException { 184 return getPersistence() 185 .findByC_N_First(companyId, name, orderByComparator); 186 } 187 188 /** 189 * Returns the first resource block in the ordered set where companyId = ? and name = ?. 190 * 191 * @param companyId the company ID 192 * @param name the name 193 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 194 * @return the first matching resource block, or <code>null</code> if a matching resource block could not be found 195 * @throws SystemException if a system exception occurred 196 */ 197 public static com.liferay.portal.model.ResourceBlock fetchByC_N_First( 198 long companyId, java.lang.String name, 199 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 200 throws com.liferay.portal.kernel.exception.SystemException { 201 return getPersistence() 202 .fetchByC_N_First(companyId, name, orderByComparator); 203 } 204 205 /** 206 * Returns the last resource block in the ordered set where companyId = ? and name = ?. 207 * 208 * @param companyId the company ID 209 * @param name the name 210 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 211 * @return the last matching resource block 212 * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found 213 * @throws SystemException if a system exception occurred 214 */ 215 public static com.liferay.portal.model.ResourceBlock findByC_N_Last( 216 long companyId, java.lang.String name, 217 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 218 throws com.liferay.portal.NoSuchResourceBlockException, 219 com.liferay.portal.kernel.exception.SystemException { 220 return getPersistence() 221 .findByC_N_Last(companyId, name, orderByComparator); 222 } 223 224 /** 225 * Returns the last resource block in the ordered set where companyId = ? and name = ?. 226 * 227 * @param companyId the company ID 228 * @param name the name 229 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 230 * @return the last matching resource block, or <code>null</code> if a matching resource block could not be found 231 * @throws SystemException if a system exception occurred 232 */ 233 public static com.liferay.portal.model.ResourceBlock fetchByC_N_Last( 234 long companyId, java.lang.String name, 235 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 236 throws com.liferay.portal.kernel.exception.SystemException { 237 return getPersistence() 238 .fetchByC_N_Last(companyId, name, orderByComparator); 239 } 240 241 /** 242 * Returns the resource blocks before and after the current resource block in the ordered set where companyId = ? and name = ?. 243 * 244 * @param resourceBlockId the primary key of the current resource block 245 * @param companyId the company ID 246 * @param name the name 247 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 248 * @return the previous, current, and next resource block 249 * @throws com.liferay.portal.NoSuchResourceBlockException if a resource block with the primary key could not be found 250 * @throws SystemException if a system exception occurred 251 */ 252 public static com.liferay.portal.model.ResourceBlock[] findByC_N_PrevAndNext( 253 long resourceBlockId, long companyId, java.lang.String name, 254 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 255 throws com.liferay.portal.NoSuchResourceBlockException, 256 com.liferay.portal.kernel.exception.SystemException { 257 return getPersistence() 258 .findByC_N_PrevAndNext(resourceBlockId, companyId, name, 259 orderByComparator); 260 } 261 262 /** 263 * Removes all the resource blocks where companyId = ? and name = ? from the database. 264 * 265 * @param companyId the company ID 266 * @param name the name 267 * @throws SystemException if a system exception occurred 268 */ 269 public static void removeByC_N(long companyId, java.lang.String name) 270 throws com.liferay.portal.kernel.exception.SystemException { 271 getPersistence().removeByC_N(companyId, name); 272 } 273 274 /** 275 * Returns the number of resource blocks where companyId = ? and name = ?. 276 * 277 * @param companyId the company ID 278 * @param name the name 279 * @return the number of matching resource blocks 280 * @throws SystemException if a system exception occurred 281 */ 282 public static int countByC_N(long companyId, java.lang.String name) 283 throws com.liferay.portal.kernel.exception.SystemException { 284 return getPersistence().countByC_N(companyId, name); 285 } 286 287 /** 288 * Returns all the resource blocks where companyId = ? and groupId = ? and name = ?. 289 * 290 * @param companyId the company ID 291 * @param groupId the group ID 292 * @param name the name 293 * @return the matching resource blocks 294 * @throws SystemException if a system exception occurred 295 */ 296 public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_G_N( 297 long companyId, long groupId, java.lang.String name) 298 throws com.liferay.portal.kernel.exception.SystemException { 299 return getPersistence().findByC_G_N(companyId, groupId, name); 300 } 301 302 /** 303 * Returns a range of all the resource blocks where companyId = ? and groupId = ? and name = ?. 304 * 305 * <p> 306 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 307 * </p> 308 * 309 * @param companyId the company ID 310 * @param groupId the group ID 311 * @param name the name 312 * @param start the lower bound of the range of resource blocks 313 * @param end the upper bound of the range of resource blocks (not inclusive) 314 * @return the range of matching resource blocks 315 * @throws SystemException if a system exception occurred 316 */ 317 public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_G_N( 318 long companyId, long groupId, java.lang.String name, int start, int end) 319 throws com.liferay.portal.kernel.exception.SystemException { 320 return getPersistence().findByC_G_N(companyId, groupId, name, start, end); 321 } 322 323 /** 324 * Returns an ordered range of all the resource blocks where companyId = ? and groupId = ? and name = ?. 325 * 326 * <p> 327 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 328 * </p> 329 * 330 * @param companyId the company ID 331 * @param groupId the group ID 332 * @param name the name 333 * @param start the lower bound of the range of resource blocks 334 * @param end the upper bound of the range of resource blocks (not inclusive) 335 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 336 * @return the ordered range of matching resource blocks 337 * @throws SystemException if a system exception occurred 338 */ 339 public static java.util.List<com.liferay.portal.model.ResourceBlock> findByC_G_N( 340 long companyId, long groupId, java.lang.String name, int start, 341 int end, 342 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 343 throws com.liferay.portal.kernel.exception.SystemException { 344 return getPersistence() 345 .findByC_G_N(companyId, groupId, name, start, end, 346 orderByComparator); 347 } 348 349 /** 350 * Returns the first resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 351 * 352 * @param companyId the company ID 353 * @param groupId the group ID 354 * @param name the name 355 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 356 * @return the first matching resource block 357 * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found 358 * @throws SystemException if a system exception occurred 359 */ 360 public static com.liferay.portal.model.ResourceBlock findByC_G_N_First( 361 long companyId, long groupId, java.lang.String name, 362 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 363 throws com.liferay.portal.NoSuchResourceBlockException, 364 com.liferay.portal.kernel.exception.SystemException { 365 return getPersistence() 366 .findByC_G_N_First(companyId, groupId, name, 367 orderByComparator); 368 } 369 370 /** 371 * Returns the first resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 372 * 373 * @param companyId the company ID 374 * @param groupId the group ID 375 * @param name the name 376 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 377 * @return the first matching resource block, or <code>null</code> if a matching resource block could not be found 378 * @throws SystemException if a system exception occurred 379 */ 380 public static com.liferay.portal.model.ResourceBlock fetchByC_G_N_First( 381 long companyId, long groupId, java.lang.String name, 382 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 383 throws com.liferay.portal.kernel.exception.SystemException { 384 return getPersistence() 385 .fetchByC_G_N_First(companyId, groupId, name, 386 orderByComparator); 387 } 388 389 /** 390 * Returns the last resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 391 * 392 * @param companyId the company ID 393 * @param groupId the group ID 394 * @param name the name 395 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 396 * @return the last matching resource block 397 * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found 398 * @throws SystemException if a system exception occurred 399 */ 400 public static com.liferay.portal.model.ResourceBlock findByC_G_N_Last( 401 long companyId, long groupId, java.lang.String name, 402 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 403 throws com.liferay.portal.NoSuchResourceBlockException, 404 com.liferay.portal.kernel.exception.SystemException { 405 return getPersistence() 406 .findByC_G_N_Last(companyId, groupId, name, orderByComparator); 407 } 408 409 /** 410 * Returns the last resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 411 * 412 * @param companyId the company ID 413 * @param groupId the group ID 414 * @param name the name 415 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 416 * @return the last matching resource block, or <code>null</code> if a matching resource block could not be found 417 * @throws SystemException if a system exception occurred 418 */ 419 public static com.liferay.portal.model.ResourceBlock fetchByC_G_N_Last( 420 long companyId, long groupId, java.lang.String name, 421 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 422 throws com.liferay.portal.kernel.exception.SystemException { 423 return getPersistence() 424 .fetchByC_G_N_Last(companyId, groupId, name, 425 orderByComparator); 426 } 427 428 /** 429 * Returns the resource blocks before and after the current resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 430 * 431 * @param resourceBlockId the primary key of the current resource block 432 * @param companyId the company ID 433 * @param groupId the group ID 434 * @param name the name 435 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 436 * @return the previous, current, and next resource block 437 * @throws com.liferay.portal.NoSuchResourceBlockException if a resource block with the primary key could not be found 438 * @throws SystemException if a system exception occurred 439 */ 440 public static com.liferay.portal.model.ResourceBlock[] findByC_G_N_PrevAndNext( 441 long resourceBlockId, long companyId, long groupId, 442 java.lang.String name, 443 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 444 throws com.liferay.portal.NoSuchResourceBlockException, 445 com.liferay.portal.kernel.exception.SystemException { 446 return getPersistence() 447 .findByC_G_N_PrevAndNext(resourceBlockId, companyId, 448 groupId, name, orderByComparator); 449 } 450 451 /** 452 * Removes all the resource blocks where companyId = ? and groupId = ? and name = ? from the database. 453 * 454 * @param companyId the company ID 455 * @param groupId the group ID 456 * @param name the name 457 * @throws SystemException if a system exception occurred 458 */ 459 public static void removeByC_G_N(long companyId, long groupId, 460 java.lang.String name) 461 throws com.liferay.portal.kernel.exception.SystemException { 462 getPersistence().removeByC_G_N(companyId, groupId, name); 463 } 464 465 /** 466 * Returns the number of resource blocks where companyId = ? and groupId = ? and name = ?. 467 * 468 * @param companyId the company ID 469 * @param groupId the group ID 470 * @param name the name 471 * @return the number of matching resource blocks 472 * @throws SystemException if a system exception occurred 473 */ 474 public static int countByC_G_N(long companyId, long groupId, 475 java.lang.String name) 476 throws com.liferay.portal.kernel.exception.SystemException { 477 return getPersistence().countByC_G_N(companyId, groupId, name); 478 } 479 480 /** 481 * Returns the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? or throws a {@link com.liferay.portal.NoSuchResourceBlockException} if it could not be found. 482 * 483 * @param companyId the company ID 484 * @param groupId the group ID 485 * @param name the name 486 * @param permissionsHash the permissions hash 487 * @return the matching resource block 488 * @throws com.liferay.portal.NoSuchResourceBlockException if a matching resource block could not be found 489 * @throws SystemException if a system exception occurred 490 */ 491 public static com.liferay.portal.model.ResourceBlock findByC_G_N_P( 492 long companyId, long groupId, java.lang.String name, 493 java.lang.String permissionsHash) 494 throws com.liferay.portal.NoSuchResourceBlockException, 495 com.liferay.portal.kernel.exception.SystemException { 496 return getPersistence() 497 .findByC_G_N_P(companyId, groupId, name, permissionsHash); 498 } 499 500 /** 501 * Returns the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 502 * 503 * @param companyId the company ID 504 * @param groupId the group ID 505 * @param name the name 506 * @param permissionsHash the permissions hash 507 * @return the matching resource block, or <code>null</code> if a matching resource block could not be found 508 * @throws SystemException if a system exception occurred 509 */ 510 public static com.liferay.portal.model.ResourceBlock fetchByC_G_N_P( 511 long companyId, long groupId, java.lang.String name, 512 java.lang.String permissionsHash) 513 throws com.liferay.portal.kernel.exception.SystemException { 514 return getPersistence() 515 .fetchByC_G_N_P(companyId, groupId, name, permissionsHash); 516 } 517 518 /** 519 * Returns the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 520 * 521 * @param companyId the company ID 522 * @param groupId the group ID 523 * @param name the name 524 * @param permissionsHash the permissions hash 525 * @param retrieveFromCache whether to use the finder cache 526 * @return the matching resource block, or <code>null</code> if a matching resource block could not be found 527 * @throws SystemException if a system exception occurred 528 */ 529 public static com.liferay.portal.model.ResourceBlock fetchByC_G_N_P( 530 long companyId, long groupId, java.lang.String name, 531 java.lang.String permissionsHash, boolean retrieveFromCache) 532 throws com.liferay.portal.kernel.exception.SystemException { 533 return getPersistence() 534 .fetchByC_G_N_P(companyId, groupId, name, permissionsHash, 535 retrieveFromCache); 536 } 537 538 /** 539 * Removes the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? from the database. 540 * 541 * @param companyId the company ID 542 * @param groupId the group ID 543 * @param name the name 544 * @param permissionsHash the permissions hash 545 * @return the resource block that was removed 546 * @throws SystemException if a system exception occurred 547 */ 548 public static com.liferay.portal.model.ResourceBlock removeByC_G_N_P( 549 long companyId, long groupId, java.lang.String name, 550 java.lang.String permissionsHash) 551 throws com.liferay.portal.NoSuchResourceBlockException, 552 com.liferay.portal.kernel.exception.SystemException { 553 return getPersistence() 554 .removeByC_G_N_P(companyId, groupId, name, permissionsHash); 555 } 556 557 /** 558 * Returns the number of resource blocks where companyId = ? and groupId = ? and name = ? and permissionsHash = ?. 559 * 560 * @param companyId the company ID 561 * @param groupId the group ID 562 * @param name the name 563 * @param permissionsHash the permissions hash 564 * @return the number of matching resource blocks 565 * @throws SystemException if a system exception occurred 566 */ 567 public static int countByC_G_N_P(long companyId, long groupId, 568 java.lang.String name, java.lang.String permissionsHash) 569 throws com.liferay.portal.kernel.exception.SystemException { 570 return getPersistence() 571 .countByC_G_N_P(companyId, groupId, name, permissionsHash); 572 } 573 574 /** 575 * Caches the resource block in the entity cache if it is enabled. 576 * 577 * @param resourceBlock the resource block 578 */ 579 public static void cacheResult( 580 com.liferay.portal.model.ResourceBlock resourceBlock) { 581 getPersistence().cacheResult(resourceBlock); 582 } 583 584 /** 585 * Caches the resource blocks in the entity cache if it is enabled. 586 * 587 * @param resourceBlocks the resource blocks 588 */ 589 public static void cacheResult( 590 java.util.List<com.liferay.portal.model.ResourceBlock> resourceBlocks) { 591 getPersistence().cacheResult(resourceBlocks); 592 } 593 594 /** 595 * Creates a new resource block with the primary key. Does not add the resource block to the database. 596 * 597 * @param resourceBlockId the primary key for the new resource block 598 * @return the new resource block 599 */ 600 public static com.liferay.portal.model.ResourceBlock create( 601 long resourceBlockId) { 602 return getPersistence().create(resourceBlockId); 603 } 604 605 /** 606 * Removes the resource block with the primary key from the database. Also notifies the appropriate model listeners. 607 * 608 * @param resourceBlockId the primary key of the resource block 609 * @return the resource block that was removed 610 * @throws com.liferay.portal.NoSuchResourceBlockException if a resource block with the primary key could not be found 611 * @throws SystemException if a system exception occurred 612 */ 613 public static com.liferay.portal.model.ResourceBlock remove( 614 long resourceBlockId) 615 throws com.liferay.portal.NoSuchResourceBlockException, 616 com.liferay.portal.kernel.exception.SystemException { 617 return getPersistence().remove(resourceBlockId); 618 } 619 620 public static com.liferay.portal.model.ResourceBlock updateImpl( 621 com.liferay.portal.model.ResourceBlock resourceBlock) 622 throws com.liferay.portal.kernel.exception.SystemException { 623 return getPersistence().updateImpl(resourceBlock); 624 } 625 626 /** 627 * Returns the resource block with the primary key or throws a {@link com.liferay.portal.NoSuchResourceBlockException} if it could not be found. 628 * 629 * @param resourceBlockId the primary key of the resource block 630 * @return the resource block 631 * @throws com.liferay.portal.NoSuchResourceBlockException if a resource block with the primary key could not be found 632 * @throws SystemException if a system exception occurred 633 */ 634 public static com.liferay.portal.model.ResourceBlock findByPrimaryKey( 635 long resourceBlockId) 636 throws com.liferay.portal.NoSuchResourceBlockException, 637 com.liferay.portal.kernel.exception.SystemException { 638 return getPersistence().findByPrimaryKey(resourceBlockId); 639 } 640 641 /** 642 * Returns the resource block with the primary key or returns <code>null</code> if it could not be found. 643 * 644 * @param resourceBlockId the primary key of the resource block 645 * @return the resource block, or <code>null</code> if a resource block with the primary key could not be found 646 * @throws SystemException if a system exception occurred 647 */ 648 public static com.liferay.portal.model.ResourceBlock fetchByPrimaryKey( 649 long resourceBlockId) 650 throws com.liferay.portal.kernel.exception.SystemException { 651 return getPersistence().fetchByPrimaryKey(resourceBlockId); 652 } 653 654 /** 655 * Returns all the resource blocks. 656 * 657 * @return the resource blocks 658 * @throws SystemException if a system exception occurred 659 */ 660 public static java.util.List<com.liferay.portal.model.ResourceBlock> findAll() 661 throws com.liferay.portal.kernel.exception.SystemException { 662 return getPersistence().findAll(); 663 } 664 665 /** 666 * Returns a range of all the resource blocks. 667 * 668 * <p> 669 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 670 * </p> 671 * 672 * @param start the lower bound of the range of resource blocks 673 * @param end the upper bound of the range of resource blocks (not inclusive) 674 * @return the range of resource blocks 675 * @throws SystemException if a system exception occurred 676 */ 677 public static java.util.List<com.liferay.portal.model.ResourceBlock> findAll( 678 int start, int end) 679 throws com.liferay.portal.kernel.exception.SystemException { 680 return getPersistence().findAll(start, end); 681 } 682 683 /** 684 * Returns an ordered range of all the resource blocks. 685 * 686 * <p> 687 * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ResourceBlockModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 688 * </p> 689 * 690 * @param start the lower bound of the range of resource blocks 691 * @param end the upper bound of the range of resource blocks (not inclusive) 692 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 693 * @return the ordered range of resource blocks 694 * @throws SystemException if a system exception occurred 695 */ 696 public static java.util.List<com.liferay.portal.model.ResourceBlock> findAll( 697 int start, int end, 698 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 699 throws com.liferay.portal.kernel.exception.SystemException { 700 return getPersistence().findAll(start, end, orderByComparator); 701 } 702 703 /** 704 * Removes all the resource blocks from the database. 705 * 706 * @throws SystemException if a system exception occurred 707 */ 708 public static void removeAll() 709 throws com.liferay.portal.kernel.exception.SystemException { 710 getPersistence().removeAll(); 711 } 712 713 /** 714 * Returns the number of resource blocks. 715 * 716 * @return the number of resource blocks 717 * @throws SystemException if a system exception occurred 718 */ 719 public static int countAll() 720 throws com.liferay.portal.kernel.exception.SystemException { 721 return getPersistence().countAll(); 722 } 723 724 public static ResourceBlockPersistence getPersistence() { 725 if (_persistence == null) { 726 _persistence = (ResourceBlockPersistence)PortalBeanLocatorUtil.locate(ResourceBlockPersistence.class.getName()); 727 728 ReferenceRegistry.registerReference(ResourceBlockUtil.class, 729 "_persistence"); 730 } 731 732 return _persistence; 733 } 734 735 /** 736 * @deprecated As of 6.2.0 737 */ 738 public void setPersistence(ResourceBlockPersistence persistence) { 739 } 740 741 private static ResourceBlockPersistence _persistence; 742 }