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.PortalPreferences; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the portal preferences service. This utility wraps {@link PortalPreferencesPersistenceImpl} 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 PortalPreferencesPersistence 036 * @see PortalPreferencesPersistenceImpl 037 * @generated 038 */ 039 public class PortalPreferencesUtil { 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(PortalPreferences portalPreferences) { 057 getPersistence().clearCache(portalPreferences); 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<PortalPreferences> 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<PortalPreferences> 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<PortalPreferences> 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 PortalPreferences update(PortalPreferences portalPreferences) 100 throws SystemException { 101 return getPersistence().update(portalPreferences); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static PortalPreferences update( 108 PortalPreferences portalPreferences, ServiceContext serviceContext) 109 throws SystemException { 110 return getPersistence().update(portalPreferences, serviceContext); 111 } 112 113 /** 114 * Returns the portal preferences where ownerId = ? and ownerType = ? or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found. 115 * 116 * @param ownerId the owner ID 117 * @param ownerType the owner type 118 * @return the matching portal preferences 119 * @throws com.liferay.portal.NoSuchPreferencesException if a matching portal preferences could not be found 120 * @throws SystemException if a system exception occurred 121 */ 122 public static com.liferay.portal.model.PortalPreferences findByO_O( 123 long ownerId, int ownerType) 124 throws com.liferay.portal.NoSuchPreferencesException, 125 com.liferay.portal.kernel.exception.SystemException { 126 return getPersistence().findByO_O(ownerId, ownerType); 127 } 128 129 /** 130 * Returns the portal preferences where ownerId = ? and ownerType = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 131 * 132 * @param ownerId the owner ID 133 * @param ownerType the owner type 134 * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found 135 * @throws SystemException if a system exception occurred 136 */ 137 public static com.liferay.portal.model.PortalPreferences fetchByO_O( 138 long ownerId, int ownerType) 139 throws com.liferay.portal.kernel.exception.SystemException { 140 return getPersistence().fetchByO_O(ownerId, ownerType); 141 } 142 143 /** 144 * Returns the portal preferences where ownerId = ? and ownerType = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 145 * 146 * @param ownerId the owner ID 147 * @param ownerType the owner type 148 * @param retrieveFromCache whether to use the finder cache 149 * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found 150 * @throws SystemException if a system exception occurred 151 */ 152 public static com.liferay.portal.model.PortalPreferences fetchByO_O( 153 long ownerId, int ownerType, boolean retrieveFromCache) 154 throws com.liferay.portal.kernel.exception.SystemException { 155 return getPersistence().fetchByO_O(ownerId, ownerType, retrieveFromCache); 156 } 157 158 /** 159 * Removes the portal preferences where ownerId = ? and ownerType = ? from the database. 160 * 161 * @param ownerId the owner ID 162 * @param ownerType the owner type 163 * @return the portal preferences that was removed 164 * @throws SystemException if a system exception occurred 165 */ 166 public static com.liferay.portal.model.PortalPreferences removeByO_O( 167 long ownerId, int ownerType) 168 throws com.liferay.portal.NoSuchPreferencesException, 169 com.liferay.portal.kernel.exception.SystemException { 170 return getPersistence().removeByO_O(ownerId, ownerType); 171 } 172 173 /** 174 * Returns the number of portal preferenceses where ownerId = ? and ownerType = ?. 175 * 176 * @param ownerId the owner ID 177 * @param ownerType the owner type 178 * @return the number of matching portal preferenceses 179 * @throws SystemException if a system exception occurred 180 */ 181 public static int countByO_O(long ownerId, int ownerType) 182 throws com.liferay.portal.kernel.exception.SystemException { 183 return getPersistence().countByO_O(ownerId, ownerType); 184 } 185 186 /** 187 * Caches the portal preferences in the entity cache if it is enabled. 188 * 189 * @param portalPreferences the portal preferences 190 */ 191 public static void cacheResult( 192 com.liferay.portal.model.PortalPreferences portalPreferences) { 193 getPersistence().cacheResult(portalPreferences); 194 } 195 196 /** 197 * Caches the portal preferenceses in the entity cache if it is enabled. 198 * 199 * @param portalPreferenceses the portal preferenceses 200 */ 201 public static void cacheResult( 202 java.util.List<com.liferay.portal.model.PortalPreferences> portalPreferenceses) { 203 getPersistence().cacheResult(portalPreferenceses); 204 } 205 206 /** 207 * Creates a new portal preferences with the primary key. Does not add the portal preferences to the database. 208 * 209 * @param portalPreferencesId the primary key for the new portal preferences 210 * @return the new portal preferences 211 */ 212 public static com.liferay.portal.model.PortalPreferences create( 213 long portalPreferencesId) { 214 return getPersistence().create(portalPreferencesId); 215 } 216 217 /** 218 * Removes the portal preferences with the primary key from the database. Also notifies the appropriate model listeners. 219 * 220 * @param portalPreferencesId the primary key of the portal preferences 221 * @return the portal preferences that was removed 222 * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found 223 * @throws SystemException if a system exception occurred 224 */ 225 public static com.liferay.portal.model.PortalPreferences remove( 226 long portalPreferencesId) 227 throws com.liferay.portal.NoSuchPreferencesException, 228 com.liferay.portal.kernel.exception.SystemException { 229 return getPersistence().remove(portalPreferencesId); 230 } 231 232 public static com.liferay.portal.model.PortalPreferences updateImpl( 233 com.liferay.portal.model.PortalPreferences portalPreferences) 234 throws com.liferay.portal.kernel.exception.SystemException { 235 return getPersistence().updateImpl(portalPreferences); 236 } 237 238 /** 239 * Returns the portal preferences with the primary key or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found. 240 * 241 * @param portalPreferencesId the primary key of the portal preferences 242 * @return the portal preferences 243 * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found 244 * @throws SystemException if a system exception occurred 245 */ 246 public static com.liferay.portal.model.PortalPreferences findByPrimaryKey( 247 long portalPreferencesId) 248 throws com.liferay.portal.NoSuchPreferencesException, 249 com.liferay.portal.kernel.exception.SystemException { 250 return getPersistence().findByPrimaryKey(portalPreferencesId); 251 } 252 253 /** 254 * Returns the portal preferences with the primary key or returns <code>null</code> if it could not be found. 255 * 256 * @param portalPreferencesId the primary key of the portal preferences 257 * @return the portal preferences, or <code>null</code> if a portal preferences with the primary key could not be found 258 * @throws SystemException if a system exception occurred 259 */ 260 public static com.liferay.portal.model.PortalPreferences fetchByPrimaryKey( 261 long portalPreferencesId) 262 throws com.liferay.portal.kernel.exception.SystemException { 263 return getPersistence().fetchByPrimaryKey(portalPreferencesId); 264 } 265 266 /** 267 * Returns all the portal preferenceses. 268 * 269 * @return the portal preferenceses 270 * @throws SystemException if a system exception occurred 271 */ 272 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll() 273 throws com.liferay.portal.kernel.exception.SystemException { 274 return getPersistence().findAll(); 275 } 276 277 /** 278 * Returns a range of all the portal preferenceses. 279 * 280 * <p> 281 * 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.PortalPreferencesModelImpl}. 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. 282 * </p> 283 * 284 * @param start the lower bound of the range of portal preferenceses 285 * @param end the upper bound of the range of portal preferenceses (not inclusive) 286 * @return the range of portal preferenceses 287 * @throws SystemException if a system exception occurred 288 */ 289 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll( 290 int start, int end) 291 throws com.liferay.portal.kernel.exception.SystemException { 292 return getPersistence().findAll(start, end); 293 } 294 295 /** 296 * Returns an ordered range of all the portal preferenceses. 297 * 298 * <p> 299 * 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.PortalPreferencesModelImpl}. 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. 300 * </p> 301 * 302 * @param start the lower bound of the range of portal preferenceses 303 * @param end the upper bound of the range of portal preferenceses (not inclusive) 304 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 305 * @return the ordered range of portal preferenceses 306 * @throws SystemException if a system exception occurred 307 */ 308 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll( 309 int start, int end, 310 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 311 throws com.liferay.portal.kernel.exception.SystemException { 312 return getPersistence().findAll(start, end, orderByComparator); 313 } 314 315 /** 316 * Removes all the portal preferenceses from the database. 317 * 318 * @throws SystemException if a system exception occurred 319 */ 320 public static void removeAll() 321 throws com.liferay.portal.kernel.exception.SystemException { 322 getPersistence().removeAll(); 323 } 324 325 /** 326 * Returns the number of portal preferenceses. 327 * 328 * @return the number of portal preferenceses 329 * @throws SystemException if a system exception occurred 330 */ 331 public static int countAll() 332 throws com.liferay.portal.kernel.exception.SystemException { 333 return getPersistence().countAll(); 334 } 335 336 public static PortalPreferencesPersistence getPersistence() { 337 if (_persistence == null) { 338 _persistence = (PortalPreferencesPersistence)PortalBeanLocatorUtil.locate(PortalPreferencesPersistence.class.getName()); 339 340 ReferenceRegistry.registerReference(PortalPreferencesUtil.class, 341 "_persistence"); 342 } 343 344 return _persistence; 345 } 346 347 /** 348 * @deprecated 349 */ 350 public void setPersistence(PortalPreferencesPersistence persistence) { 351 } 352 353 private static PortalPreferencesPersistence _persistence; 354 }