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 * Caches the portal preferences in the entity cache if it is enabled. 115 * 116 * @param portalPreferences the portal preferences 117 */ 118 public static void cacheResult( 119 com.liferay.portal.model.PortalPreferences portalPreferences) { 120 getPersistence().cacheResult(portalPreferences); 121 } 122 123 /** 124 * Caches the portal preferenceses in the entity cache if it is enabled. 125 * 126 * @param portalPreferenceses the portal preferenceses 127 */ 128 public static void cacheResult( 129 java.util.List<com.liferay.portal.model.PortalPreferences> portalPreferenceses) { 130 getPersistence().cacheResult(portalPreferenceses); 131 } 132 133 /** 134 * Creates a new portal preferences with the primary key. Does not add the portal preferences to the database. 135 * 136 * @param portalPreferencesId the primary key for the new portal preferences 137 * @return the new portal preferences 138 */ 139 public static com.liferay.portal.model.PortalPreferences create( 140 long portalPreferencesId) { 141 return getPersistence().create(portalPreferencesId); 142 } 143 144 /** 145 * Removes the portal preferences with the primary key from the database. Also notifies the appropriate model listeners. 146 * 147 * @param portalPreferencesId the primary key of the portal preferences 148 * @return the portal preferences that was removed 149 * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found 150 * @throws SystemException if a system exception occurred 151 */ 152 public static com.liferay.portal.model.PortalPreferences remove( 153 long portalPreferencesId) 154 throws com.liferay.portal.NoSuchPreferencesException, 155 com.liferay.portal.kernel.exception.SystemException { 156 return getPersistence().remove(portalPreferencesId); 157 } 158 159 public static com.liferay.portal.model.PortalPreferences updateImpl( 160 com.liferay.portal.model.PortalPreferences portalPreferences) 161 throws com.liferay.portal.kernel.exception.SystemException { 162 return getPersistence().updateImpl(portalPreferences); 163 } 164 165 /** 166 * Returns the portal preferences with the primary key or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found. 167 * 168 * @param portalPreferencesId the primary key of the portal preferences 169 * @return the portal preferences 170 * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found 171 * @throws SystemException if a system exception occurred 172 */ 173 public static com.liferay.portal.model.PortalPreferences findByPrimaryKey( 174 long portalPreferencesId) 175 throws com.liferay.portal.NoSuchPreferencesException, 176 com.liferay.portal.kernel.exception.SystemException { 177 return getPersistence().findByPrimaryKey(portalPreferencesId); 178 } 179 180 /** 181 * Returns the portal preferences with the primary key or returns <code>null</code> if it could not be found. 182 * 183 * @param portalPreferencesId the primary key of the portal preferences 184 * @return the portal preferences, or <code>null</code> if a portal preferences with the primary key could not be found 185 * @throws SystemException if a system exception occurred 186 */ 187 public static com.liferay.portal.model.PortalPreferences fetchByPrimaryKey( 188 long portalPreferencesId) 189 throws com.liferay.portal.kernel.exception.SystemException { 190 return getPersistence().fetchByPrimaryKey(portalPreferencesId); 191 } 192 193 /** 194 * Returns the portal preferences where ownerId = ? and ownerType = ? or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found. 195 * 196 * @param ownerId the owner ID 197 * @param ownerType the owner type 198 * @return the matching portal preferences 199 * @throws com.liferay.portal.NoSuchPreferencesException if a matching portal preferences could not be found 200 * @throws SystemException if a system exception occurred 201 */ 202 public static com.liferay.portal.model.PortalPreferences findByO_O( 203 long ownerId, int ownerType) 204 throws com.liferay.portal.NoSuchPreferencesException, 205 com.liferay.portal.kernel.exception.SystemException { 206 return getPersistence().findByO_O(ownerId, ownerType); 207 } 208 209 /** 210 * Returns the portal preferences where ownerId = ? and ownerType = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 211 * 212 * @param ownerId the owner ID 213 * @param ownerType the owner type 214 * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found 215 * @throws SystemException if a system exception occurred 216 */ 217 public static com.liferay.portal.model.PortalPreferences fetchByO_O( 218 long ownerId, int ownerType) 219 throws com.liferay.portal.kernel.exception.SystemException { 220 return getPersistence().fetchByO_O(ownerId, ownerType); 221 } 222 223 /** 224 * Returns the portal preferences where ownerId = ? and ownerType = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 225 * 226 * @param ownerId the owner ID 227 * @param ownerType the owner type 228 * @param retrieveFromCache whether to use the finder cache 229 * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found 230 * @throws SystemException if a system exception occurred 231 */ 232 public static com.liferay.portal.model.PortalPreferences fetchByO_O( 233 long ownerId, int ownerType, boolean retrieveFromCache) 234 throws com.liferay.portal.kernel.exception.SystemException { 235 return getPersistence().fetchByO_O(ownerId, ownerType, retrieveFromCache); 236 } 237 238 /** 239 * Returns all the portal preferenceses. 240 * 241 * @return the portal preferenceses 242 * @throws SystemException if a system exception occurred 243 */ 244 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll() 245 throws com.liferay.portal.kernel.exception.SystemException { 246 return getPersistence().findAll(); 247 } 248 249 /** 250 * Returns a range of all the portal preferenceses. 251 * 252 * <p> 253 * 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. 254 * </p> 255 * 256 * @param start the lower bound of the range of portal preferenceses 257 * @param end the upper bound of the range of portal preferenceses (not inclusive) 258 * @return the range of portal preferenceses 259 * @throws SystemException if a system exception occurred 260 */ 261 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll( 262 int start, int end) 263 throws com.liferay.portal.kernel.exception.SystemException { 264 return getPersistence().findAll(start, end); 265 } 266 267 /** 268 * Returns an ordered range of all the portal preferenceses. 269 * 270 * <p> 271 * 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. 272 * </p> 273 * 274 * @param start the lower bound of the range of portal preferenceses 275 * @param end the upper bound of the range of portal preferenceses (not inclusive) 276 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 277 * @return the ordered range of portal preferenceses 278 * @throws SystemException if a system exception occurred 279 */ 280 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll( 281 int start, int end, 282 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 283 throws com.liferay.portal.kernel.exception.SystemException { 284 return getPersistence().findAll(start, end, orderByComparator); 285 } 286 287 /** 288 * Removes the portal preferences where ownerId = ? and ownerType = ? from the database. 289 * 290 * @param ownerId the owner ID 291 * @param ownerType the owner type 292 * @return the portal preferences that was removed 293 * @throws SystemException if a system exception occurred 294 */ 295 public static com.liferay.portal.model.PortalPreferences removeByO_O( 296 long ownerId, int ownerType) 297 throws com.liferay.portal.NoSuchPreferencesException, 298 com.liferay.portal.kernel.exception.SystemException { 299 return getPersistence().removeByO_O(ownerId, ownerType); 300 } 301 302 /** 303 * Removes all the portal preferenceses from the database. 304 * 305 * @throws SystemException if a system exception occurred 306 */ 307 public static void removeAll() 308 throws com.liferay.portal.kernel.exception.SystemException { 309 getPersistence().removeAll(); 310 } 311 312 /** 313 * Returns the number of portal preferenceses where ownerId = ? and ownerType = ?. 314 * 315 * @param ownerId the owner ID 316 * @param ownerType the owner type 317 * @return the number of matching portal preferenceses 318 * @throws SystemException if a system exception occurred 319 */ 320 public static int countByO_O(long ownerId, int ownerType) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 return getPersistence().countByO_O(ownerId, ownerType); 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 }