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.model.ResourceBlock; 020 021 /** 022 * The persistence interface for the resource block service. 023 * 024 * <p> 025 * Caching information and settings can be found in <code>portal.properties</code> 026 * </p> 027 * 028 * @author Brian Wing Shun Chan 029 * @see com.liferay.portal.service.persistence.impl.ResourceBlockPersistenceImpl 030 * @see ResourceBlockUtil 031 * @generated 032 */ 033 @ProviderType 034 public interface ResourceBlockPersistence extends BasePersistence<ResourceBlock> { 035 /* 036 * NOTE FOR DEVELOPERS: 037 * 038 * Never modify or reference this interface directly. Always use {@link ResourceBlockUtil} to access the resource block persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 039 */ 040 041 /** 042 * Returns all the resource blocks where companyId = ? and name = ?. 043 * 044 * @param companyId the company ID 045 * @param name the name 046 * @return the matching resource blocks 047 */ 048 public java.util.List<ResourceBlock> findByC_N(long companyId, 049 java.lang.String name); 050 051 /** 052 * Returns a range of all the resource blocks where companyId = ? and name = ?. 053 * 054 * <p> 055 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 056 * </p> 057 * 058 * @param companyId the company ID 059 * @param name the name 060 * @param start the lower bound of the range of resource blocks 061 * @param end the upper bound of the range of resource blocks (not inclusive) 062 * @return the range of matching resource blocks 063 */ 064 public java.util.List<ResourceBlock> findByC_N(long companyId, 065 java.lang.String name, int start, int end); 066 067 /** 068 * Returns an ordered range of all the resource blocks where companyId = ? and name = ?. 069 * 070 * <p> 071 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 072 * </p> 073 * 074 * @param companyId the company ID 075 * @param name the name 076 * @param start the lower bound of the range of resource blocks 077 * @param end the upper bound of the range of resource blocks (not inclusive) 078 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 079 * @return the ordered range of matching resource blocks 080 */ 081 public java.util.List<ResourceBlock> findByC_N(long companyId, 082 java.lang.String name, int start, int end, 083 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator); 084 085 /** 086 * Returns the first resource block in the ordered set where companyId = ? and name = ?. 087 * 088 * @param companyId the company ID 089 * @param name the name 090 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 091 * @return the first matching resource block 092 * @throws NoSuchResourceBlockException if a matching resource block could not be found 093 */ 094 public ResourceBlock findByC_N_First(long companyId, java.lang.String name, 095 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator) 096 throws com.liferay.portal.NoSuchResourceBlockException; 097 098 /** 099 * Returns the first resource block in the ordered set where companyId = ? and name = ?. 100 * 101 * @param companyId the company ID 102 * @param name the name 103 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 104 * @return the first matching resource block, or <code>null</code> if a matching resource block could not be found 105 */ 106 public ResourceBlock fetchByC_N_First(long companyId, 107 java.lang.String name, 108 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator); 109 110 /** 111 * Returns the last resource block in the ordered set where companyId = ? and name = ?. 112 * 113 * @param companyId the company ID 114 * @param name the name 115 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 116 * @return the last matching resource block 117 * @throws NoSuchResourceBlockException if a matching resource block could not be found 118 */ 119 public ResourceBlock findByC_N_Last(long companyId, java.lang.String name, 120 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator) 121 throws com.liferay.portal.NoSuchResourceBlockException; 122 123 /** 124 * Returns the last resource block in the ordered set where companyId = ? and name = ?. 125 * 126 * @param companyId the company ID 127 * @param name the name 128 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 129 * @return the last matching resource block, or <code>null</code> if a matching resource block could not be found 130 */ 131 public ResourceBlock fetchByC_N_Last(long companyId, java.lang.String name, 132 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator); 133 134 /** 135 * Returns the resource blocks before and after the current resource block in the ordered set where companyId = ? and name = ?. 136 * 137 * @param resourceBlockId the primary key of the current resource block 138 * @param companyId the company ID 139 * @param name the name 140 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 141 * @return the previous, current, and next resource block 142 * @throws NoSuchResourceBlockException if a resource block with the primary key could not be found 143 */ 144 public ResourceBlock[] findByC_N_PrevAndNext(long resourceBlockId, 145 long companyId, java.lang.String name, 146 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator) 147 throws com.liferay.portal.NoSuchResourceBlockException; 148 149 /** 150 * Removes all the resource blocks where companyId = ? and name = ? from the database. 151 * 152 * @param companyId the company ID 153 * @param name the name 154 */ 155 public void removeByC_N(long companyId, java.lang.String name); 156 157 /** 158 * Returns the number of resource blocks where companyId = ? and name = ?. 159 * 160 * @param companyId the company ID 161 * @param name the name 162 * @return the number of matching resource blocks 163 */ 164 public int countByC_N(long companyId, java.lang.String name); 165 166 /** 167 * Returns all the resource blocks where companyId = ? and groupId = ? and name = ?. 168 * 169 * @param companyId the company ID 170 * @param groupId the group ID 171 * @param name the name 172 * @return the matching resource blocks 173 */ 174 public java.util.List<ResourceBlock> findByC_G_N(long companyId, 175 long groupId, java.lang.String name); 176 177 /** 178 * Returns a range of all the resource blocks where companyId = ? and groupId = ? and name = ?. 179 * 180 * <p> 181 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 182 * </p> 183 * 184 * @param companyId the company ID 185 * @param groupId the group ID 186 * @param name the name 187 * @param start the lower bound of the range of resource blocks 188 * @param end the upper bound of the range of resource blocks (not inclusive) 189 * @return the range of matching resource blocks 190 */ 191 public java.util.List<ResourceBlock> findByC_G_N(long companyId, 192 long groupId, java.lang.String name, int start, int end); 193 194 /** 195 * Returns an ordered range of all the resource blocks where companyId = ? and groupId = ? and name = ?. 196 * 197 * <p> 198 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 199 * </p> 200 * 201 * @param companyId the company ID 202 * @param groupId the group ID 203 * @param name the name 204 * @param start the lower bound of the range of resource blocks 205 * @param end the upper bound of the range of resource blocks (not inclusive) 206 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 207 * @return the ordered range of matching resource blocks 208 */ 209 public java.util.List<ResourceBlock> findByC_G_N(long companyId, 210 long groupId, java.lang.String name, int start, int end, 211 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator); 212 213 /** 214 * Returns the first resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 215 * 216 * @param companyId the company ID 217 * @param groupId the group ID 218 * @param name the name 219 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 220 * @return the first matching resource block 221 * @throws NoSuchResourceBlockException if a matching resource block could not be found 222 */ 223 public ResourceBlock findByC_G_N_First(long companyId, long groupId, 224 java.lang.String name, 225 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator) 226 throws com.liferay.portal.NoSuchResourceBlockException; 227 228 /** 229 * Returns the first resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 230 * 231 * @param companyId the company ID 232 * @param groupId the group ID 233 * @param name the name 234 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 235 * @return the first matching resource block, or <code>null</code> if a matching resource block could not be found 236 */ 237 public ResourceBlock fetchByC_G_N_First(long companyId, long groupId, 238 java.lang.String name, 239 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator); 240 241 /** 242 * Returns the last resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 243 * 244 * @param companyId the company ID 245 * @param groupId the group ID 246 * @param name the name 247 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 248 * @return the last matching resource block 249 * @throws NoSuchResourceBlockException if a matching resource block could not be found 250 */ 251 public ResourceBlock findByC_G_N_Last(long companyId, long groupId, 252 java.lang.String name, 253 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator) 254 throws com.liferay.portal.NoSuchResourceBlockException; 255 256 /** 257 * Returns the last resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 258 * 259 * @param companyId the company ID 260 * @param groupId the group ID 261 * @param name the name 262 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 263 * @return the last matching resource block, or <code>null</code> if a matching resource block could not be found 264 */ 265 public ResourceBlock fetchByC_G_N_Last(long companyId, long groupId, 266 java.lang.String name, 267 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator); 268 269 /** 270 * Returns the resource blocks before and after the current resource block in the ordered set where companyId = ? and groupId = ? and name = ?. 271 * 272 * @param resourceBlockId the primary key of the current resource block 273 * @param companyId the company ID 274 * @param groupId the group ID 275 * @param name the name 276 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 277 * @return the previous, current, and next resource block 278 * @throws NoSuchResourceBlockException if a resource block with the primary key could not be found 279 */ 280 public ResourceBlock[] findByC_G_N_PrevAndNext(long resourceBlockId, 281 long companyId, long groupId, java.lang.String name, 282 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator) 283 throws com.liferay.portal.NoSuchResourceBlockException; 284 285 /** 286 * Removes all the resource blocks where companyId = ? and groupId = ? and name = ? from the database. 287 * 288 * @param companyId the company ID 289 * @param groupId the group ID 290 * @param name the name 291 */ 292 public void removeByC_G_N(long companyId, long groupId, 293 java.lang.String name); 294 295 /** 296 * Returns the number of resource blocks where companyId = ? and groupId = ? and name = ?. 297 * 298 * @param companyId the company ID 299 * @param groupId the group ID 300 * @param name the name 301 * @return the number of matching resource blocks 302 */ 303 public int countByC_G_N(long companyId, long groupId, java.lang.String name); 304 305 /** 306 * Returns the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? or throws a {@link NoSuchResourceBlockException} if it could not be found. 307 * 308 * @param companyId the company ID 309 * @param groupId the group ID 310 * @param name the name 311 * @param permissionsHash the permissions hash 312 * @return the matching resource block 313 * @throws NoSuchResourceBlockException if a matching resource block could not be found 314 */ 315 public ResourceBlock findByC_G_N_P(long companyId, long groupId, 316 java.lang.String name, java.lang.String permissionsHash) 317 throws com.liferay.portal.NoSuchResourceBlockException; 318 319 /** 320 * 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. 321 * 322 * @param companyId the company ID 323 * @param groupId the group ID 324 * @param name the name 325 * @param permissionsHash the permissions hash 326 * @return the matching resource block, or <code>null</code> if a matching resource block could not be found 327 */ 328 public ResourceBlock fetchByC_G_N_P(long companyId, long groupId, 329 java.lang.String name, java.lang.String permissionsHash); 330 331 /** 332 * 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. 333 * 334 * @param companyId the company ID 335 * @param groupId the group ID 336 * @param name the name 337 * @param permissionsHash the permissions hash 338 * @param retrieveFromCache whether to use the finder cache 339 * @return the matching resource block, or <code>null</code> if a matching resource block could not be found 340 */ 341 public ResourceBlock fetchByC_G_N_P(long companyId, long groupId, 342 java.lang.String name, java.lang.String permissionsHash, 343 boolean retrieveFromCache); 344 345 /** 346 * Removes the resource block where companyId = ? and groupId = ? and name = ? and permissionsHash = ? from the database. 347 * 348 * @param companyId the company ID 349 * @param groupId the group ID 350 * @param name the name 351 * @param permissionsHash the permissions hash 352 * @return the resource block that was removed 353 */ 354 public ResourceBlock removeByC_G_N_P(long companyId, long groupId, 355 java.lang.String name, java.lang.String permissionsHash) 356 throws com.liferay.portal.NoSuchResourceBlockException; 357 358 /** 359 * Returns the number of resource blocks where companyId = ? and groupId = ? and name = ? and permissionsHash = ?. 360 * 361 * @param companyId the company ID 362 * @param groupId the group ID 363 * @param name the name 364 * @param permissionsHash the permissions hash 365 * @return the number of matching resource blocks 366 */ 367 public int countByC_G_N_P(long companyId, long groupId, 368 java.lang.String name, java.lang.String permissionsHash); 369 370 /** 371 * Caches the resource block in the entity cache if it is enabled. 372 * 373 * @param resourceBlock the resource block 374 */ 375 public void cacheResult(ResourceBlock resourceBlock); 376 377 /** 378 * Caches the resource blocks in the entity cache if it is enabled. 379 * 380 * @param resourceBlocks the resource blocks 381 */ 382 public void cacheResult(java.util.List<ResourceBlock> resourceBlocks); 383 384 /** 385 * Creates a new resource block with the primary key. Does not add the resource block to the database. 386 * 387 * @param resourceBlockId the primary key for the new resource block 388 * @return the new resource block 389 */ 390 public ResourceBlock create(long resourceBlockId); 391 392 /** 393 * Removes the resource block with the primary key from the database. Also notifies the appropriate model listeners. 394 * 395 * @param resourceBlockId the primary key of the resource block 396 * @return the resource block that was removed 397 * @throws NoSuchResourceBlockException if a resource block with the primary key could not be found 398 */ 399 public ResourceBlock remove(long resourceBlockId) 400 throws com.liferay.portal.NoSuchResourceBlockException; 401 402 public ResourceBlock updateImpl(ResourceBlock resourceBlock); 403 404 /** 405 * Returns the resource block with the primary key or throws a {@link NoSuchResourceBlockException} if it could not be found. 406 * 407 * @param resourceBlockId the primary key of the resource block 408 * @return the resource block 409 * @throws NoSuchResourceBlockException if a resource block with the primary key could not be found 410 */ 411 public ResourceBlock findByPrimaryKey(long resourceBlockId) 412 throws com.liferay.portal.NoSuchResourceBlockException; 413 414 /** 415 * Returns the resource block with the primary key or returns <code>null</code> if it could not be found. 416 * 417 * @param resourceBlockId the primary key of the resource block 418 * @return the resource block, or <code>null</code> if a resource block with the primary key could not be found 419 */ 420 public ResourceBlock fetchByPrimaryKey(long resourceBlockId); 421 422 @Override 423 public java.util.Map<java.io.Serializable, ResourceBlock> fetchByPrimaryKeys( 424 java.util.Set<java.io.Serializable> primaryKeys); 425 426 /** 427 * Returns all the resource blocks. 428 * 429 * @return the resource blocks 430 */ 431 public java.util.List<ResourceBlock> findAll(); 432 433 /** 434 * Returns a range of all the resource blocks. 435 * 436 * <p> 437 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 438 * </p> 439 * 440 * @param start the lower bound of the range of resource blocks 441 * @param end the upper bound of the range of resource blocks (not inclusive) 442 * @return the range of resource blocks 443 */ 444 public java.util.List<ResourceBlock> findAll(int start, int end); 445 446 /** 447 * Returns an ordered range of all the resource blocks. 448 * 449 * <p> 450 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 451 * </p> 452 * 453 * @param start the lower bound of the range of resource blocks 454 * @param end the upper bound of the range of resource blocks (not inclusive) 455 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 456 * @return the ordered range of resource blocks 457 */ 458 public java.util.List<ResourceBlock> findAll(int start, int end, 459 com.liferay.portal.kernel.util.OrderByComparator<ResourceBlock> orderByComparator); 460 461 /** 462 * Removes all the resource blocks from the database. 463 */ 464 public void removeAll(); 465 466 /** 467 * Returns the number of resource blocks. 468 * 469 * @return the number of resource blocks 470 */ 471 public int countAll(); 472 }