001 /** 002 * Copyright (c) 2000-2011 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.kernel.bean.PortalBeanLocatorUtil; 018 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 019 import com.liferay.portal.kernel.exception.SystemException; 020 import com.liferay.portal.kernel.util.OrderByComparator; 021 import com.liferay.portal.kernel.util.ReferenceRegistry; 022 import com.liferay.portal.model.Release; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the release service. This utility wraps {@link ReleasePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class. 029 * 030 * <p> 031 * Caching information and settings can be found in <code>portal.properties</code> 032 * </p> 033 * 034 * @author Brian Wing Shun Chan 035 * @see ReleasePersistence 036 * @see ReleasePersistenceImpl 037 * @generated 038 */ 039 public class ReleaseUtil { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 044 */ 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 048 */ 049 public static void clearCache() { 050 getPersistence().clearCache(); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 055 */ 056 public static void clearCache(Release release) { 057 getPersistence().clearCache(release); 058 } 059 060 /** 061 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 062 */ 063 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 064 throws SystemException { 065 return getPersistence().countWithDynamicQuery(dynamicQuery); 066 } 067 068 /** 069 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 070 */ 071 public static List<Release> findWithDynamicQuery(DynamicQuery dynamicQuery) 072 throws SystemException { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<Release> findWithDynamicQuery( 080 DynamicQuery dynamicQuery, int start, int end) 081 throws SystemException { 082 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 083 } 084 085 /** 086 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 087 */ 088 public static List<Release> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator orderByComparator) throws SystemException { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 098 */ 099 public static Release remove(Release release) throws SystemException { 100 return getPersistence().remove(release); 101 } 102 103 /** 104 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 105 */ 106 public static Release update(Release release, boolean merge) 107 throws SystemException { 108 return getPersistence().update(release, merge); 109 } 110 111 /** 112 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 113 */ 114 public static Release update(Release release, boolean merge, 115 ServiceContext serviceContext) throws SystemException { 116 return getPersistence().update(release, merge, serviceContext); 117 } 118 119 /** 120 * Caches the release in the entity cache if it is enabled. 121 * 122 * @param release the release to cache 123 */ 124 public static void cacheResult(com.liferay.portal.model.Release release) { 125 getPersistence().cacheResult(release); 126 } 127 128 /** 129 * Caches the releases in the entity cache if it is enabled. 130 * 131 * @param releases the releases to cache 132 */ 133 public static void cacheResult( 134 java.util.List<com.liferay.portal.model.Release> releases) { 135 getPersistence().cacheResult(releases); 136 } 137 138 /** 139 * Creates a new release with the primary key. Does not add the release to the database. 140 * 141 * @param releaseId the primary key for the new release 142 * @return the new release 143 */ 144 public static com.liferay.portal.model.Release create(long releaseId) { 145 return getPersistence().create(releaseId); 146 } 147 148 /** 149 * Removes the release with the primary key from the database. Also notifies the appropriate model listeners. 150 * 151 * @param releaseId the primary key of the release to remove 152 * @return the release that was removed 153 * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found 154 * @throws SystemException if a system exception occurred 155 */ 156 public static com.liferay.portal.model.Release remove(long releaseId) 157 throws com.liferay.portal.NoSuchReleaseException, 158 com.liferay.portal.kernel.exception.SystemException { 159 return getPersistence().remove(releaseId); 160 } 161 162 public static com.liferay.portal.model.Release updateImpl( 163 com.liferay.portal.model.Release release, boolean merge) 164 throws com.liferay.portal.kernel.exception.SystemException { 165 return getPersistence().updateImpl(release, merge); 166 } 167 168 /** 169 * Finds the release with the primary key or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found. 170 * 171 * @param releaseId the primary key of the release to find 172 * @return the release 173 * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found 174 * @throws SystemException if a system exception occurred 175 */ 176 public static com.liferay.portal.model.Release findByPrimaryKey( 177 long releaseId) 178 throws com.liferay.portal.NoSuchReleaseException, 179 com.liferay.portal.kernel.exception.SystemException { 180 return getPersistence().findByPrimaryKey(releaseId); 181 } 182 183 /** 184 * Finds the release with the primary key or returns <code>null</code> if it could not be found. 185 * 186 * @param releaseId the primary key of the release to find 187 * @return the release, or <code>null</code> if a release with the primary key could not be found 188 * @throws SystemException if a system exception occurred 189 */ 190 public static com.liferay.portal.model.Release fetchByPrimaryKey( 191 long releaseId) 192 throws com.liferay.portal.kernel.exception.SystemException { 193 return getPersistence().fetchByPrimaryKey(releaseId); 194 } 195 196 /** 197 * Finds the release where servletContextName = ? or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found. 198 * 199 * @param servletContextName the servlet context name to search with 200 * @return the matching release 201 * @throws com.liferay.portal.NoSuchReleaseException if a matching release could not be found 202 * @throws SystemException if a system exception occurred 203 */ 204 public static com.liferay.portal.model.Release findByServletContextName( 205 java.lang.String servletContextName) 206 throws com.liferay.portal.NoSuchReleaseException, 207 com.liferay.portal.kernel.exception.SystemException { 208 return getPersistence().findByServletContextName(servletContextName); 209 } 210 211 /** 212 * Finds the release where servletContextName = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 213 * 214 * @param servletContextName the servlet context name to search with 215 * @return the matching release, or <code>null</code> if a matching release could not be found 216 * @throws SystemException if a system exception occurred 217 */ 218 public static com.liferay.portal.model.Release fetchByServletContextName( 219 java.lang.String servletContextName) 220 throws com.liferay.portal.kernel.exception.SystemException { 221 return getPersistence().fetchByServletContextName(servletContextName); 222 } 223 224 /** 225 * Finds the release where servletContextName = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 226 * 227 * @param servletContextName the servlet context name to search with 228 * @return the matching release, or <code>null</code> if a matching release could not be found 229 * @throws SystemException if a system exception occurred 230 */ 231 public static com.liferay.portal.model.Release fetchByServletContextName( 232 java.lang.String servletContextName, boolean retrieveFromCache) 233 throws com.liferay.portal.kernel.exception.SystemException { 234 return getPersistence() 235 .fetchByServletContextName(servletContextName, 236 retrieveFromCache); 237 } 238 239 /** 240 * Finds all the releases. 241 * 242 * @return the releases 243 * @throws SystemException if a system exception occurred 244 */ 245 public static java.util.List<com.liferay.portal.model.Release> findAll() 246 throws com.liferay.portal.kernel.exception.SystemException { 247 return getPersistence().findAll(); 248 } 249 250 /** 251 * Finds a range of all the releases. 252 * 253 * <p> 254 * 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. 255 * </p> 256 * 257 * @param start the lower bound of the range of releases to return 258 * @param end the upper bound of the range of releases to return (not inclusive) 259 * @return the range of releases 260 * @throws SystemException if a system exception occurred 261 */ 262 public static java.util.List<com.liferay.portal.model.Release> findAll( 263 int start, int end) 264 throws com.liferay.portal.kernel.exception.SystemException { 265 return getPersistence().findAll(start, end); 266 } 267 268 /** 269 * Finds an ordered range of all the releases. 270 * 271 * <p> 272 * 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. 273 * </p> 274 * 275 * @param start the lower bound of the range of releases to return 276 * @param end the upper bound of the range of releases to return (not inclusive) 277 * @param orderByComparator the comparator to order the results by 278 * @return the ordered range of releases 279 * @throws SystemException if a system exception occurred 280 */ 281 public static java.util.List<com.liferay.portal.model.Release> findAll( 282 int start, int end, 283 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 284 throws com.liferay.portal.kernel.exception.SystemException { 285 return getPersistence().findAll(start, end, orderByComparator); 286 } 287 288 /** 289 * Removes the release where servletContextName = ? from the database. 290 * 291 * @param servletContextName the servlet context name to search with 292 * @throws SystemException if a system exception occurred 293 */ 294 public static void removeByServletContextName( 295 java.lang.String servletContextName) 296 throws com.liferay.portal.NoSuchReleaseException, 297 com.liferay.portal.kernel.exception.SystemException { 298 getPersistence().removeByServletContextName(servletContextName); 299 } 300 301 /** 302 * Removes all the releases from the database. 303 * 304 * @throws SystemException if a system exception occurred 305 */ 306 public static void removeAll() 307 throws com.liferay.portal.kernel.exception.SystemException { 308 getPersistence().removeAll(); 309 } 310 311 /** 312 * Counts all the releases where servletContextName = ?. 313 * 314 * @param servletContextName the servlet context name to search with 315 * @return the number of matching releases 316 * @throws SystemException if a system exception occurred 317 */ 318 public static int countByServletContextName( 319 java.lang.String servletContextName) 320 throws com.liferay.portal.kernel.exception.SystemException { 321 return getPersistence().countByServletContextName(servletContextName); 322 } 323 324 /** 325 * Counts all the releases. 326 * 327 * @return the number of releases 328 * @throws SystemException if a system exception occurred 329 */ 330 public static int countAll() 331 throws com.liferay.portal.kernel.exception.SystemException { 332 return getPersistence().countAll(); 333 } 334 335 public static ReleasePersistence getPersistence() { 336 if (_persistence == null) { 337 _persistence = (ReleasePersistence)PortalBeanLocatorUtil.locate(ReleasePersistence.class.getName()); 338 339 ReferenceRegistry.registerReference(ReleaseUtil.class, 340 "_persistence"); 341 } 342 343 return _persistence; 344 } 345 346 public void setPersistence(ReleasePersistence persistence) { 347 _persistence = persistence; 348 349 ReferenceRegistry.registerReference(ReleaseUtil.class, "_persistence"); 350 } 351 352 private static ReleasePersistence _persistence; 353 }