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