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