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