001 /** 002 * Copyright (c) 2000-2010 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 * 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. 024 * </p> 025 * 026 * <p> 027 * Caching information and settings can be found in <code>portal.properties</code> 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see ResourcePersistenceImpl 032 * @see ResourceUtil 033 * @generated 034 */ 035 public interface ResourcePersistence extends BasePersistence<Resource> { 036 /** 037 * Caches the resource in the entity cache if it is enabled. 038 * 039 * @param resource the resource to cache 040 */ 041 public void cacheResult(com.liferay.portal.model.Resource resource); 042 043 /** 044 * Caches the resources in the entity cache if it is enabled. 045 * 046 * @param resources the resources to cache 047 */ 048 public void cacheResult( 049 java.util.List<com.liferay.portal.model.Resource> resources); 050 051 /** 052 * Creates a new resource with the primary key. Does not add the resource to the database. 053 * 054 * @param resourceId the primary key for the new resource 055 * @return the new resource 056 */ 057 public com.liferay.portal.model.Resource create(long resourceId); 058 059 /** 060 * Removes the resource with the primary key from the database. Also notifies the appropriate model listeners. 061 * 062 * @param resourceId the primary key of the resource to remove 063 * @return the resource that was removed 064 * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found 065 * @throws SystemException if a system exception occurred 066 */ 067 public com.liferay.portal.model.Resource remove(long resourceId) 068 throws com.liferay.portal.NoSuchResourceException, 069 com.liferay.portal.kernel.exception.SystemException; 070 071 public com.liferay.portal.model.Resource updateImpl( 072 com.liferay.portal.model.Resource resource, boolean merge) 073 throws com.liferay.portal.kernel.exception.SystemException; 074 075 /** 076 * Finds the resource with the primary key or throws a {@link com.liferay.portal.NoSuchResourceException} if it could not be found. 077 * 078 * @param resourceId the primary key of the resource to find 079 * @return the resource 080 * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found 081 * @throws SystemException if a system exception occurred 082 */ 083 public com.liferay.portal.model.Resource findByPrimaryKey(long resourceId) 084 throws com.liferay.portal.NoSuchResourceException, 085 com.liferay.portal.kernel.exception.SystemException; 086 087 /** 088 * Finds the resource with the primary key or returns <code>null</code> if it could not be found. 089 * 090 * @param resourceId the primary key of the resource to find 091 * @return the resource, or <code>null</code> if a resource with the primary key could not be found 092 * @throws SystemException if a system exception occurred 093 */ 094 public com.liferay.portal.model.Resource fetchByPrimaryKey(long resourceId) 095 throws com.liferay.portal.kernel.exception.SystemException; 096 097 /** 098 * Finds all the resources where codeId = ?. 099 * 100 * @param codeId the code id to search with 101 * @return the matching resources 102 * @throws SystemException if a system exception occurred 103 */ 104 public java.util.List<com.liferay.portal.model.Resource> findByCodeId( 105 long codeId) throws com.liferay.portal.kernel.exception.SystemException; 106 107 /** 108 * Finds a range of all the resources where codeId = ?. 109 * 110 * <p> 111 * 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. 112 * </p> 113 * 114 * @param codeId the code id to search with 115 * @param start the lower bound of the range of resources to return 116 * @param end the upper bound of the range of resources to return (not inclusive) 117 * @return the range of matching resources 118 * @throws SystemException if a system exception occurred 119 */ 120 public java.util.List<com.liferay.portal.model.Resource> findByCodeId( 121 long codeId, int start, int end) 122 throws com.liferay.portal.kernel.exception.SystemException; 123 124 /** 125 * Finds an ordered range of all the resources where codeId = ?. 126 * 127 * <p> 128 * 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. 129 * </p> 130 * 131 * @param codeId the code id to search with 132 * @param start the lower bound of the range of resources to return 133 * @param end the upper bound of the range of resources to return (not inclusive) 134 * @param orderByComparator the comparator to order the results by 135 * @return the ordered range of matching resources 136 * @throws SystemException if a system exception occurred 137 */ 138 public java.util.List<com.liferay.portal.model.Resource> findByCodeId( 139 long codeId, int start, int end, 140 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 141 throws com.liferay.portal.kernel.exception.SystemException; 142 143 /** 144 * Finds the first resource in the ordered set where codeId = ?. 145 * 146 * <p> 147 * 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. 148 * </p> 149 * 150 * @param codeId the code id to search with 151 * @param orderByComparator the comparator to order the set by 152 * @return the first matching resource 153 * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found 154 * @throws SystemException if a system exception occurred 155 */ 156 public com.liferay.portal.model.Resource findByCodeId_First(long codeId, 157 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 158 throws com.liferay.portal.NoSuchResourceException, 159 com.liferay.portal.kernel.exception.SystemException; 160 161 /** 162 * Finds the last resource in the ordered set where codeId = ?. 163 * 164 * <p> 165 * 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. 166 * </p> 167 * 168 * @param codeId the code id to search with 169 * @param orderByComparator the comparator to order the set by 170 * @return the last matching resource 171 * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found 172 * @throws SystemException if a system exception occurred 173 */ 174 public com.liferay.portal.model.Resource findByCodeId_Last(long codeId, 175 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 176 throws com.liferay.portal.NoSuchResourceException, 177 com.liferay.portal.kernel.exception.SystemException; 178 179 /** 180 * Finds the resources before and after the current resource in the ordered set where codeId = ?. 181 * 182 * <p> 183 * 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. 184 * </p> 185 * 186 * @param resourceId the primary key of the current resource 187 * @param codeId the code id to search with 188 * @param orderByComparator the comparator to order the set by 189 * @return the previous, current, and next resource 190 * @throws com.liferay.portal.NoSuchResourceException if a resource with the primary key could not be found 191 * @throws SystemException if a system exception occurred 192 */ 193 public com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext( 194 long resourceId, long codeId, 195 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 196 throws com.liferay.portal.NoSuchResourceException, 197 com.liferay.portal.kernel.exception.SystemException; 198 199 /** 200 * Finds the resource where codeId = ? and primKey = ? or throws a {@link com.liferay.portal.NoSuchResourceException} if it could not be found. 201 * 202 * @param codeId the code id to search with 203 * @param primKey the prim key to search with 204 * @return the matching resource 205 * @throws com.liferay.portal.NoSuchResourceException if a matching resource could not be found 206 * @throws SystemException if a system exception occurred 207 */ 208 public com.liferay.portal.model.Resource findByC_P(long codeId, 209 java.lang.String primKey) 210 throws com.liferay.portal.NoSuchResourceException, 211 com.liferay.portal.kernel.exception.SystemException; 212 213 /** 214 * Finds the resource where codeId = ? and primKey = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 215 * 216 * @param codeId the code id to search with 217 * @param primKey the prim key to search with 218 * @return the matching resource, or <code>null</code> if a matching resource could not be found 219 * @throws SystemException if a system exception occurred 220 */ 221 public com.liferay.portal.model.Resource fetchByC_P(long codeId, 222 java.lang.String primKey) 223 throws com.liferay.portal.kernel.exception.SystemException; 224 225 /** 226 * Finds the resource where codeId = ? and primKey = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 227 * 228 * @param codeId the code id to search with 229 * @param primKey the prim key to search with 230 * @return the matching resource, or <code>null</code> if a matching resource could not be found 231 * @throws SystemException if a system exception occurred 232 */ 233 public com.liferay.portal.model.Resource fetchByC_P(long codeId, 234 java.lang.String primKey, boolean retrieveFromCache) 235 throws com.liferay.portal.kernel.exception.SystemException; 236 237 /** 238 * Finds all the resources. 239 * 240 * @return the resources 241 * @throws SystemException if a system exception occurred 242 */ 243 public java.util.List<com.liferay.portal.model.Resource> findAll() 244 throws com.liferay.portal.kernel.exception.SystemException; 245 246 /** 247 * Finds a range of all the resources. 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 start the lower bound of the range of resources to return 254 * @param end the upper bound of the range of resources to return (not inclusive) 255 * @return the range of resources 256 * @throws SystemException if a system exception occurred 257 */ 258 public java.util.List<com.liferay.portal.model.Resource> findAll( 259 int start, int end) 260 throws com.liferay.portal.kernel.exception.SystemException; 261 262 /** 263 * Finds an ordered range of all the resources. 264 * 265 * <p> 266 * 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. 267 * </p> 268 * 269 * @param start the lower bound of the range of resources to return 270 * @param end the upper bound of the range of resources to return (not inclusive) 271 * @param orderByComparator the comparator to order the results by 272 * @return the ordered range of resources 273 * @throws SystemException if a system exception occurred 274 */ 275 public java.util.List<com.liferay.portal.model.Resource> findAll( 276 int start, int end, 277 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 278 throws com.liferay.portal.kernel.exception.SystemException; 279 280 /** 281 * Removes all the resources where codeId = ? from the database. 282 * 283 * @param codeId the code id to search with 284 * @throws SystemException if a system exception occurred 285 */ 286 public void removeByCodeId(long codeId) 287 throws com.liferay.portal.kernel.exception.SystemException; 288 289 /** 290 * Removes the resource where codeId = ? and primKey = ? from the database. 291 * 292 * @param codeId the code id to search with 293 * @param primKey the prim key to search with 294 * @throws SystemException if a system exception occurred 295 */ 296 public void removeByC_P(long codeId, java.lang.String primKey) 297 throws com.liferay.portal.NoSuchResourceException, 298 com.liferay.portal.kernel.exception.SystemException; 299 300 /** 301 * Removes all the resources from the database. 302 * 303 * @throws SystemException if a system exception occurred 304 */ 305 public void removeAll() 306 throws com.liferay.portal.kernel.exception.SystemException; 307 308 /** 309 * Counts all the resources where codeId = ?. 310 * 311 * @param codeId the code id to search with 312 * @return the number of matching resources 313 * @throws SystemException if a system exception occurred 314 */ 315 public int countByCodeId(long codeId) 316 throws com.liferay.portal.kernel.exception.SystemException; 317 318 /** 319 * Counts all the resources where codeId = ? and primKey = ?. 320 * 321 * @param codeId the code id to search with 322 * @param primKey the prim key to search with 323 * @return the number of matching resources 324 * @throws SystemException if a system exception occurred 325 */ 326 public int countByC_P(long codeId, java.lang.String primKey) 327 throws com.liferay.portal.kernel.exception.SystemException; 328 329 /** 330 * Counts all the resources. 331 * 332 * @return the number of resources 333 * @throws SystemException if a system exception occurred 334 */ 335 public int countAll() 336 throws com.liferay.portal.kernel.exception.SystemException; 337 }