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