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