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