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