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