001 /** 002 * Copyright (c) 2000-2013 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.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#update(com.liferay.portal.model.BaseModel, boolean) 098 */ 099 public static Release update(Release release, boolean merge) 100 throws SystemException { 101 return getPersistence().update(release, merge); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 106 */ 107 public static Release update(Release release, boolean merge, 108 ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(release, merge, serviceContext); 110 } 111 112 /** 113 * Caches the release in the entity cache if it is enabled. 114 * 115 * @param release the release 116 */ 117 public static void cacheResult(com.liferay.portal.model.Release release) { 118 getPersistence().cacheResult(release); 119 } 120 121 /** 122 * Caches the releases in the entity cache if it is enabled. 123 * 124 * @param releases the releases 125 */ 126 public static void cacheResult( 127 java.util.List<com.liferay.portal.model.Release> releases) { 128 getPersistence().cacheResult(releases); 129 } 130 131 /** 132 * Creates a new release with the primary key. Does not add the release to the database. 133 * 134 * @param releaseId the primary key for the new release 135 * @return the new release 136 */ 137 public static com.liferay.portal.model.Release create(long releaseId) { 138 return getPersistence().create(releaseId); 139 } 140 141 /** 142 * Removes the release with the primary key from the database. Also notifies the appropriate model listeners. 143 * 144 * @param releaseId the primary key of the release 145 * @return the release that was removed 146 * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found 147 * @throws SystemException if a system exception occurred 148 */ 149 public static com.liferay.portal.model.Release remove(long releaseId) 150 throws com.liferay.portal.NoSuchReleaseException, 151 com.liferay.portal.kernel.exception.SystemException { 152 return getPersistence().remove(releaseId); 153 } 154 155 public static com.liferay.portal.model.Release updateImpl( 156 com.liferay.portal.model.Release release, boolean merge) 157 throws com.liferay.portal.kernel.exception.SystemException { 158 return getPersistence().updateImpl(release, merge); 159 } 160 161 /** 162 * Returns the release with the primary key or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found. 163 * 164 * @param releaseId the primary key of the release 165 * @return the release 166 * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found 167 * @throws SystemException if a system exception occurred 168 */ 169 public static com.liferay.portal.model.Release findByPrimaryKey( 170 long releaseId) 171 throws com.liferay.portal.NoSuchReleaseException, 172 com.liferay.portal.kernel.exception.SystemException { 173 return getPersistence().findByPrimaryKey(releaseId); 174 } 175 176 /** 177 * Returns the release with the primary key or returns <code>null</code> if it could not be found. 178 * 179 * @param releaseId the primary key of the release 180 * @return the release, or <code>null</code> if a release with the primary key could not be found 181 * @throws SystemException if a system exception occurred 182 */ 183 public static com.liferay.portal.model.Release fetchByPrimaryKey( 184 long releaseId) 185 throws com.liferay.portal.kernel.exception.SystemException { 186 return getPersistence().fetchByPrimaryKey(releaseId); 187 } 188 189 /** 190 * Returns the release where servletContextName = ? or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found. 191 * 192 * @param servletContextName the servlet context name 193 * @return the matching release 194 * @throws com.liferay.portal.NoSuchReleaseException if a matching release could not be found 195 * @throws SystemException if a system exception occurred 196 */ 197 public static com.liferay.portal.model.Release findByServletContextName( 198 java.lang.String servletContextName) 199 throws com.liferay.portal.NoSuchReleaseException, 200 com.liferay.portal.kernel.exception.SystemException { 201 return getPersistence().findByServletContextName(servletContextName); 202 } 203 204 /** 205 * Returns the release where servletContextName = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 206 * 207 * @param servletContextName the servlet context name 208 * @return the matching release, or <code>null</code> if a matching release could not be found 209 * @throws SystemException if a system exception occurred 210 */ 211 public static com.liferay.portal.model.Release fetchByServletContextName( 212 java.lang.String servletContextName) 213 throws com.liferay.portal.kernel.exception.SystemException { 214 return getPersistence().fetchByServletContextName(servletContextName); 215 } 216 217 /** 218 * Returns the release where servletContextName = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 219 * 220 * @param servletContextName the servlet context name 221 * @param retrieveFromCache whether to use the finder cache 222 * @return the matching release, or <code>null</code> if a matching release could not be found 223 * @throws SystemException if a system exception occurred 224 */ 225 public static com.liferay.portal.model.Release fetchByServletContextName( 226 java.lang.String servletContextName, boolean retrieveFromCache) 227 throws com.liferay.portal.kernel.exception.SystemException { 228 return getPersistence() 229 .fetchByServletContextName(servletContextName, 230 retrieveFromCache); 231 } 232 233 /** 234 * Returns all the releases. 235 * 236 * @return the releases 237 * @throws SystemException if a system exception occurred 238 */ 239 public static java.util.List<com.liferay.portal.model.Release> findAll() 240 throws com.liferay.portal.kernel.exception.SystemException { 241 return getPersistence().findAll(); 242 } 243 244 /** 245 * Returns a range of all the releases. 246 * 247 * <p> 248 * 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. 249 * </p> 250 * 251 * @param start the lower bound of the range of releases 252 * @param end the upper bound of the range of releases (not inclusive) 253 * @return the range of releases 254 * @throws SystemException if a system exception occurred 255 */ 256 public static java.util.List<com.liferay.portal.model.Release> findAll( 257 int start, int end) 258 throws com.liferay.portal.kernel.exception.SystemException { 259 return getPersistence().findAll(start, end); 260 } 261 262 /** 263 * Returns an ordered range of all the releases. 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 releases 270 * @param end the upper bound of the range of releases (not inclusive) 271 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 272 * @return the ordered range of releases 273 * @throws SystemException if a system exception occurred 274 */ 275 public static java.util.List<com.liferay.portal.model.Release> findAll( 276 int start, int end, 277 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 278 throws com.liferay.portal.kernel.exception.SystemException { 279 return getPersistence().findAll(start, end, orderByComparator); 280 } 281 282 /** 283 * Removes the release where servletContextName = ? from the database. 284 * 285 * @param servletContextName the servlet context name 286 * @return the release that was removed 287 * @throws SystemException if a system exception occurred 288 */ 289 public static com.liferay.portal.model.Release removeByServletContextName( 290 java.lang.String servletContextName) 291 throws com.liferay.portal.NoSuchReleaseException, 292 com.liferay.portal.kernel.exception.SystemException { 293 return getPersistence().removeByServletContextName(servletContextName); 294 } 295 296 /** 297 * Removes all the releases from the database. 298 * 299 * @throws SystemException if a system exception occurred 300 */ 301 public static void removeAll() 302 throws com.liferay.portal.kernel.exception.SystemException { 303 getPersistence().removeAll(); 304 } 305 306 /** 307 * Returns the number of releases where servletContextName = ?. 308 * 309 * @param servletContextName the servlet context name 310 * @return the number of matching releases 311 * @throws SystemException if a system exception occurred 312 */ 313 public static int countByServletContextName( 314 java.lang.String servletContextName) 315 throws com.liferay.portal.kernel.exception.SystemException { 316 return getPersistence().countByServletContextName(servletContextName); 317 } 318 319 /** 320 * Returns the number of releases. 321 * 322 * @return the number of releases 323 * @throws SystemException if a system exception occurred 324 */ 325 public static int countAll() 326 throws com.liferay.portal.kernel.exception.SystemException { 327 return getPersistence().countAll(); 328 } 329 330 public static ReleasePersistence getPersistence() { 331 if (_persistence == null) { 332 _persistence = (ReleasePersistence)PortalBeanLocatorUtil.locate(ReleasePersistence.class.getName()); 333 334 ReferenceRegistry.registerReference(ReleaseUtil.class, 335 "_persistence"); 336 } 337 338 return _persistence; 339 } 340 341 /** 342 * @deprecated 343 */ 344 public void setPersistence(ReleasePersistence persistence) { 345 } 346 347 private static ReleasePersistence _persistence; 348 }