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