001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.model.VirtualHost;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the virtual host service. This utility wraps {@link 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.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see VirtualHostPersistence
037     * @see com.liferay.portal.service.persistence.impl.VirtualHostPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class VirtualHostUtil {
042            /*
043             * NOTE FOR DEVELOPERS:
044             *
045             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
046             */
047    
048            /**
049             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
050             */
051            public static void clearCache() {
052                    getPersistence().clearCache();
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
057             */
058            public static void clearCache(VirtualHost virtualHost) {
059                    getPersistence().clearCache(virtualHost);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
064             */
065            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<VirtualHost> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<VirtualHost> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end) {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<VirtualHost> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator<VirtualHost> orderByComparator) {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
098             */
099            public static VirtualHost update(VirtualHost virtualHost) {
100                    return getPersistence().update(virtualHost);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static VirtualHost update(VirtualHost virtualHost,
107                    ServiceContext serviceContext) {
108                    return getPersistence().update(virtualHost, serviceContext);
109            }
110    
111            /**
112            * Returns the virtual host where hostname = &#63; or throws a {@link NoSuchVirtualHostException} if it could not be found.
113            *
114            * @param hostname the hostname
115            * @return the matching virtual host
116            * @throws NoSuchVirtualHostException if a matching virtual host could not be found
117            */
118            public static VirtualHost findByHostname(java.lang.String hostname)
119                    throws com.liferay.portal.exception.NoSuchVirtualHostException {
120                    return getPersistence().findByHostname(hostname);
121            }
122    
123            /**
124            * Returns the virtual host where hostname = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
125            *
126            * @param hostname the hostname
127            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
128            */
129            public static VirtualHost fetchByHostname(java.lang.String hostname) {
130                    return getPersistence().fetchByHostname(hostname);
131            }
132    
133            /**
134            * Returns the virtual host where hostname = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
135            *
136            * @param hostname the hostname
137            * @param retrieveFromCache whether to retrieve from the finder cache
138            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
139            */
140            public static VirtualHost fetchByHostname(java.lang.String hostname,
141                    boolean retrieveFromCache) {
142                    return getPersistence().fetchByHostname(hostname, retrieveFromCache);
143            }
144    
145            /**
146            * Removes the virtual host where hostname = &#63; from the database.
147            *
148            * @param hostname the hostname
149            * @return the virtual host that was removed
150            */
151            public static VirtualHost removeByHostname(java.lang.String hostname)
152                    throws com.liferay.portal.exception.NoSuchVirtualHostException {
153                    return getPersistence().removeByHostname(hostname);
154            }
155    
156            /**
157            * Returns the number of virtual hosts where hostname = &#63;.
158            *
159            * @param hostname the hostname
160            * @return the number of matching virtual hosts
161            */
162            public static int countByHostname(java.lang.String hostname) {
163                    return getPersistence().countByHostname(hostname);
164            }
165    
166            /**
167            * Returns the virtual host where companyId = &#63; and layoutSetId = &#63; or throws a {@link NoSuchVirtualHostException} if it could not be found.
168            *
169            * @param companyId the company ID
170            * @param layoutSetId the layout set ID
171            * @return the matching virtual host
172            * @throws NoSuchVirtualHostException if a matching virtual host could not be found
173            */
174            public static VirtualHost findByC_L(long companyId, long layoutSetId)
175                    throws com.liferay.portal.exception.NoSuchVirtualHostException {
176                    return getPersistence().findByC_L(companyId, layoutSetId);
177            }
178    
179            /**
180            * Returns the virtual host where companyId = &#63; and layoutSetId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
181            *
182            * @param companyId the company ID
183            * @param layoutSetId the layout set ID
184            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
185            */
186            public static VirtualHost fetchByC_L(long companyId, long layoutSetId) {
187                    return getPersistence().fetchByC_L(companyId, layoutSetId);
188            }
189    
190            /**
191            * Returns the virtual host where companyId = &#63; and layoutSetId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
192            *
193            * @param companyId the company ID
194            * @param layoutSetId the layout set ID
195            * @param retrieveFromCache whether to retrieve from the finder cache
196            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
197            */
198            public static VirtualHost fetchByC_L(long companyId, long layoutSetId,
199                    boolean retrieveFromCache) {
200                    return getPersistence()
201                                       .fetchByC_L(companyId, layoutSetId, retrieveFromCache);
202            }
203    
204            /**
205            * Removes the virtual host where companyId = &#63; and layoutSetId = &#63; from the database.
206            *
207            * @param companyId the company ID
208            * @param layoutSetId the layout set ID
209            * @return the virtual host that was removed
210            */
211            public static VirtualHost removeByC_L(long companyId, long layoutSetId)
212                    throws com.liferay.portal.exception.NoSuchVirtualHostException {
213                    return getPersistence().removeByC_L(companyId, layoutSetId);
214            }
215    
216            /**
217            * Returns the number of virtual hosts where companyId = &#63; and layoutSetId = &#63;.
218            *
219            * @param companyId the company ID
220            * @param layoutSetId the layout set ID
221            * @return the number of matching virtual hosts
222            */
223            public static int countByC_L(long companyId, long layoutSetId) {
224                    return getPersistence().countByC_L(companyId, layoutSetId);
225            }
226    
227            /**
228            * Caches the virtual host in the entity cache if it is enabled.
229            *
230            * @param virtualHost the virtual host
231            */
232            public static void cacheResult(VirtualHost virtualHost) {
233                    getPersistence().cacheResult(virtualHost);
234            }
235    
236            /**
237            * Caches the virtual hosts in the entity cache if it is enabled.
238            *
239            * @param virtualHosts the virtual hosts
240            */
241            public static void cacheResult(List<VirtualHost> virtualHosts) {
242                    getPersistence().cacheResult(virtualHosts);
243            }
244    
245            /**
246            * Creates a new virtual host with the primary key. Does not add the virtual host to the database.
247            *
248            * @param virtualHostId the primary key for the new virtual host
249            * @return the new virtual host
250            */
251            public static VirtualHost create(long virtualHostId) {
252                    return getPersistence().create(virtualHostId);
253            }
254    
255            /**
256            * Removes the virtual host with the primary key from the database. Also notifies the appropriate model listeners.
257            *
258            * @param virtualHostId the primary key of the virtual host
259            * @return the virtual host that was removed
260            * @throws NoSuchVirtualHostException if a virtual host with the primary key could not be found
261            */
262            public static VirtualHost remove(long virtualHostId)
263                    throws com.liferay.portal.exception.NoSuchVirtualHostException {
264                    return getPersistence().remove(virtualHostId);
265            }
266    
267            public static VirtualHost updateImpl(VirtualHost virtualHost) {
268                    return getPersistence().updateImpl(virtualHost);
269            }
270    
271            /**
272            * Returns the virtual host with the primary key or throws a {@link NoSuchVirtualHostException} if it could not be found.
273            *
274            * @param virtualHostId the primary key of the virtual host
275            * @return the virtual host
276            * @throws NoSuchVirtualHostException if a virtual host with the primary key could not be found
277            */
278            public static VirtualHost findByPrimaryKey(long virtualHostId)
279                    throws com.liferay.portal.exception.NoSuchVirtualHostException {
280                    return getPersistence().findByPrimaryKey(virtualHostId);
281            }
282    
283            /**
284            * Returns the virtual host with the primary key or returns <code>null</code> if it could not be found.
285            *
286            * @param virtualHostId the primary key of the virtual host
287            * @return the virtual host, or <code>null</code> if a virtual host with the primary key could not be found
288            */
289            public static VirtualHost fetchByPrimaryKey(long virtualHostId) {
290                    return getPersistence().fetchByPrimaryKey(virtualHostId);
291            }
292    
293            public static java.util.Map<java.io.Serializable, VirtualHost> fetchByPrimaryKeys(
294                    java.util.Set<java.io.Serializable> primaryKeys) {
295                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
296            }
297    
298            /**
299            * Returns all the virtual hosts.
300            *
301            * @return the virtual hosts
302            */
303            public static List<VirtualHost> findAll() {
304                    return getPersistence().findAll();
305            }
306    
307            /**
308            * Returns a range of all the virtual hosts.
309            *
310            * <p>
311            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link VirtualHostModelImpl}. If both <code>orderByComparator</code> 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.
312            * </p>
313            *
314            * @param start the lower bound of the range of virtual hosts
315            * @param end the upper bound of the range of virtual hosts (not inclusive)
316            * @return the range of virtual hosts
317            */
318            public static List<VirtualHost> findAll(int start, int end) {
319                    return getPersistence().findAll(start, end);
320            }
321    
322            /**
323            * Returns an ordered range of all the virtual hosts.
324            *
325            * <p>
326            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link VirtualHostModelImpl}. If both <code>orderByComparator</code> 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.
327            * </p>
328            *
329            * @param start the lower bound of the range of virtual hosts
330            * @param end the upper bound of the range of virtual hosts (not inclusive)
331            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
332            * @return the ordered range of virtual hosts
333            */
334            public static List<VirtualHost> findAll(int start, int end,
335                    OrderByComparator<VirtualHost> orderByComparator) {
336                    return getPersistence().findAll(start, end, orderByComparator);
337            }
338    
339            /**
340            * Returns an ordered range of all the virtual hosts.
341            *
342            * <p>
343            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link VirtualHostModelImpl}. If both <code>orderByComparator</code> 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.
344            * </p>
345            *
346            * @param start the lower bound of the range of virtual hosts
347            * @param end the upper bound of the range of virtual hosts (not inclusive)
348            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
349            * @param retrieveFromCache whether to retrieve from the finder cache
350            * @return the ordered range of virtual hosts
351            */
352            public static List<VirtualHost> findAll(int start, int end,
353                    OrderByComparator<VirtualHost> orderByComparator,
354                    boolean retrieveFromCache) {
355                    return getPersistence()
356                                       .findAll(start, end, orderByComparator, retrieveFromCache);
357            }
358    
359            /**
360            * Removes all the virtual hosts from the database.
361            */
362            public static void removeAll() {
363                    getPersistence().removeAll();
364            }
365    
366            /**
367            * Returns the number of virtual hosts.
368            *
369            * @return the number of virtual hosts
370            */
371            public static int countAll() {
372                    return getPersistence().countAll();
373            }
374    
375            public static VirtualHostPersistence getPersistence() {
376                    if (_persistence == null) {
377                            _persistence = (VirtualHostPersistence)PortalBeanLocatorUtil.locate(VirtualHostPersistence.class.getName());
378    
379                            ReferenceRegistry.registerReference(VirtualHostUtil.class,
380                                    "_persistence");
381                    }
382    
383                    return _persistence;
384            }
385    
386            private static VirtualHostPersistence _persistence;
387    }