public class VirtualHostUtil
extends Object
com.liferay.portal.service.persistence.impl.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
VirtualHostPersistence
Constructor and Description |
---|
VirtualHostUtil() |
Modifier and Type | Method and Description |
---|---|
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_D(long companyId,
long layoutSetId,
boolean defaultVirtualHost)
Returns the number of virtual hosts where companyId = ? and layoutSetId = ? and defaultVirtualHost = ?.
|
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_D(long companyId,
long layoutSetId,
boolean defaultVirtualHost)
Returns the virtual host where companyId = ? and layoutSetId = ? and defaultVirtualHost = ? or returns
null if it could not be found. |
static VirtualHost |
fetchByC_L_D(long companyId,
long layoutSetId,
boolean defaultVirtualHost,
boolean useFinderCache)
Returns the virtual host where companyId = ? and layoutSetId = ? and defaultVirtualHost = ? or returns
null if it could not be found, optionally using the finder cache. |
static VirtualHost |
fetchByC_L_First(long companyId,
long layoutSetId,
OrderByComparator<VirtualHost> orderByComparator)
Returns the first virtual host in the ordered set where companyId = ? and layoutSetId = ?.
|
static VirtualHost |
fetchByC_L_Last(long companyId,
long layoutSetId,
OrderByComparator<VirtualHost> orderByComparator)
Returns the last virtual host in the ordered set where companyId = ? and layoutSetId = ?.
|
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 useFinderCache)
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 useFinderCache)
Returns an ordered range of all the virtual hosts.
|
static VirtualHost |
findByC_L_D(long companyId,
long layoutSetId,
boolean defaultVirtualHost)
Returns the virtual host where companyId = ? and layoutSetId = ? and defaultVirtualHost = ? or throws a
NoSuchVirtualHostException if it could not be found. |
static VirtualHost |
findByC_L_First(long companyId,
long layoutSetId,
OrderByComparator<VirtualHost> orderByComparator)
Returns the first virtual host in the ordered set where companyId = ? and layoutSetId = ?.
|
static VirtualHost |
findByC_L_Last(long companyId,
long layoutSetId,
OrderByComparator<VirtualHost> orderByComparator)
Returns the last virtual host in the ordered set where companyId = ? and layoutSetId = ?.
|
static VirtualHost[] |
findByC_L_PrevAndNext(long virtualHostId,
long companyId,
long layoutSetId,
OrderByComparator<VirtualHost> orderByComparator)
Returns the virtual hosts before and after the current virtual host in the ordered set where companyId = ? and layoutSetId = ?.
|
static List<VirtualHost> |
findByC_L(long companyId,
long layoutSetId)
Returns all the virtual hosts where companyId = ? and layoutSetId = ?.
|
static List<VirtualHost> |
findByC_L(long companyId,
long layoutSetId,
int start,
int end)
Returns a range of all the virtual hosts where companyId = ? and layoutSetId = ?.
|
static List<VirtualHost> |
findByC_L(long companyId,
long layoutSetId,
int start,
int end,
OrderByComparator<VirtualHost> orderByComparator)
Returns an ordered range of all the virtual hosts where companyId = ? and layoutSetId = ?.
|
static List<VirtualHost> |
findByC_L(long companyId,
long layoutSetId,
int start,
int end,
OrderByComparator<VirtualHost> orderByComparator,
boolean useFinderCache)
Returns an ordered range of all the virtual hosts where companyId = ? and layoutSetId = ?.
|
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_D(long companyId,
long layoutSetId,
boolean defaultVirtualHost)
Removes the virtual host where companyId = ? and layoutSetId = ? and defaultVirtualHost = ? from the database.
|
static void |
removeByC_L(long companyId,
long layoutSetId)
Removes all the virtual hosts 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) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(VirtualHost virtualHost)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
public static Map<Serializable,VirtualHost> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
BasePersistence.fetchByPrimaryKeys(Set)
public static List<VirtualHost> findWithDynamicQuery(DynamicQuery dynamicQuery)
public static List<VirtualHost> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end)
public static List<VirtualHost> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<VirtualHost> orderByComparator)
public static VirtualHost update(VirtualHost virtualHost)
public static VirtualHost update(VirtualHost virtualHost, ServiceContext serviceContext)
public static VirtualHost findByHostname(String hostname) throws NoSuchVirtualHostException
NoSuchVirtualHostException
if it could not be found.hostname
- the hostnameNoSuchVirtualHostException
- if a matching virtual host could not be foundpublic static VirtualHost fetchByHostname(String hostname)
null
if it could not be found. Uses the finder cache.hostname
- the hostnamenull
if a matching virtual host could not be foundpublic static VirtualHost fetchByHostname(String hostname, boolean useFinderCache)
null
if it could not be found, optionally using the finder cache.hostname
- the hostnameuseFinderCache
- whether to use the finder cachenull
if a matching virtual host could not be foundpublic static VirtualHost removeByHostname(String hostname) throws NoSuchVirtualHostException
hostname
- the hostnameNoSuchVirtualHostException
public static int countByHostname(String hostname)
hostname
- the hostnamepublic static List<VirtualHost> findByC_L(long companyId, long layoutSetId)
companyId
- the company IDlayoutSetId
- the layout set IDpublic static List<VirtualHost> findByC_L(long companyId, long layoutSetId, int start, int end)
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, then the query will include the default ORDER BY logic from VirtualHostModelImpl
.
companyId
- the company IDlayoutSetId
- the layout set IDstart
- the lower bound of the range of virtual hostsend
- the upper bound of the range of virtual hosts (not inclusive)public static List<VirtualHost> findByC_L(long companyId, long layoutSetId, int start, int end, OrderByComparator<VirtualHost> orderByComparator)
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, then the query will include the default ORDER BY logic from VirtualHostModelImpl
.
companyId
- the company IDlayoutSetId
- the layout set IDstart
- the lower bound of the range of virtual hostsend
- the upper bound of the range of virtual hosts (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static List<VirtualHost> findByC_L(long companyId, long layoutSetId, int start, int end, OrderByComparator<VirtualHost> orderByComparator, boolean useFinderCache)
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, then the query will include the default ORDER BY logic from VirtualHostModelImpl
.
companyId
- the company IDlayoutSetId
- the layout set IDstart
- the lower bound of the range of virtual hostsend
- the upper bound of the range of virtual hosts (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static VirtualHost findByC_L_First(long companyId, long layoutSetId, OrderByComparator<VirtualHost> orderByComparator) throws NoSuchVirtualHostException
companyId
- the company IDlayoutSetId
- the layout set IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchVirtualHostException
- if a matching virtual host could not be foundpublic static VirtualHost fetchByC_L_First(long companyId, long layoutSetId, OrderByComparator<VirtualHost> orderByComparator)
companyId
- the company IDlayoutSetId
- the layout set IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching virtual host could not be foundpublic static VirtualHost findByC_L_Last(long companyId, long layoutSetId, OrderByComparator<VirtualHost> orderByComparator) throws NoSuchVirtualHostException
companyId
- the company IDlayoutSetId
- the layout set IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchVirtualHostException
- if a matching virtual host could not be foundpublic static VirtualHost fetchByC_L_Last(long companyId, long layoutSetId, OrderByComparator<VirtualHost> orderByComparator)
companyId
- the company IDlayoutSetId
- the layout set IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching virtual host could not be foundpublic static VirtualHost[] findByC_L_PrevAndNext(long virtualHostId, long companyId, long layoutSetId, OrderByComparator<VirtualHost> orderByComparator) throws NoSuchVirtualHostException
virtualHostId
- the primary key of the current virtual hostcompanyId
- the company IDlayoutSetId
- the layout set IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchVirtualHostException
- if a virtual host with the primary key could not be foundpublic static void removeByC_L(long companyId, long layoutSetId)
companyId
- the company IDlayoutSetId
- the layout set IDpublic static int countByC_L(long companyId, long layoutSetId)
companyId
- the company IDlayoutSetId
- the layout set IDpublic static VirtualHost findByC_L_D(long companyId, long layoutSetId, boolean defaultVirtualHost) throws NoSuchVirtualHostException
NoSuchVirtualHostException
if it could not be found.companyId
- the company IDlayoutSetId
- the layout set IDdefaultVirtualHost
- the default virtual hostNoSuchVirtualHostException
- if a matching virtual host could not be foundpublic static VirtualHost fetchByC_L_D(long companyId, long layoutSetId, boolean defaultVirtualHost)
null
if it could not be found. Uses the finder cache.companyId
- the company IDlayoutSetId
- the layout set IDdefaultVirtualHost
- the default virtual hostnull
if a matching virtual host could not be foundpublic static VirtualHost fetchByC_L_D(long companyId, long layoutSetId, boolean defaultVirtualHost, boolean useFinderCache)
null
if it could not be found, optionally using the finder cache.companyId
- the company IDlayoutSetId
- the layout set IDdefaultVirtualHost
- the default virtual hostuseFinderCache
- whether to use the finder cachenull
if a matching virtual host could not be foundpublic static VirtualHost removeByC_L_D(long companyId, long layoutSetId, boolean defaultVirtualHost) throws NoSuchVirtualHostException
companyId
- the company IDlayoutSetId
- the layout set IDdefaultVirtualHost
- the default virtual hostNoSuchVirtualHostException
public static int countByC_L_D(long companyId, long layoutSetId, boolean defaultVirtualHost)
companyId
- the company IDlayoutSetId
- the layout set IDdefaultVirtualHost
- the default virtual hostpublic static void cacheResult(VirtualHost virtualHost)
virtualHost
- the virtual hostpublic static void cacheResult(List<VirtualHost> virtualHosts)
virtualHosts
- the virtual hostspublic static VirtualHost create(long virtualHostId)
virtualHostId
- the primary key for the new virtual hostpublic static VirtualHost remove(long virtualHostId) throws NoSuchVirtualHostException
virtualHostId
- the primary key of the virtual hostNoSuchVirtualHostException
- if a virtual host with the primary key could not be foundpublic static VirtualHost updateImpl(VirtualHost virtualHost)
public static VirtualHost findByPrimaryKey(long virtualHostId) throws NoSuchVirtualHostException
NoSuchVirtualHostException
if it could not be found.virtualHostId
- the primary key of the virtual hostNoSuchVirtualHostException
- if a virtual host with the primary key could not be foundpublic static VirtualHost fetchByPrimaryKey(long virtualHostId)
null
if it could not be found.virtualHostId
- the primary key of the virtual hostnull
if a virtual host with the primary key could not be foundpublic static List<VirtualHost> findAll()
public static List<VirtualHost> findAll(int start, int end)
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, then the query will include the default ORDER BY logic from VirtualHostModelImpl
.
start
- the lower bound of the range of virtual hostsend
- the upper bound of the range of virtual hosts (not inclusive)public static List<VirtualHost> findAll(int start, int end, OrderByComparator<VirtualHost> orderByComparator)
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, then the query will include the default ORDER BY logic from VirtualHostModelImpl
.
start
- the lower bound of the range of virtual hostsend
- the upper bound of the range of virtual hosts (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static List<VirtualHost> findAll(int start, int end, OrderByComparator<VirtualHost> orderByComparator, boolean useFinderCache)
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, then the query will include the default ORDER BY logic from VirtualHostModelImpl
.
start
- the lower bound of the range of virtual hostsend
- the upper bound of the range of virtual hosts (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)useFinderCache
- whether to use the finder cachepublic static void removeAll()
public static int countAll()
public static VirtualHostPersistence getPersistence()