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