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