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