Liferay 7.0-ce-b4

com.liferay.portal.service.persistence
Class VirtualHostUtil

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

@ProviderType
public class VirtualHostUtil
extends Object

The persistence utility for the virtual host service. This utility wraps VirtualHostPersistenceImpl 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:
VirtualHostPersistence, VirtualHostPersistenceImpl

Constructor Summary
VirtualHostUtil()
           
 
Method Summary
static void cacheResult(List<VirtualHost> virtualHosts)
          Caches the virtual hosts in the entity cache if it is enabled.
static void cacheResult(VirtualHost virtualHost)
          Caches the virtual host in the entity cache if it is enabled.
static void clearCache()
           
static void clearCache(VirtualHost virtualHost)
           
static int countAll()
          Returns the number of virtual hosts.
static int countByC_L(long companyId, long layoutSetId)
          Returns the number of virtual hosts where companyId = ? and layoutSetId = ?.
static int countByHostname(String hostname)
          Returns the number of virtual hosts where hostname = ?.
static long countWithDynamicQuery(DynamicQuery dynamicQuery)
           
static VirtualHost create(long virtualHostId)
          Creates a new virtual host with the primary key.
static VirtualHost fetchByC_L(long companyId, long layoutSetId)
          Returns the virtual host where companyId = ? and layoutSetId = ? or returns null if it could not be found.
static VirtualHost fetchByC_L(long companyId, long layoutSetId, boolean retrieveFromCache)
          Returns the virtual host where companyId = ? and layoutSetId = ? or returns null if it could not be found, optionally using the finder cache.
static VirtualHost fetchByHostname(String hostname)
          Returns the virtual host where hostname = ? or returns null if it could not be found.
static VirtualHost fetchByHostname(String hostname, boolean retrieveFromCache)
          Returns the virtual host where hostname = ? or returns null if it could not be found, optionally using the finder cache.
static VirtualHost fetchByPrimaryKey(long virtualHostId)
          Returns the virtual host with the primary key or returns null if it could not be found.
static Map<Serializable,VirtualHost> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
           
static List<VirtualHost> findAll()
          Returns all the virtual hosts.
static List<VirtualHost> findAll(int start, int end)
          Returns a range of all the virtual hosts.
static List<VirtualHost> findAll(int start, int end, OrderByComparator<VirtualHost> orderByComparator)
          Returns an ordered range of all the virtual hosts.
static List<VirtualHost> findAll(int start, int end, OrderByComparator<VirtualHost> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the virtual hosts.
static VirtualHost findByC_L(long companyId, long layoutSetId)
          Returns the virtual host where companyId = ? and layoutSetId = ? or throws a NoSuchVirtualHostException if it could not be found.
static VirtualHost findByHostname(String hostname)
          Returns the virtual host where hostname = ? or throws a NoSuchVirtualHostException if it could not be found.
static VirtualHost findByPrimaryKey(long virtualHostId)
          Returns the virtual host with the primary key or throws a NoSuchVirtualHostException if it could not be found.
static List<VirtualHost> findWithDynamicQuery(DynamicQuery dynamicQuery)
           
static List<VirtualHost> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
           
static List<VirtualHost> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<VirtualHost> orderByComparator)
           
static VirtualHostPersistence getPersistence()
           
static VirtualHost remove(long virtualHostId)
          Removes the virtual host with the primary key from the database.
static void removeAll()
          Removes all the virtual hosts from the database.
static VirtualHost removeByC_L(long companyId, long layoutSetId)
          Removes the virtual host where companyId = ? and layoutSetId = ? from the database.
static VirtualHost removeByHostname(String hostname)
          Removes the virtual host where hostname = ? from the database.
static VirtualHost update(VirtualHost virtualHost)
           
static VirtualHost update(VirtualHost virtualHost, ServiceContext serviceContext)
           
static VirtualHost updateImpl(VirtualHost virtualHost)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualHostUtil

public VirtualHostUtil()
Method Detail

clearCache

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

clearCache

public static void clearCache(VirtualHost virtualHost)
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<VirtualHost> findWithDynamicQuery(DynamicQuery dynamicQuery)
See Also:
BasePersistence.findWithDynamicQuery(DynamicQuery)

findWithDynamicQuery

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

findWithDynamicQuery

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

update

public static VirtualHost update(VirtualHost virtualHost)
See Also:
BasePersistence.update(com.liferay.portal.model.BaseModel)

update

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

findByHostname

public static VirtualHost findByHostname(String hostname)
                                  throws NoSuchVirtualHostException
Returns the virtual host where hostname = ? or throws a NoSuchVirtualHostException if it could not be found.

Parameters:
hostname - the hostname
Returns:
the matching virtual host
Throws:
NoSuchVirtualHostException - if a matching virtual host could not be found

fetchByHostname

public static VirtualHost fetchByHostname(String hostname)
Returns the virtual host where hostname = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
hostname - the hostname
Returns:
the matching virtual host, or null if a matching virtual host could not be found

fetchByHostname

public static VirtualHost fetchByHostname(String hostname,
                                          boolean retrieveFromCache)
Returns the virtual host where hostname = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
hostname - the hostname
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching virtual host, or null if a matching virtual host could not be found

