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