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 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 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 com.liferay.portal.NoSuchVirtualHostException} if it could not be found.
113            *
114            * @param hostname the hostname
115            * @return the matching virtual host
116            * @throws com.liferay.portal.NoSuchVirtualHostException if a matching virtual host could not be found
117            */
118            public static com.liferay.portal.model.VirtualHost findByHostname(
119                    java.lang.String hostname)
120                    throws com.liferay.portal.NoSuchVirtualHostException {
121                    return getPersistence().findByHostname(hostname);
122            }
123    
124            /**
125            * Returns the virtual host where hostname = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
126            *
127            * @param hostname the hostname
128            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
129            */
130            public static com.liferay.portal.model.VirtualHost fetchByHostname(
131                    java.lang.String hostname) {
132                    return getPersistence().fetchByHostname(hostname);
133            }
134    
135            /**
136            * Returns the virtual host where hostname = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
137            *
138            * @param hostname the hostname
139            * @param retrieveFromCache whether to use the finder cache
140            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
141            */
142            public static com.liferay.portal.model.VirtualHost fetchByHostname(
143                    java.lang.String hostname, boolean retrieveFromCache) {
144                    return getPersistence().fetchByHostname(hostname, retrieveFromCache);
145            }
146    
147            /**
148            * Removes the virtual host where hostname = &#63; from the database.
149            *
150            * @param hostname the hostname
151            * @return the virtual host that was removed
152            */
153            public static com.liferay.portal.model.VirtualHost removeByHostname(
154                    java.lang.String hostname)
155                    throws com.liferay.portal.NoSuchVirtualHostException {
156                    return getPersistence().removeByHostname(hostname);
157            }
158    
159            /**
160            * Returns the number of virtual hosts where hostname = &#63;.
161            *
162            * @param hostname the hostname
163            * @return the number of matching virtual hosts
164            */
165            public static int countByHostname(java.lang.String hostname) {
166                    return getPersistence().countByHostname(hostname);
167            }
168    
169            /**
170            * Returns the virtual host where companyId = &#63; and layoutSetId = &#63; or throws a {@link com.liferay.portal.NoSuchVirtualHostException} if it could not be found.
171            *
172            * @param companyId the company ID
173            * @param layoutSetId the layout set ID
174            * @return the matching virtual host
175            * @throws com.liferay.portal.NoSuchVirtualHostException if a matching virtual host could not be found
176            */
177            public static com.liferay.portal.model.VirtualHost findByC_L(
178                    long companyId, long layoutSetId)
179                    throws com.liferay.portal.NoSuchVirtualHostException {
180                    return getPersistence().findByC_L(companyId, layoutSetId);
181            }
182    
183            /**
184            * 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.
185            *
186            * @param companyId the company ID
187            * @param layoutSetId the layout set ID
188            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
189            */
190            public static com.liferay.portal.model.VirtualHost fetchByC_L(
191                    long companyId, long layoutSetId) {
192                    return getPersistence().fetchByC_L(companyId, layoutSetId);
193            }
194    
195            /**
196            * 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.
197            *
198            * @param companyId the company ID
199            * @param layoutSetId the layout set ID
200            * @param retrieveFromCache whether to use the finder cache
201            * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found
202            */
203            public static com.liferay.portal.model.VirtualHost fetchByC_L(
204                    long companyId, long layoutSetId, boolean retrieveFromCache) {
205                    return getPersistence()
206                                       .fetchByC_L(companyId, layoutSetId, retrieveFromCache);
207            }
208    
209            /**
210            * Removes the virtual host where companyId = &#63; and layoutSetId = &#63; from the database.
211            *
212            * @param companyId the company ID
213            * @param layoutSetId the layout set ID
214            * @return the virtual host that was removed
215            */
216            public static com.liferay.portal.model.VirtualHost removeByC_L(
217                    long companyId, long layoutSetId)
218                    throws com.liferay.portal.NoSuchVirtualHostException {
219                    return getPersistence().removeByC_L(companyId, layoutSetId);
220            }
221    
222            /**
223            * Returns the number of virtual hosts where companyId = &#63; and layoutSetId = &#63;.
224            *
225            * @param companyId the company ID
226            * @param layoutSetId the layout set ID
227            * @return the number of matching virtual hosts
228            */
229            public static int countByC_L(long companyId, long layoutSetId) {
230                    return getPersistence().countByC_L(companyId, layoutSetId);
231            }
232    
233            /**
234            * Caches the virtual host in the entity cache if it is enabled.
235            *
236            * @param virtualHost the virtual host
237            */
238            public static void cacheResult(
239                    com.liferay.portal.model.VirtualHost virtualHost) {
240                    getPersistence().cacheResult(virtualHost);
241            }
242    
243            /**
244            * Caches the virtual hosts in the entity cache if it is enabled.
245            *
246            * @param virtualHosts the virtual hosts
247            */
248            public static void cacheResult(
249                    java.util.List<com.liferay.portal.model.VirtualHost> virtualHosts) {
250                    getPersistence().cacheResult(virtualHosts);
251            }
252    
253            /**
254            * Creates a new virtual host with the primary key. Does not add the virtual host to the database.
255            *
256            * @param virtualHostId the primary key for the new virtual host
257            * @return the new virtual host
258            */
259            public static com.liferay.portal.model.VirtualHost create(
260                    long virtualHostId) {
261                    return getPersistence().create(virtualHostId);
262            }
263    
264            /**
265            * Removes the virtual host with the primary key from the database. Also notifies the appropriate model listeners.
266            *
267            * @param virtualHostId the primary key of the virtual host
268            * @return the virtual host that was removed
269            * @throws com.liferay.portal.NoSuchVirtualHostException if a virtual host with the primary key could not be found
270            */
271            public static com.liferay.portal.model.VirtualHost remove(
272                    long virtualHostId)
273                    throws com.liferay.portal.NoSuchVirtualHostException {
274                    return getPersistence().remove(virtualHostId);
275            }
276    
277            public static com.liferay.portal.model.VirtualHost updateImpl(
278                    com.liferay.portal.model.VirtualHost virtualHost) {
279                    return getPersistence().updateImpl(virtualHost);
280            }
281    
282            /**
283            * Returns the virtual host with the primary key or throws a {@link com.liferay.portal.NoSuchVirtualHostException} if it could not be found.
284            *
285            * @param virtualHostId the primary key of the virtual host
286            * @return the virtual host
287            * @throws com.liferay.portal.NoSuchVirtualHostException if a virtual host with the primary key could not be found
288            */
289            public static com.liferay.portal.model.VirtualHost findByPrimaryKey(
290                    long virtualHostId)
291                    throws com.liferay.portal.NoSuchVirtualHostException {
292                    return getPersistence().findByPrimaryKey(virtualHostId);
293            }
294    
295            /**
296            * Returns the virtual host with the primary key or returns <code>null</code> if it could not be found.
297            *
298            * @param virtualHostId the primary key of the virtual host
299            * @return the virtual host, or <code>null</code> if a virtual host with the primary key could not be found
300            */
301            public static com.liferay.portal.model.VirtualHost fetchByPrimaryKey(
302                    long virtualHostId) {
303                    return getPersistence().fetchByPrimaryKey(virtualHostId);
304            }
305    
306            public static java.util.Map<java.io.Serializable, com.liferay.portal.model.VirtualHost> fetchByPrimaryKeys(
307                    java.util.Set<java.io.Serializable> primaryKeys) {
308                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
309            }
310    
311            /**
312            * Returns all the virtual hosts.
313            *
314            * @return the virtual hosts
315            */
316            public static java.util.List<com.liferay.portal.model.VirtualHost> findAll() {
317                    return getPersistence().findAll();
318            }
319    
320            /**
321            * Returns a range of all the virtual hosts.
322            *
323            * <p>
324            * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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.
325            * </p>
326            *
327            * @param start the lower bound of the range of virtual hosts
328            * @param end the upper bound of the range of virtual hosts (not inclusive)
329            * @return the range of virtual hosts
330            */
331            public static java.util.List<com.liferay.portal.model.VirtualHost> findAll(
332                    int start, int end) {
333                    return getPersistence().findAll(start, end);
334            }
335    
336            /**
337            * Returns an ordered range of all the virtual hosts.
338            *
339            * <p>
340            * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.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.
341            * </p>
342            *
343            * @param start the lower bound of the range of virtual hosts
344            * @param end the upper bound of the range of virtual hosts (not inclusive)
345            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
346            * @return the ordered range of virtual hosts
347            */
348            public static java.util.List<com.liferay.portal.model.VirtualHost> findAll(
349                    int start, int end,
350                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.VirtualHost> orderByComparator) {
351                    return getPersistence().findAll(start, end, orderByComparator);
352            }
353    
354            /**
355            * Removes all the virtual hosts from the database.
356            */
357            public static void removeAll() {
358                    getPersistence().removeAll();
359            }
360    
361            /**
362            * Returns the number of virtual hosts.
363            *
364            * @return the number of virtual hosts
365            */
366            public static int countAll() {
367                    return getPersistence().countAll();
368            }
369    
370            public static VirtualHostPersistence getPersistence() {
371                    if (_persistence == null) {
372                            _persistence = (VirtualHostPersistence)PortalBeanLocatorUtil.locate(VirtualHostPersistence.class.getName());
373    
374                            ReferenceRegistry.registerReference(VirtualHostUtil.class,
375                                    "_persistence");
376                    }
377    
378                    return _persistence;
379            }
380    
381            /**
382             * @deprecated As of 6.2.0
383             */
384            @Deprecated
385            public void setPersistence(VirtualHostPersistence persistence) {
386            }
387    
388            private static VirtualHostPersistence _persistence;
389    }