001 /** 002 * Copyright (c) 2000-present 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.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.model.PortalPreferences; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * 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. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see PortalPreferencesPersistence 037 * @see PortalPreferencesPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class PortalPreferencesUtil { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 046 */ 047 048 /** 049 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 050 */ 051 public static void clearCache() { 052 getPersistence().clearCache(); 053 } 054 055 /** 056 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 057 */ 058 public static void clearCache(PortalPreferences portalPreferences) { 059 getPersistence().clearCache(portalPreferences); 060 } 061 062 /** 063 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 064 */ 065 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<PortalPreferences> findWithDynamicQuery( 073 DynamicQuery dynamicQuery) { 074 return getPersistence().findWithDynamicQuery(dynamicQuery); 075 } 076 077 /** 078 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 079 */ 080 public static List<PortalPreferences> findWithDynamicQuery( 081 DynamicQuery dynamicQuery, int start, int end) { 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<PortalPreferences> orderByComparator) { 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 return getPersistence().update(portalPreferences); 101 } 102 103 /** 104 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 105 */ 106 public static PortalPreferences update( 107 PortalPreferences portalPreferences, ServiceContext serviceContext) { 108 return getPersistence().update(portalPreferences, serviceContext); 109 } 110 111 /** 112 * Returns the portal preferences where ownerId = ? and ownerType = ? or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found. 113 * 114 * @param ownerId the owner ID 115 * @param ownerType the owner type 116 * @return the matching portal preferences 117 * @throws com.liferay.portal.NoSuchPreferencesException if a matching portal preferences could not be found 118 */ 119 public static com.liferay.portal.model.PortalPreferences findByO_O( 120 long ownerId, int ownerType) 121 throws com.liferay.portal.NoSuchPreferencesException { 122 return getPersistence().findByO_O(ownerId, ownerType); 123 } 124 125 /** 126 * Returns the portal preferences where ownerId = ? and ownerType = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 127 * 128 * @param ownerId the owner ID 129 * @param ownerType the owner type 130 * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found 131 */ 132 public static com.liferay.portal.model.PortalPreferences fetchByO_O( 133 long ownerId, int ownerType) { 134 return getPersistence().fetchByO_O(ownerId, ownerType); 135 } 136 137 /** 138 * Returns the portal preferences where ownerId = ? and ownerType = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 139 * 140 * @param ownerId the owner ID 141 * @param ownerType the owner type 142 * @param retrieveFromCache whether to use the finder cache 143 * @return the matching portal preferences, or <code>null</code> if a matching portal preferences could not be found 144 */ 145 public static com.liferay.portal.model.PortalPreferences fetchByO_O( 146 long ownerId, int ownerType, boolean retrieveFromCache) { 147 return getPersistence().fetchByO_O(ownerId, ownerType, retrieveFromCache); 148 } 149 150 /** 151 * Removes the portal preferences where ownerId = ? and ownerType = ? from the database. 152 * 153 * @param ownerId the owner ID 154 * @param ownerType the owner type 155 * @return the portal preferences that was removed 156 */ 157 public static com.liferay.portal.model.PortalPreferences removeByO_O( 158 long ownerId, int ownerType) 159 throws com.liferay.portal.NoSuchPreferencesException { 160 return getPersistence().removeByO_O(ownerId, ownerType); 161 } 162 163 /** 164 * Returns the number of portal preferenceses where ownerId = ? and ownerType = ?. 165 * 166 * @param ownerId the owner ID 167 * @param ownerType the owner type 168 * @return the number of matching portal preferenceses 169 */ 170 public static int countByO_O(long ownerId, int ownerType) { 171 return getPersistence().countByO_O(ownerId, ownerType); 172 } 173 174 /** 175 * Caches the portal preferences in the entity cache if it is enabled. 176 * 177 * @param portalPreferences the portal preferences 178 */ 179 public static void cacheResult( 180 com.liferay.portal.model.PortalPreferences portalPreferences) { 181 getPersistence().cacheResult(portalPreferences); 182 } 183 184 /** 185 * Caches the portal preferenceses in the entity cache if it is enabled. 186 * 187 * @param portalPreferenceses the portal preferenceses 188 */ 189 public static void cacheResult( 190 java.util.List<com.liferay.portal.model.PortalPreferences> portalPreferenceses) { 191 getPersistence().cacheResult(portalPreferenceses); 192 } 193 194 /** 195 * Creates a new portal preferences with the primary key. Does not add the portal preferences to the database. 196 * 197 * @param portalPreferencesId the primary key for the new portal preferences 198 * @return the new portal preferences 199 */ 200 public static com.liferay.portal.model.PortalPreferences create( 201 long portalPreferencesId) { 202 return getPersistence().create(portalPreferencesId); 203 } 204 205 /** 206 * Removes the portal preferences with the primary key from the database. Also notifies the appropriate model listeners. 207 * 208 * @param portalPreferencesId the primary key of the portal preferences 209 * @return the portal preferences that was removed 210 * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found 211 */ 212 public static com.liferay.portal.model.PortalPreferences remove( 213 long portalPreferencesId) 214 throws com.liferay.portal.NoSuchPreferencesException { 215 return getPersistence().remove(portalPreferencesId); 216 } 217 218 public static com.liferay.portal.model.PortalPreferences updateImpl( 219 com.liferay.portal.model.PortalPreferences portalPreferences) { 220 return getPersistence().updateImpl(portalPreferences); 221 } 222 223 /** 224 * Returns the portal preferences with the primary key or throws a {@link com.liferay.portal.NoSuchPreferencesException} if it could not be found. 225 * 226 * @param portalPreferencesId the primary key of the portal preferences 227 * @return the portal preferences 228 * @throws com.liferay.portal.NoSuchPreferencesException if a portal preferences with the primary key could not be found 229 */ 230 public static com.liferay.portal.model.PortalPreferences findByPrimaryKey( 231 long portalPreferencesId) 232 throws com.liferay.portal.NoSuchPreferencesException { 233 return getPersistence().findByPrimaryKey(portalPreferencesId); 234 } 235 236 /** 237 * Returns the portal preferences with the primary key or returns <code>null</code> if it could not be found. 238 * 239 * @param portalPreferencesId the primary key of the portal preferences 240 * @return the portal preferences, or <code>null</code> if a portal preferences with the primary key could not be found 241 */ 242 public static com.liferay.portal.model.PortalPreferences fetchByPrimaryKey( 243 long portalPreferencesId) { 244 return getPersistence().fetchByPrimaryKey(portalPreferencesId); 245 } 246 247 public static java.util.Map<java.io.Serializable, com.liferay.portal.model.PortalPreferences> fetchByPrimaryKeys( 248 java.util.Set<java.io.Serializable> primaryKeys) { 249 return getPersistence().fetchByPrimaryKeys(primaryKeys); 250 } 251 252 /** 253 * Returns all the portal preferenceses. 254 * 255 * @return the portal preferenceses 256 */ 257 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll() { 258 return getPersistence().findAll(); 259 } 260 261 /** 262 * Returns a range of all the portal preferenceses. 263 * 264 * <p> 265 * 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. 266 * </p> 267 * 268 * @param start the lower bound of the range of portal preferenceses 269 * @param end the upper bound of the range of portal preferenceses (not inclusive) 270 * @return the range of portal preferenceses 271 */ 272 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll( 273 int start, int end) { 274 return getPersistence().findAll(start, end); 275 } 276 277 /** 278 * Returns an ordered 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 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 287 * @return the ordered range of portal preferenceses 288 */ 289 public static java.util.List<com.liferay.portal.model.PortalPreferences> findAll( 290 int start, int end, 291 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.PortalPreferences> orderByComparator) { 292 return getPersistence().findAll(start, end, orderByComparator); 293 } 294 295 /** 296 * Removes all the portal preferenceses from the database. 297 */ 298 public static void removeAll() { 299 getPersistence().removeAll(); 300 } 301 302 /** 303 * Returns the number of portal preferenceses. 304 * 305 * @return the number of portal preferenceses 306 */ 307 public static int countAll() { 308 return getPersistence().countAll(); 309 } 310 311 public static PortalPreferencesPersistence getPersistence() { 312 if (_persistence == null) { 313 _persistence = (PortalPreferencesPersistence)PortalBeanLocatorUtil.locate(PortalPreferencesPersistence.class.getName()); 314 315 ReferenceRegistry.registerReference(PortalPreferencesUtil.class, 316 "_persistence"); 317 } 318 319 return _persistence; 320 } 321 322 /** 323 * @deprecated As of 6.2.0 324 */ 325 @Deprecated 326 public void setPersistence(PortalPreferencesPersistence persistence) { 327 } 328 329 private static PortalPreferencesPersistence _persistence; 330 }