removeByHostname

public static VirtualHost removeByHostname(String hostname)
                                    throws NoSuchVirtualHostException
Removes the virtual host where hostname = ? from the database.

Parameters:
hostname - the hostname
Returns:
the virtual host that was removed
Throws:
NoSuchVirtualHostException

countByHostname

public static int countByHostname(String hostname)
Returns the number of virtual hosts where hostname = ?.

Parameters:
hostname - the hostname
Returns:
the number of matching virtual hosts

findByC_L

public static VirtualHost findByC_L(long companyId,
                                    long layoutSetId)
                             throws NoSuchVirtualHostException
Returns the virtual host where companyId = ? and layoutSetId = ? or throws a NoSuchVirtualHostException if it could not be found.

Parameters:
companyId - the company ID
layoutSetId - the layout set ID
Returns:
the matching virtual host
Throws:
NoSuchVirtualHostException - if a matching virtual host could not be found

fetchByC_L

public static VirtualHost fetchByC_L(long companyId,
                                     long layoutSetId)
Returns the virtual host where companyId = ? and layoutSetId = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
companyId - the company ID
layoutSetId - the layout set ID
Returns:
the matching virtual host, or null if a matching virtual host could not be found

fetchByC_L

public static VirtualHost fetchByC_L(long companyId,
                                     long layoutSetId,
                                     boolean retrieveFromCache)
Returns the virtual host where companyId = ? and layoutSetId = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
companyId - the company ID
layoutSetId - the layout set ID
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching virtual host, or null if a matching virtual host could not be found

removeByC_L

public static VirtualHost removeByC_L(long companyId,
                                      long layoutSetId)
                               throws NoSuchVirtualHostException
Removes the virtual host where companyId = ? and layoutSetId = ? from the database.

Parameters:
companyId - the company ID
layoutSetId - the layout set ID
Returns:
the virtual host that was removed
Throws:
NoSuchVirtualHostException

countByC_L

public static int countByC_L(long companyId,
                             long layoutSetId)
Returns the number of virtual hosts where companyId = ? and layoutSetId = ?.

Parameters:
companyId - the company ID
layoutSetId - the layout set ID
Returns:
the number of matching virtual hosts

cacheResult

public static void cacheResult(VirtualHost virtualHost)
Caches the virtual host in the entity cache if it is enabled.

Parameters:
virtualHost - the virtual host

cacheResult

public static void cacheResult(List<VirtualHost> virtualHosts)
Caches the virtual hosts in the entity cache if it is enabled.

Parameters:
virtualHosts - the virtual hosts

create

public static VirtualHost create(long virtualHostId)
Creates a new virtual host with the primary key. Does not add the virtual host to the database.

Parameters:
virtualHostId - the primary key for the new virtual host
Returns:
the new virtual host

remove

public static VirtualHost remove(long virtualHostId)
                          throws NoSuchVirtualHostException
Removes the virtual host with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
virtualHostId - the primary key of the virtual host
Returns:
the virtual host that was removed
Throws:
NoSuchVirtualHostException - if a virtual host with the primary key could not be found

updateImpl

public static VirtualHost updateImpl(VirtualHost virtualHost)

findByPrimaryKey

public static VirtualHost findByPrimaryKey(long virtualHostId)
                                    throws NoSuchVirtualHostException
Returns the virtual host with the primary key or throws a NoSuchVirtualHostException if it could not be found.

Parameters:
virtualHostId - the primary key of the virtual host
Returns:
the virtual host
Throws:
NoSuchVirtualHostException - if a virtual host with the primary key could not be found

fetchByPrimaryKey

public static VirtualHost fetchByPrimaryKey(long virtualHostId)
Returns the virtual host with the primary key or returns null if it could not be found.

Parameters:
virtualHostId - the primary key of the virtual host
Returns:
the virtual host, or null if a virtual host with the primary key could not be found

fetchByPrimaryKeys

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

findAll

public static List<VirtualHost> findAll()
Returns all the virtual hosts.

Returns:
the virtual hosts

findAll

public static List<VirtualHost> findAll(int start,
                                        int end)
Returns a range of all the virtual hosts.

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 VirtualHostModelImpl. 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 virtual hosts
end - the upper bound of the range of virtual hosts (not inclusive)
Returns:
the range of virtual hosts

findAll

public static List<VirtualHost> findAll(int start,
                                        int end,
                                        OrderByComparator<VirtualHost> orderByComparator)
Returns an ordered range of all the virtual hosts.

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 VirtualHostModelImpl. 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 virtual hosts
end - the upper bound of the range of virtual hosts (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of virtual hosts

findAll

public static List<VirtualHost> findAll(int start,
                                        int end,
                                        OrderByComparator<VirtualHost> orderByComparator,
                                        boolean retrieveFromCache)
Returns an ordered range of all the virtual hosts.

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 VirtualHostModelImpl. 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 virtual hosts
end - the upper bound of the range of virtual hosts (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 virtual hosts

removeAll

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


countAll

public static int countAll()
Returns the number of virtual hosts.

Returns:
the number of virtual hosts

getPersistence

public static VirtualHostPersistence getPersistence()

Liferay 7.0-ce-b4