001 /** 002 * Copyright (c) 2000-2011 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#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 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 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 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 * Returns 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 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 * Returns 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 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 * Returns the virtual host where hostname = ? or throws a {@link com.liferay.portal.NoSuchVirtualHostException} if it could not be found. 202 * 203 * @param hostname the hostname 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 * Returns the virtual host where hostname = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 217 * 218 * @param hostname the hostname 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 * Returns the virtual host where hostname = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 230 * 231 * @param hostname the hostname 232 * @param retrieveFromCache whether to use the finder cache 233 * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found 234 * @throws SystemException if a system exception occurred 235 */ 236 public static com.liferay.portal.model.VirtualHost fetchByHostname( 237 java.lang.String hostname, boolean retrieveFromCache) 238 throws com.liferay.portal.kernel.exception.SystemException { 239 return getPersistence().fetchByHostname(hostname, retrieveFromCache); 240 } 241 242 /** 243 * Returns the virtual host where companyId = ? and layoutSetId = ? or throws a {@link com.liferay.portal.NoSuchVirtualHostException} if it could not be found. 244 * 245 * @param companyId the company ID 246 * @param layoutSetId the layout set ID 247 * @return the matching virtual host 248 * @throws com.liferay.portal.NoSuchVirtualHostException if a matching virtual host could not be found 249 * @throws SystemException if a system exception occurred 250 */ 251 public static com.liferay.portal.model.VirtualHost findByC_L( 252 long companyId, long layoutSetId) 253 throws com.liferay.portal.NoSuchVirtualHostException, 254 com.liferay.portal.kernel.exception.SystemException { 255 return getPersistence().findByC_L(companyId, layoutSetId); 256 } 257 258 /** 259 * Returns the virtual host where companyId = ? and layoutSetId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 260 * 261 * @param companyId the company ID 262 * @param layoutSetId the layout set ID 263 * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found 264 * @throws SystemException if a system exception occurred 265 */ 266 public static com.liferay.portal.model.VirtualHost fetchByC_L( 267 long companyId, long layoutSetId) 268 throws com.liferay.portal.kernel.exception.SystemException { 269 return getPersistence().fetchByC_L(companyId, layoutSetId); 270 } 271 272 /** 273 * Returns the virtual host where companyId = ? and layoutSetId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 274 * 275 * @param companyId the company ID 276 * @param layoutSetId the layout set ID 277 * @param retrieveFromCache whether to use the finder cache 278 * @return the matching virtual host, or <code>null</code> if a matching virtual host could not be found 279 * @throws SystemException if a system exception occurred 280 */ 281 public static com.liferay.portal.model.VirtualHost fetchByC_L( 282 long companyId, long layoutSetId, boolean retrieveFromCache) 283 throws com.liferay.portal.kernel.exception.SystemException { 284 return getPersistence() 285 .fetchByC_L(companyId, layoutSetId, retrieveFromCache); 286 } 287 288 /** 289 * Returns all the virtual hosts. 290 * 291 * @return the virtual hosts 292 * @throws SystemException if a system exception occurred 293 */ 294 public static java.util.List<com.liferay.portal.model.VirtualHost> findAll() 295 throws com.liferay.portal.kernel.exception.SystemException { 296 return getPersistence().findAll(); 297 } 298 299 /** 300 * Returns a range of all the virtual hosts. 301 * 302 * <p> 303 * 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. 304 * </p> 305 * 306 * @param start the lower bound of the range of virtual hosts 307 * @param end the upper bound of the range of virtual hosts (not inclusive) 308 * @return the range of virtual hosts 309 * @throws SystemException if a system exception occurred 310 */ 311 public static java.util.List<com.liferay.portal.model.VirtualHost> findAll( 312 int start, int end) 313 throws com.liferay.portal.kernel.exception.SystemException { 314 return getPersistence().findAll(start, end); 315 } 316 317 /** 318 * Returns an ordered range of all the virtual hosts. 319 * 320 * <p> 321 * 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. 322 * </p> 323 * 324 * @param start the lower bound of the range of virtual hosts 325 * @param end the upper bound of the range of virtual hosts (not inclusive) 326 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 327 * @return the ordered range of virtual hosts 328 * @throws SystemException if a system exception occurred 329 */ 330 public static java.util.List<com.liferay.portal.model.VirtualHost> findAll( 331 int start, int end, 332 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 333 throws com.liferay.portal.kernel.exception.SystemException { 334 return getPersistence().findAll(start, end, orderByComparator); 335 } 336 337 /** 338 * Removes the virtual host where hostname = ? from the database. 339 * 340 * @param hostname the hostname 341 * @throws SystemException if a system exception occurred 342 */ 343 public static void removeByHostname(java.lang.String hostname) 344 throws com.liferay.portal.NoSuchVirtualHostException, 345 com.liferay.portal.kernel.exception.SystemException { 346 getPersistence().removeByHostname(hostname); 347 } 348 349 /** 350 * Removes the virtual host where companyId = ? and layoutSetId = ? from the database. 351 * 352 * @param companyId the company ID 353 * @param layoutSetId the layout set ID 354 * @throws SystemException if a system exception occurred 355 */ 356 public static void removeByC_L(long companyId, long layoutSetId) 357 throws com.liferay.portal.NoSuchVirtualHostException, 358 com.liferay.portal.kernel.exception.SystemException { 359 getPersistence().removeByC_L(companyId, layoutSetId); 360 } 361 362 /** 363 * Removes all the virtual hosts from the database. 364 * 365 * @throws SystemException if a system exception occurred 366 */ 367 public static void removeAll() 368 throws com.liferay.portal.kernel.exception.SystemException { 369 getPersistence().removeAll(); 370 } 371 372 /** 373 * Returns the number of virtual hosts where hostname = ?. 374 * 375 * @param hostname the hostname 376 * @return the number of matching virtual hosts 377 * @throws SystemException if a system exception occurred 378 */ 379 public static int countByHostname(java.lang.String hostname) 380 throws com.liferay.portal.kernel.exception.SystemException { 381 return getPersistence().countByHostname(hostname); 382 } 383 384 /** 385 * Returns the number of virtual hosts where companyId = ? and layoutSetId = ?. 386 * 387 * @param companyId the company ID 388 * @param layoutSetId the layout set ID 389 * @return the number of matching virtual hosts 390 * @throws SystemException if a system exception occurred 391 */ 392 public static int countByC_L(long companyId, long layoutSetId) 393 throws com.liferay.portal.kernel.exception.SystemException { 394 return getPersistence().countByC_L(companyId, layoutSetId); 395 } 396 397 /** 398 * Returns the number of virtual hosts. 399 * 400 * @return the number of virtual hosts 401 * @throws SystemException if a system exception occurred 402 */ 403 public static int countAll() 404 throws com.liferay.portal.kernel.exception.SystemException { 405 return getPersistence().countAll(); 406 } 407 408 public static VirtualHostPersistence getPersistence() { 409 if (_persistence == null) { 410 _persistence = (VirtualHostPersistence)PortalBeanLocatorUtil.locate(VirtualHostPersistence.class.getName()); 411 412 ReferenceRegistry.registerReference(VirtualHostUtil.class, 413 "_persistence"); 414 } 415 416 return _persistence; 417 } 418 419 public void setPersistence(VirtualHostPersistence persistence) { 420 _persistence = persistence; 421 422 ReferenceRegistry.registerReference(VirtualHostUtil.class, 423 "_persistence"); 424 } 425 426 private static VirtualHostPersistence _persistence; 427 }