001 /** 002 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import com.liferay.portal.model.Resource; 018 019 /** 020 * The persistence interface for the resource 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 ResourcePersistenceImpl 028 * @see ResourceUtil 029 * @generated 030 */ 031 public interface ResourcePersistence extends BasePersistence<Resource> { 032 /* 033 * NOTE FOR DEVELOPERS: 034 * 035 * Never modify or reference this interface directly. Always use {@link ResourceUtil} to access the resource persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 036 */ 037 038 /** 039 * Caches the resource in the entity cache if it is enabled. 040 * 041 * @param resource the resource 042 */ 043 public void cacheResult(com.liferay.portal.model.Resource resource); 044 045 /** 046 * Caches the resources in the entity cache if it is enabled. 047 * 048 * @param resources the resources 049 */ 050 public void cacheResult( 051 java.util.List<com.liferay.portal.model.Resource> resources); 052 053 /** 054 * Creates a new resource with the primary key. Does not add the resource to the database. 055 * 056 * @param resourceId the primary key for the new resource 057 * @return the new resource 058 */ 059 public com.liferay.portal.model.Resource create(long resourceId); 060 061 /** 062 * Removes the resource with the primary key from the database. Also notifies the appropriate model listeners. 063 * 064 * @param resourceId the primary key of the resource 065 * @return the resource that was removed 066 * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found 067 * @throws SystemException if a system exception occurred 068 */ 069 public com.liferay.portal.model.Resource remove(long resourceId) 070 throws com.liferay.portal.NoSuchResourceException, 071 com.liferay.portal.kernel.exception.SystemException; 072 073 public com.liferay.portal.model.Resource updateImpl( 074 com.liferay.portal.model.Resource resource, boolean merge) 075 throws com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Returns the resource with the primary key or throws a {@link com.liferay.portal.NoSuchResourceException} if it could not be found. 079 * 080 * @param resourceId the primary key of the resource 081 * @return the resource 082 * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found 083 * @throws SystemException if a system exception occurred 084 */ 085 public com.liferay.portal.model.Resource findByPrimaryKey(long resourceId) 086 throws com.liferay.portal.NoSuchResourceException, 087 com.liferay.portal.kernel.exception.SystemException; 088 089 /** 090 * Returns the resource with the primary key or returns <code>null</code> if it could not be found. 091 * 092 * @param resourceId the primary key of the resource 093 * @return the resource, or <code>null</code> if a resource with the primary key could not be found 094 * @throws SystemException if a system exception occurred 095 */ 096 public com.liferay.portal.model.Resource fetchByPrimaryKey(long resourceId) 097 throws com.liferay.portal.kernel.exception.SystemException; 098 099 /** 100 * Returns all the resources where codeId = ?. 101 * 102 * @param codeId the code ID 103 * @return the matching resources 104 * @throws SystemException if a system exception occurred 105 */ 106 public java.util.List<com.liferay.portal.model.Resource> findByCodeId( 107 long codeId) throws com.liferay.portal.kernel.exception.SystemException; 108 109 /** 110 * Returns a range of all the resources where codeId = ?. 111 * 112 * <p> 113 * 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. 114 * </p> 115 * 116 * @param codeId the code ID 117 * @param start the lower bound of the range of resources 118 * @param end the upper bound of the range of resources (not inclusive) 119 * @return the range of matching resources 120 * @throws SystemException if a system exception occurred 121 */ 122 public java.util.List<com.liferay.portal.model.Resource> findByCodeId( 123 long codeId, int start, int end) 124 throws com.liferay.portal.kernel.exception.SystemException; 125 126 /** 127 * Returns an ordered range of all the resources where codeId = ?. 128 * 129 * <p> 130 * 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. 131 * </p> 132 * 133 * @param codeId the code ID 134 * @param start the lower bound of the range of resources 135 * @param end the upper bound of the range of resources (not inclusive) 136 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 137 * @return the ordered range of matching resources 138 * @throws SystemException if a system exception occurred 139 */ 140 public java.util.List<com.liferay.portal.model.Resource> findByCodeId( 141 long codeId, int start, int end, 142 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 143 throws com.liferay.portal.kernel.exception.SystemException; 144 145 /** 146 * Returns the first resource in the ordered set where codeId = ?. 147 * 148 * @param codeId the code ID 149 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 150 * @return the first matching resource 151 * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found 152 * @throws SystemException if a system exception occurred 153 */ 154 public com.liferay.portal.model.Resource findByCodeId_First(long codeId, 155 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 156 throws com.liferay.portal.NoSuchResourceException, 157 com.liferay.portal.kernel.exception.SystemException; 158 159 /** 160 * Returns the first resource in the ordered set where codeId = ?. 161 * 162 * @param codeId the code ID 163 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 164 * @return the first matching resource, or <code>null</code> if a matching resource could not be found 165 * @throws SystemException if a system exception occurred 166 */ 167 public com.liferay.portal.model.Resource fetchByCodeId_First(long codeId, 168 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 169 throws com.liferay.portal.kernel.exception.SystemException; 170 171 /** 172 * Returns the last resource in the ordered set where codeId = ?. 173 * 174 * @param codeId the code ID 175 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 176 * @return the last matching resource 177 * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found 178 * @throws SystemException if a system exception occurred 179 */ 180 public com.liferay.portal.model.Resource findByCodeId_Last(long codeId, 181 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 182 throws com.liferay.portal.NoSuchResourceException, 183 com.liferay.portal.kernel.exception.SystemException; 184 185 /** 186 * Returns the last resource in the ordered set where codeId = ?. 187 * 188 * @param codeId the code ID 189 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 190 * @return the last matching resource, or <code>null</code> if a matching resource could not be found 191 * @throws SystemException if a system exception occurred 192 */ 193 public com.liferay.portal.model.Resource fetchByCodeId_Last(long codeId, 194 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 195 throws com.liferay.portal.kernel.exception.SystemException; 196 197 /** 198 * Returns the resources before and after the current resource in the ordered set where codeId = ?. 199 * 200 * @param resourceId the primary key of the current resource 201 * @param codeId the code ID 202 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 203 * @return the previous, current, and next resource 204 * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found 205 * @throws SystemException if a system exception occurred 206 */ 207 public com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext( 208 long resourceId, long codeId, 209 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 210 throws com.liferay.portal.NoSuchResourceException, 211 com.liferay.portal.kernel.exception.SystemException; 212 213 /** 214 * Returns the resource where codeId = ? and primKey = ? or throws a {@link com.liferay.portal.NoSuchResourceException} if it could not be found. 215 * 216 * @param codeId the code ID 217 * @param primKey the prim key 218 * @return the matching resource 219 * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found 220 * @throws SystemException if a system exception occurred 221 */ 222 public com.liferay.portal.model.Resource findByC_P(long codeId, 223 java.lang.String primKey) 224 throws com.liferay.portal.NoSuchResourceException, 225 com.liferay.portal.kernel.exception.SystemException; 226 227 /** 228 * Returns the resource where codeId = ? and primKey = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 229 * 230 * @param codeId the code ID 231 * @param primKey the prim key 232 * @return the matching resource, or <code>null</code> if a matching resource could not be found 233 * @throws SystemException if a system exception occurred 234 */ 235 public com.liferay.portal.model.Resource fetchByC_P(long codeId, 236 java.lang.String primKey) 237 throws com.liferay.portal.kernel.exception.SystemException; 238 239 /** 240 * Returns the resource where codeId = ? and primKey = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 241 * 242 * @param codeId the code ID 243 * @param primKey the prim key 244 * @param retrieveFromCache whether to use the finder cache 245 * @return the matching resource, or <code>null</code> if a matching resource could not be found 246 * @throws SystemException if a system exception occurred 247 */ 248 public com.liferay.portal.model.Resource fetchByC_P(long codeId, 249 java.lang.String primKey, boolean retrieveFromCache) 250 throws com.liferay.portal.kernel.exception.SystemException; 251 252 /** 253 * Returns all the resources. 254 * 255 * @return the resources 256 * @throws SystemException if a system exception occurred 257 */ 258 public java.util.List<com.liferay.portal.model.Resource> findAll() 259 throws com.liferay.portal.kernel.exception.SystemException; 260 261 /** 262 * Returns a range of all the resources. 263 * 264 * <p> 265 * 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. 266 * </p> 267 * 268 * @param start the lower bound of the range of resources 269 * @param end the upper bound of the range of resources (not inclusive) 270 * @return the range of resources 271 * @throws SystemException if a system exception occurred 272 */ 273 public java.util.List<com.liferay.portal.model.Resource> findAll( 274 int start, int end) 275 throws com.liferay.portal.kernel.exception.SystemException; 276 277 /** 278 * Returns an ordered range of all the resources. 279 * 280 * <p> 281 * 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. 282 * </p> 283 * 284 * @param start the lower bound of the range of resources 285 * @param end the upper bound of the range of resources (not inclusive) 286 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 287 * @return the ordered range of resources 288 * @throws SystemException if a system exception occurred 289 */ 290 public java.util.List<com.liferay.portal.model.Resource> findAll( 291 int start, int end, 292 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 293 throws com.liferay.portal.kernel.exception.SystemException; 294 295 /** 296 * Removes all the resources where codeId = ? from the database. 297 * 298 * @param codeId the code ID 299 * @throws SystemException if a system exception occurred 300 */ 301 public void removeByCodeId(long codeId) 302 throws com.liferay.portal.kernel.exception.SystemException; 303 304 /** 305 * Removes the resource where codeId = ? and primKey = ? from the database. 306 * 307 * @param codeId the code ID 308 * @param primKey the prim key 309 * @return the resource that was removed 310 * @throws SystemException if a system exception occurred 311 */ 312 public com.liferay.portal.model.Resource removeByC_P(long codeId, 313 java.lang.String primKey) 314 throws com.liferay.portal.NoSuchResourceException, 315 com.liferay.portal.kernel.exception.SystemException; 316 317 /** 318 * Removes all the resources from the database. 319 * 320 * @throws SystemException if a system exception occurred 321 */ 322 public void removeAll() 323 throws com.liferay.portal.kernel.exception.SystemException; 324 325 /** 326 * Returns the number of resources where codeId = ?. 327 * 328 * @param codeId the code ID 329 * @return the number of matching resources 330 * @throws SystemException if a system exception occurred 331 */ 332 public int countByCodeId(long codeId) 333 throws com.liferay.portal.kernel.exception.SystemException; 334 335 /** 336 * Returns the number of resources where codeId = ? and primKey = ?. 337 * 338 * @param codeId the code ID 339 * @param primKey the prim key 340 * @return the number of matching resources 341 * @throws SystemException if a system exception occurred 342 */ 343 public int countByC_P(long codeId, java.lang.String primKey) 344 throws com.liferay.portal.kernel.exception.SystemException; 345 346 /** 347 * Returns the number of resources. 348 * 349 * @return the number of resources 350 * @throws SystemException if a system exception occurred 351 */ 352 public int countAll() 353 throws com.liferay.portal.kernel.exception.SystemException; 354 }