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 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 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 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 * Returns 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 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 * Returns 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 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 * Returns 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 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 * Returns 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 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 * Returns 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 228 * @param retrieveFromCache whether to use the finder cache 229 * @return the matching release, or <code>null</code> if a matching release could not be found 230 * @throws SystemException if a system exception occurred 231 */ 232 public static com.liferay.portal.model.Release fetchByServletContextName( 233 java.lang.String servletContextName, boolean retrieveFromCache) 234 throws com.liferay.portal.kernel.exception.SystemException { 235 return getPersistence() 236 .fetchByServletContextName(servletContextName, 237 retrieveFromCache); 238 } 239 240 /** 241 * Returns all the releases. 242 * 243 * @return the releases 244 * @throws SystemException if a system exception occurred 245 */ 246 public static java.util.List<com.liferay.portal.model.Release> findAll() 247 throws com.liferay.portal.kernel.exception.SystemException { 248 return getPersistence().findAll(); 249 } 250 251 /** 252 * Returns a range of all the releases. 253 * 254 * <p> 255 * 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. 256 * </p> 257 * 258 * @param start the lower bound of the range of releases 259 * @param end the upper bound of the range of releases (not inclusive) 260 * @return the range of releases 261 * @throws SystemException if a system exception occurred 262 */ 263 public static java.util.List<com.liferay.portal.model.Release> findAll( 264 int start, int end) 265 throws com.liferay.portal.kernel.exception.SystemException { 266 return getPersistence().findAll(start, end); 267 } 268 269 /** 270 * Returns an ordered range of all the releases. 271 * 272 * <p> 273 * 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. 274 * </p> 275 * 276 * @param start the lower bound of the range of releases 277 * @param end the upper bound of the range of releases (not inclusive) 278 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 279 * @return the ordered range of releases 280 * @throws SystemException if a system exception occurred 281 */ 282 public static java.util.List<com.liferay.portal.model.Release> findAll( 283 int start, int end, 284 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 285 throws com.liferay.portal.kernel.exception.SystemException { 286 return getPersistence().findAll(start, end, orderByComparator); 287 } 288 289 /** 290 * Removes the release where servletContextName = ? from the database. 291 * 292 * @param servletContextName the servlet context name 293 * @throws SystemException if a system exception occurred 294 */ 295 public static void removeByServletContextName( 296 java.lang.String servletContextName) 297 throws com.liferay.portal.NoSuchReleaseException, 298 com.liferay.portal.kernel.exception.SystemException { 299 getPersistence().removeByServletContextName(servletContextName); 300 } 301 302 /** 303 * Removes all the releases from the database. 304 * 305 * @throws SystemException if a system exception occurred 306 */ 307 public static void removeAll() 308 throws com.liferay.portal.kernel.exception.SystemException { 309 getPersistence().removeAll(); 310 } 311 312 /** 313 * Returns the number of releases where servletContextName = ?. 314 * 315 * @param servletContextName the servlet context name 316 * @return the number of matching releases 317 * @throws SystemException if a system exception occurred 318 */ 319 public static int countByServletContextName( 320 java.lang.String servletContextName) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 return getPersistence().countByServletContextName(servletContextName); 323 } 324 325 /** 326 * Returns the number of releases. 327 * 328 * @return the number of releases 329 * @throws SystemException if a system exception occurred 330 */ 331 public static int countAll() 332 throws com.liferay.portal.kernel.exception.SystemException { 333 return getPersistence().countAll(); 334 } 335 336 public static ReleasePersistence getPersistence() { 337 if (_persistence == null) { 338 _persistence = (ReleasePersistence)PortalBeanLocatorUtil.locate(ReleasePersistence.class.getName()); 339 340 ReferenceRegistry.registerReference(ReleaseUtil.class, 341 "_persistence"); 342 } 343 344 return _persistence; 345 } 346 347 public void setPersistence(ReleasePersistence persistence) { 348 _persistence = persistence; 349 350 ReferenceRegistry.registerReference(ReleaseUtil.class, "_persistence"); 351 } 352 353 private static ReleasePersistence _persistence; 354 }