Liferay 6.0.5

com.liferay.portal.service.persistence
Class ImageUtil

java.lang.Object
  extended by com.liferay.portal.service.persistence.ImageUtil

public class ImageUtil
extends Object

The persistence utility for the image service. This utility wraps 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.

Never modify this class directly. Modify service.xml and rerun ServiceBuilder to regenerate this class.

Caching information and settings can be found in portal.properties

See Also:
ImagePersistence, ImagePersistenceImpl
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Constructor Summary
ImageUtil()
           
 
Method Summary
static void cacheResult(Image image)
          Caches the image in the entity cache if it is enabled.
static void cacheResult(List<Image> images)
          Caches the images in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(Image image)
           
static int countAll()
          Counts all the images.
static int countByLtSize(int size)
          Counts all the images where size < ?.
 long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static Image create(long imageId)
          Creates a new image with the primary key.
static Image fetchByPrimaryKey(long imageId)
          Finds the image with the primary key or returns null if it could not be found.
static List<Image> findAll()
          Finds all the images.
static List<Image> findAll(int start, int end)
          Finds a range of all the images.
static List<Image> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the images.
static Image findByLtSize_First(int size, OrderByComparator orderByComparator)
          Finds the first image in the ordered set where size < ?.
static Image findByLtSize_Last(int size, OrderByComparator orderByComparator)
          Finds the last image in the ordered set where size < ?.
static Image[] findByLtSize_PrevAndNext(long imageId, int size, OrderByComparator orderByComparator)
          Finds the images before and after the current image in the ordered set where size < ?.
static List<Image> findByLtSize(int size)
          Finds all the images where size < ?.
static List<Image> findByLtSize(int size, int start, int end)
          Finds a range of all the images where size < ?.
static List<Image> findByLtSize(int size, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the images where size < ?.
static Image findByPrimaryKey(long imageId)
          Finds the image with the primary key or throws a NoSuchImageException if it could not be found.
static List<Image> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<Image> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<Image> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
           
static ImagePersistence getPersistence()
           
static Image remove(Image image)
           
static Image remove(long imageId)
          Removes the image with the primary key from the database.
static void removeAll()
          Removes all the images from the database.
static void removeByLtSize(int size)
          Removes all the images where size < ? from the database.
 void setPersistence(ImagePersistence persistence)
           
static Image update(Image image, boolean merge)
           
static Image update(Image image, boolean merge, ServiceContext serviceContext)
           
static Image updateImpl(Image image, boolean merge)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtil

public ImageUtil()
Method Detail

clearCache

public static void clearCache()
See Also:
BasePersistence.clearCache()

clearCache

public static void clearCache(Image image)
See Also:
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)

countWithDynamicQuery

public long countWithDynamicQuery(DynamicQuery dynamicQuery)
                           throws SystemException
Throws:
SystemException
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Image> findWithDynamicQuery(DynamicQuery dynamicQuery)
                                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

public static List<Image> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                               int start,
                                               int end)
                                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)

findWithDynamicQuery

public static List<Image> findWithDynamicQuery(DynamicQuery dynamicQuery,
                                               int start,
                                               int end,
                                               OrderByComparator orderByComparator)
                                        throws SystemException
Throws:
SystemException
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)

remove

public static Image remove(Image image)
                    throws SystemException
Throws:
SystemException
See Also:
BasePersistence.remove(com.liferay.portal.model.BaseModel)

update

public static Image update(Image image,
                           boolean merge)
                    throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean)

update

public static Image update(Image image,
                           boolean merge,
                           ServiceContext serviceContext)
                    throws SystemException
Throws:
SystemException
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)

cacheResult

public static void cacheResult(Image image)
Caches the image in the entity cache if it is enabled.

Parameters:
image - the image to cache

cacheResult

public static void cacheResult(List<Image> images)
Caches the images in the entity cache if it is enabled.

Parameters:
images - the images to cache

create

public static Image create(long imageId)
Creates a new image with the primary key. Does not add the image to the database.

Parameters:
imageId - the primary key for the new image
Returns:
the new image

remove

public static Image remove(long imageId)
                    throws NoSuchImageException,
                           SystemException
Removes the image with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
imageId - the primary key of the image to remove
Returns:
the image that was removed
Throws:
NoSuchImageException - if a image with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

