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