Liferay 7.0-ce-b4

com.liferay.portal.service.persistence
Class ImageUtil

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

@ProviderType
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.

Caching information and settings can be found in portal.properties

See Also:
ImagePersistence, ImagePersistenceImpl

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()
          Returns the number of images.
static int countByLtSize(int size)
          Returns the number of images where size < ?.
static long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static Image create(long imageId)
          Creates a new image with the primary key.
static Image fetchByLtSize_First(int size, OrderByComparator<Image> orderByComparator)
          Returns the first image in the ordered set where size < ?.
static Image fetchByLtSize_Last(int size, OrderByComparator<Image> orderByComparator)
          Returns the last image in the ordered set where size < ?.
static Image fetchByPrimaryKey(long imageId)
          Returns the image with the primary key or returns null if it could not be found.
static Map<Serializable,Image> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
           
static List<Image> findAll()
          Returns all the images.
static List<Image> findAll(int start, int end)
          Returns a range of all the images.
static List<Image> findAll(int start, int end, OrderByComparator<Image> orderByComparator)
          Returns an ordered range of all the images.
static List<Image> findAll(int start, int end, OrderByComparator<Image> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the images.
static Image findByLtSize_First(int size, OrderByComparator<Image> orderByComparator)
          Returns the first image in the ordered set where size < ?.
static Image findByLtSize_Last(int size, OrderByComparator<Image> orderByComparator)
          Returns the last image in the ordered set where size < ?.
static Image[] findByLtSize_PrevAndNext(long imageId, int size, OrderByComparator<Image> orderByComparator)
          Returns the images before and after the current image in the ordered set where size < ?.
static List<Image> findByLtSize(int size)
          Returns all the images where size < ?.
static List<Image> findByLtSize(int size, int start, int end)
          Returns a range of all the images where size < ?.
static List<Image> findByLtSize(int size, int start, int end, OrderByComparator<Image> orderByComparator)
          Returns an ordered range of all the images where size < ?.
static List<Image> findByLtSize(int size, int start, int end, OrderByComparator<Image> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the images where size < ?.
static Image findByPrimaryKey(long imageId)
          Returns 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<Image> orderByComparator)
           
static Set<String> getBadColumnNames()
           
static ImagePersistence getPersistence()
           
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.
static Image update(Image image)
           
static Image update(Image image, ServiceContext serviceContext)
           
static Image updateImpl(Image image)
           
 
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 static long countWithDynamicQuery(DynamicQuery dynamicQuery)
See Also:
BasePersistence.countWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

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

findWithDynamicQuery

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

findWithDynamicQuery

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

update

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

update

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

findByLtSize

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

Parameters:
size - the size
Returns:
the matching images

findByLtSize

public static List<Image> findByLtSize(int size,
                                       int start,
                                       int end)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from ImageModelImpl. If both orderByComparator 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.

Parameters:
size - the size
start - the lower bound of the range of images
end - the upper bound of the range of images (not inclusive)
Returns:
the range of matching images

findByLtSize

public static List<Image> findByLtSize(int size,
                                       int start,
                                       int end,
                                       OrderByComparator<Image> orderByComparator)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from ImageModelImpl. If both orderByComparator 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.

Parameters:
size - the size
start - the lower bound of the range of images
end - the upper bound of the range of images (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching images

findByLtSize

public static List<Image> findByLtSize(int size,
                                       int start,
                                       int end,
                                       OrderByComparator<Image> orderByComparator,
                                       boolean retrieveFromCache)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from ImageModelImpl. If both orderByComparator 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.

Parameters:
size - the size
start - the lower bound of the range of images
end - the upper bound of the range of images (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of matching images

findByLtSize_First

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

Parameters:
size - the size
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching image
Throws:
NoSuchImageException - if a matching image could not be found

fetchByLtSize_First

public static Image fetchByLtSize_First(int size,
                                        OrderByComparator<Image> orderByComparator)
Returns the first image in the ordered set where size < ?.

Parameters:
size - the size
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching image, or null if a matching image could not be found

findByLtSize_Last

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

Parameters:
size - the size
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching image
Throws:
NoSuchImageException - if a matching image could not be found

fetchByLtSize_Last

public static Image fetchByLtSize_Last(int size,
                                       OrderByComparator<Image> orderByComparator)
Returns the last image in the ordered set where size < ?.

Parameters:
size - the size
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching image, or null if a matching image could not be found

findByLtSize_PrevAndNext

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

Parameters:
imageId - the primary key of the current image
size - the size
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next image
Throws:
NoSuchImageException - if a image with the primary key could not be found

removeByLtSize

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

Parameters:
size - the size

countByLtSize

public static int countByLtSize(int size)
Returns the number of images where size < ?.

Parameters:
size - the size
Returns:
the number of matching images

cacheResult

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

Parameters:
image - the image

cacheResult

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

Parameters:
images - the images

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
Removes the image with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
imageId - the primary key of the image
Returns:
the image that was removed
Throws:
NoSuchImageException - if a image with the primary key could not be found

updateImpl

public static Image updateImpl(Image image)

findByPrimaryKey

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

Parameters:
imageId - the primary key of the image
Returns:
the image
Throws:
NoSuchImageException - if a image with the primary key could not be found

fetchByPrimaryKey

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

Parameters:
imageId - the primary key of the image
Returns:
the image, or null if a image with the primary key could not be found

fetchByPrimaryKeys

public static Map<Serializable,Image> fetchByPrimaryKeys(Set<Serializable> primaryKeys)

findAll

public static List<Image> findAll()
Returns all the images.

Returns:
the images

findAll

public static List<Image> findAll(int start,
                                  int end)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from ImageModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of images
end - the upper bound of the range of images (not inclusive)
Returns:
the range of images

findAll

public static List<Image> findAll(int start,
                                  int end,
                                  OrderByComparator<Image> orderByComparator)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from ImageModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of images
end - the upper bound of the range of images (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of images

findAll

public static List<Image> findAll(int start,
                                  int end,
                                  OrderByComparator<Image> orderByComparator,
                                  boolean retrieveFromCache)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from ImageModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of images
end - the upper bound of the range of images (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of images

removeAll

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


countAll

public static int countAll()
Returns the number of images.

Returns:
the number of images

getBadColumnNames

public static Set<String> getBadColumnNames()

getPersistence

public static ImagePersistence getPersistence()

Liferay 7.0-ce-b4