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