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.Image; 025 import com.liferay.portal.service.ServiceContext; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the image service. This utility wraps {@link ImagePersistenceImpl} 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 ImagePersistence 038 * @see ImagePersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class ImageUtil { 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(Image image) { 060 getPersistence().clearCache(image); 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<Image> 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<Image> findWithDynamicQuery(DynamicQuery dynamicQuery, 083 int start, int end) throws SystemException { 084 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 085 } 086 087 /** 088 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 089 */ 090 public static List<Image> findWithDynamicQuery(DynamicQuery dynamicQuery, 091 int start, int end, OrderByComparator orderByComparator) 092 throws SystemException { 093 return getPersistence() 094 .findWithDynamicQuery(dynamicQuery, start, end, 095 orderByComparator); 096 } 097 098 /** 099 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 100 */ 101 public static Image update(Image image) throws SystemException { 102 return getPersistence().update(image); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 107 */ 108 public static Image update(Image image, ServiceContext serviceContext) 109 throws SystemException { 110 return getPersistence().update(image, serviceContext); 111 } 112 113 /** 114 * Returns all the images where size < ?. 115 * 116 * @param size the size 117 * @return the matching images 118 * @throws SystemException if a system exception occurred 119 */ 120 public static java.util.List<com.liferay.portal.model.Image> findByLtSize( 121 int size) throws com.liferay.portal.kernel.exception.SystemException { 122 return getPersistence().findByLtSize(size); 123 } 124 125 /** 126 * Returns a range of all the images where size < ?. 127 * 128 * <p> 129 * 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.ImageModelImpl}. 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. 130 * </p> 131 * 132 * @param size the size 133 * @param start the lower bound of the range of images 134 * @param end the upper bound of the range of images (not inclusive) 135 * @return the range of matching images 136 * @throws SystemException if a system exception occurred 137 */ 138 public static java.util.List<com.liferay.portal.model.Image> findByLtSize( 139 int size, int start, int end) 140 throws com.liferay.portal.kernel.exception.SystemException { 141 return getPersistence().findByLtSize(size, start, end); 142 } 143 144 /** 145 * Returns an ordered range of all the images where size < ?. 146 * 147 * <p> 148 * 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.ImageModelImpl}. 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. 149 * </p> 150 * 151 * @param size the size 152 * @param start the lower bound of the range of images 153 * @param end the upper bound of the range of images (not inclusive) 154 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 155 * @return the ordered range of matching images 156 * @throws SystemException if a system exception occurred 157 */ 158 public static java.util.List<com.liferay.portal.model.Image> findByLtSize( 159 int size, int start, int end, 160 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 161 throws com.liferay.portal.kernel.exception.SystemException { 162 return getPersistence().findByLtSize(size, start, end, orderByComparator); 163 } 164 165 /** 166 * Returns the first image in the ordered set where size < ?. 167 * 168 * @param size the size 169 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 170 * @return the first matching image 171 * @throws com.liferay.portal.NoSuchImageException if a matching image could not be found 172 * @throws SystemException if a system exception occurred 173 */ 174 public static com.liferay.portal.model.Image findByLtSize_First(int size, 175 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 176 throws com.liferay.portal.NoSuchImageException, 177 com.liferay.portal.kernel.exception.SystemException { 178 return getPersistence().findByLtSize_First(size, orderByComparator); 179 } 180 181 /** 182 * Returns the first image in the ordered set where size < ?. 183 * 184 * @param size the size 185 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 186 * @return the first matching image, or <code>null</code> if a matching image could not be found 187 * @throws SystemException if a system exception occurred 188 */ 189 public static com.liferay.portal.model.Image fetchByLtSize_First(int size, 190 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 191 throws com.liferay.portal.kernel.exception.SystemException { 192 return getPersistence().fetchByLtSize_First(size, orderByComparator); 193 } 194 195 /** 196 * Returns the last image in the ordered set where size < ?. 197 * 198 * @param size the size 199 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 200 * @return the last matching image 201 * @throws com.liferay.portal.NoSuchImageException if a matching image could not be found 202 * @throws SystemException if a system exception occurred 203 */ 204 public static com.liferay.portal.model.Image findByLtSize_Last(int size, 205 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 206 throws com.liferay.portal.NoSuchImageException, 207 com.liferay.portal.kernel.exception.SystemException { 208 return getPersistence().findByLtSize_Last(size, orderByComparator); 209 } 210 211 /** 212 * Returns the last image in the ordered set where size < ?. 213 * 214 * @param size the size 215 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 216 * @return the last matching image, or <code>null</code> if a matching image could not be found 217 * @throws SystemException if a system exception occurred 218 */ 219 public static com.liferay.portal.model.Image fetchByLtSize_Last(int size, 220 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 221 throws com.liferay.portal.kernel.exception.SystemException { 222 return getPersistence().fetchByLtSize_Last(size, orderByComparator); 223 } 224 225 /** 226 * Returns the images before and after the current image in the ordered set where size < ?. 227 * 228 * @param imageId the primary key of the current image 229 * @param size the size 230 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 231 * @return the previous, current, and next image 232 * @throws com.liferay.portal.NoSuchImageException if a image with the primary key could not be found 233 * @throws SystemException if a system exception occurred 234 */ 235 public static com.liferay.portal.model.Image[] findByLtSize_PrevAndNext( 236 long imageId, int size, 237 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 238 throws com.liferay.portal.NoSuchImageException, 239 com.liferay.portal.kernel.exception.SystemException { 240 return getPersistence() 241 .findByLtSize_PrevAndNext(imageId, size, orderByComparator); 242 } 243 244 /** 245 * Removes all the images where size < ? from the database. 246 * 247 * @param size the size 248 * @throws SystemException if a system exception occurred 249 */ 250 public static void removeByLtSize(int size) 251 throws com.liferay.portal.kernel.exception.SystemException { 252 getPersistence().removeByLtSize(size); 253 } 254 255 /** 256 * Returns the number of images where size < ?. 257 * 258 * @param size the size 259 * @return the number of matching images 260 * @throws SystemException if a system exception occurred 261 */ 262 public static int countByLtSize(int size) 263 throws com.liferay.portal.kernel.exception.SystemException { 264 return getPersistence().countByLtSize(size); 265 } 266 267 /** 268 * Caches the image in the entity cache if it is enabled. 269 * 270 * @param image the image 271 */ 272 public static void cacheResult(com.liferay.portal.model.Image image) { 273 getPersistence().cacheResult(image); 274 } 275 276 /** 277 * Caches the images in the entity cache if it is enabled. 278 * 279 * @param images the images 280 */ 281 public static void cacheResult( 282 java.util.List<com.liferay.portal.model.Image> images) { 283 getPersistence().cacheResult(images); 284 } 285 286 /** 287 * Creates a new image with the primary key. Does not add the image to the database. 288 * 289 * @param imageId the primary key for the new image 290 * @return the new image 291 */ 292 public static com.liferay.portal.model.Image create(long imageId) { 293 return getPersistence().create(imageId); 294 } 295 296 /** 297 * Removes the image with the primary key from the database. Also notifies the appropriate model listeners. 298 * 299 * @param imageId the primary key of the image 300 * @return the image that was removed 301 * @throws com.liferay.portal.NoSuchImageException if a image with the primary key could not be found 302 * @throws SystemException if a system exception occurred 303 */ 304 public static com.liferay.portal.model.Image remove(long imageId) 305 throws com.liferay.portal.NoSuchImageException, 306 com.liferay.portal.kernel.exception.SystemException { 307 return getPersistence().remove(imageId); 308 } 309 310 public static com.liferay.portal.model.Image updateImpl( 311 com.liferay.portal.model.Image image) 312 throws com.liferay.portal.kernel.exception.SystemException { 313 return getPersistence().updateImpl(image); 314 } 315 316 /** 317 * Returns the image with the primary key or throws a {@link com.liferay.portal.NoSuchImageException} if it could not be found. 318 * 319 * @param imageId the primary key of the image 320 * @return the image 321 * @throws com.liferay.portal.NoSuchImageException if a image with the primary key could not be found 322 * @throws SystemException if a system exception occurred 323 */ 324 public static com.liferay.portal.model.Image findByPrimaryKey(long imageId) 325 throws com.liferay.portal.NoSuchImageException, 326 com.liferay.portal.kernel.exception.SystemException { 327 return getPersistence().findByPrimaryKey(imageId); 328 } 329 330 /** 331 * Returns the image with the primary key or returns <code>null</code> if it could not be found. 332 * 333 * @param imageId the primary key of the image 334 * @return the image, or <code>null</code> if a image with the primary key could not be found 335 * @throws SystemException if a system exception occurred 336 */ 337 public static com.liferay.portal.model.Image fetchByPrimaryKey(long imageId) 338 throws com.liferay.portal.kernel.exception.SystemException { 339 return getPersistence().fetchByPrimaryKey(imageId); 340 } 341 342 /** 343 * Returns all the images. 344 * 345 * @return the images 346 * @throws SystemException if a system exception occurred 347 */ 348 public static java.util.List<com.liferay.portal.model.Image> findAll() 349 throws com.liferay.portal.kernel.exception.SystemException { 350 return getPersistence().findAll(); 351 } 352 353 /** 354 * Returns a range of all the images. 355 * 356 * <p> 357 * 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.ImageModelImpl}. 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. 358 * </p> 359 * 360 * @param start the lower bound of the range of images 361 * @param end the upper bound of the range of images (not inclusive) 362 * @return the range of images 363 * @throws SystemException if a system exception occurred 364 */ 365 public static java.util.List<com.liferay.portal.model.Image> findAll( 366 int start, int end) 367 throws com.liferay.portal.kernel.exception.SystemException { 368 return getPersistence().findAll(start, end); 369 } 370 371 /** 372 * Returns an ordered range of all the images. 373 * 374 * <p> 375 * 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.ImageModelImpl}. 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. 376 * </p> 377 * 378 * @param start the lower bound of the range of images 379 * @param end the upper bound of the range of images (not inclusive) 380 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 381 * @return the ordered range of images 382 * @throws SystemException if a system exception occurred 383 */ 384 public static java.util.List<com.liferay.portal.model.Image> findAll( 385 int start, int end, 386 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 387 throws com.liferay.portal.kernel.exception.SystemException { 388 return getPersistence().findAll(start, end, orderByComparator); 389 } 390 391 /** 392 * Removes all the images from the database. 393 * 394 * @throws SystemException if a system exception occurred 395 */ 396 public static void removeAll() 397 throws com.liferay.portal.kernel.exception.SystemException { 398 getPersistence().removeAll(); 399 } 400 401 /** 402 * Returns the number of images. 403 * 404 * @return the number of images 405 * @throws SystemException if a system exception occurred 406 */ 407 public static int countAll() 408 throws com.liferay.portal.kernel.exception.SystemException { 409 return getPersistence().countAll(); 410 } 411 412 public static ImagePersistence getPersistence() { 413 if (_persistence == null) { 414 _persistence = (ImagePersistence)PortalBeanLocatorUtil.locate(ImagePersistence.class.getName()); 415 416 ReferenceRegistry.registerReference(ImageUtil.class, "_persistence"); 417 } 418 419 return _persistence; 420 } 421 422 /** 423 * @deprecated As of 6.2.0 424 */ 425 public void setPersistence(ImagePersistence persistence) { 426 } 427 428 private static ImagePersistence _persistence; 429 }