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