public static Image updateImpl(Image image,
                               boolean merge)
                        throws SystemException
Throws:
SystemException

findByPrimaryKey

public static Image findByPrimaryKey(long imageId)
                              throws NoSuchImageException,
                                     SystemException
Finds the image with the primary key or throws a NoSuchImageException if it could not be found.

Parameters:
imageId - the primary key of the image to find
Returns:
the image
Throws:
NoSuchImageException - if a image with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

public static Image fetchByPrimaryKey(long imageId)
                               throws SystemException
Finds the image with the primary key or returns null if it could not be found.

Parameters:
imageId - the primary key of the image to find
Returns:
the image, or null if a image with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByLtSize

public static List<Image> findByLtSize(int size)
                                throws SystemException
Finds all the images where size < ?.

Parameters:
size - the size to search with
Returns:
the matching images
Throws:
SystemException - if a system exception occurred

findByLtSize

public static List<Image> findByLtSize(int size,
                                       int start,
                                       int end)
                                throws SystemException
Finds a range of all the images where size < ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
size - the size to search with
start - the lower bound of the range of images to return
end - the upper bound of the range of images to return (not inclusive)
Returns:
the range of matching images
Throws:
SystemException - if a system exception occurred

findByLtSize

public static List<Image> findByLtSize(int size,
                                       int start,
                                       int end,
                                       OrderByComparator orderByComparator)
                                throws SystemException
Finds an ordered range of all the images where size < ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
size - the size to search with
start - the lower bound of the range of images to return
end - the upper bound of the range of images to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching images
Throws:
SystemException - if a system exception occurred

findByLtSize_First

public static Image findByLtSize_First(int size,
                                       OrderByComparator orderByComparator)
                                throws NoSuchImageException,
                                       SystemException
Finds the first image in the ordered set where size < ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
size - the size to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching image
Throws:
NoSuchImageException - if a matching image could not be found
SystemException - if a system exception occurred

findByLtSize_Last

public static Image findByLtSize_Last(int size,
                                      OrderByComparator orderByComparator)
                               throws NoSuchImageException,
                                      SystemException
Finds the last image in the ordered set where size < ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
size - the size to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching image
Throws:
NoSuchImageException - if a matching image could not be found
SystemException - if a system exception occurred

findByLtSize_PrevAndNext

public static Image[] findByLtSize_PrevAndNext(long imageId,
                                               int size,
                                               OrderByComparator orderByComparator)
                                        throws NoSuchImageException,
                                               SystemException
Finds the images before and after the current image in the ordered set where size < ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
imageId - the primary key of the current image
size - the size to search with
orderByComparator - the comparator to order the set by
Returns:
the previous, current, and next image
Throws:
NoSuchImageException - if a image with the primary key could not be found
SystemException - if a system exception occurred

findAll

public static List<Image> findAll()
                           throws SystemException
Finds all the images.

Returns:
the images
Throws:
SystemException - if a system exception occurred

findAll

public static List<Image> findAll(int start,
                                  int end)
                           throws SystemException
Finds a range of all the images.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of images to return
end - the upper bound of the range of images to return (not inclusive)
Returns:
the range of images
Throws:
SystemException - if a system exception occurred

findAll

public static List<Image> findAll(int start,
                                  int end,
                                  OrderByComparator orderByComparator)
                           throws SystemException
Finds an ordered range of all the images.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of images to return
end - the upper bound of the range of images to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of images
Throws:
SystemException - if a system exception occurred

removeByLtSize

public static void removeByLtSize(int size)
                           throws SystemException
Removes all the images where size < ? from the database.

Parameters:
size - the size to search with
Throws:
SystemException - if a system exception occurred

removeAll

public static void removeAll()
                      throws SystemException
Removes all the images from the database.

Throws:
SystemException - if a system exception occurred

countByLtSize

public static int countByLtSize(int size)
                         throws SystemException
Counts all the images where size < ?.

Parameters:
size - the size to search with
Returns:
the number of matching images
Throws:
SystemException - if a system exception occurred

countAll

public static int countAll()
                    throws SystemException
Counts all the images.

Returns:
the number of images
Throws:
SystemException - if a system exception occurred

getPersistence

public static ImagePersistence getPersistence()

setPersistence

public void setPersistence(ImagePersistence persistence)

Liferay 6.0.5