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