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.PluginSetting; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the plugin setting service. This utility wraps {@link com.liferay.portal.service.persistence.impl.PluginSettingPersistenceImpl} 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 PluginSettingPersistence 037 * @see com.liferay.portal.service.persistence.impl.PluginSettingPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class PluginSettingUtil { 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(PluginSetting pluginSetting) { 059 getPersistence().clearCache(pluginSetting); 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<PluginSetting> 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<PluginSetting> 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<PluginSetting> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator<PluginSetting> 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 PluginSetting update(PluginSetting pluginSetting) { 100 return getPersistence().update(pluginSetting); 101 } 102 103 /** 104 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 105 */ 106 public static PluginSetting update(PluginSetting pluginSetting, 107 ServiceContext serviceContext) { 108 return getPersistence().update(pluginSetting, serviceContext); 109 } 110 111 /** 112 * Returns all the plugin settings where companyId = ?. 113 * 114 * @param companyId the company ID 115 * @return the matching plugin settings 116 */ 117 public static List<PluginSetting> findByCompanyId(long companyId) { 118 return getPersistence().findByCompanyId(companyId); 119 } 120 121 /** 122 * Returns a range of all the plugin settings where companyId = ?. 123 * 124 * <p> 125 * 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 PluginSettingModelImpl}. 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. 126 * </p> 127 * 128 * @param companyId the company ID 129 * @param start the lower bound of the range of plugin settings 130 * @param end the upper bound of the range of plugin settings (not inclusive) 131 * @return the range of matching plugin settings 132 */ 133 public static List<PluginSetting> findByCompanyId(long companyId, 134 int start, int end) { 135 return getPersistence().findByCompanyId(companyId, start, end); 136 } 137 138 /** 139 * Returns an ordered range of all the plugin settings where companyId = ?. 140 * 141 * <p> 142 * 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 PluginSettingModelImpl}. 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. 143 * </p> 144 * 145 * @param companyId the company ID 146 * @param start the lower bound of the range of plugin settings 147 * @param end the upper bound of the range of plugin settings (not inclusive) 148 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 149 * @return the ordered range of matching plugin settings 150 */ 151 public static List<PluginSetting> findByCompanyId(long companyId, 152 int start, int end, OrderByComparator<PluginSetting> orderByComparator) { 153 return getPersistence() 154 .findByCompanyId(companyId, start, end, orderByComparator); 155 } 156 157 /** 158 * Returns the first plugin setting in the ordered set where companyId = ?. 159 * 160 * @param companyId the company ID 161 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 162 * @return the first matching plugin setting 163 * @throws NoSuchPluginSettingException if a matching plugin setting could not be found 164 */ 165 public static PluginSetting findByCompanyId_First(long companyId, 166 OrderByComparator<PluginSetting> orderByComparator) 167 throws com.liferay.portal.NoSuchPluginSettingException { 168 return getPersistence() 169 .findByCompanyId_First(companyId, orderByComparator); 170 } 171 172 /** 173 * Returns the first plugin setting in the ordered set where companyId = ?. 174 * 175 * @param companyId the company ID 176 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 177 * @return the first matching plugin setting, or <code>null</code> if a matching plugin setting could not be found 178 */ 179 public static PluginSetting fetchByCompanyId_First(long companyId, 180 OrderByComparator<PluginSetting> orderByComparator) { 181 return getPersistence() 182 .fetchByCompanyId_First(companyId, orderByComparator); 183 } 184 185 /** 186 * Returns the last plugin setting in the ordered set where companyId = ?. 187 * 188 * @param companyId the company ID 189 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 190 * @return the last matching plugin setting 191 * @throws NoSuchPluginSettingException if a matching plugin setting could not be found 192 */ 193 public static PluginSetting findByCompanyId_Last(long companyId, 194 OrderByComparator<PluginSetting> orderByComparator) 195 throws com.liferay.portal.NoSuchPluginSettingException { 196 return getPersistence() 197 .findByCompanyId_Last(companyId, orderByComparator); 198 } 199 200 /** 201 * Returns the last plugin setting in the ordered set where companyId = ?. 202 * 203 * @param companyId the company ID 204 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 205 * @return the last matching plugin setting, or <code>null</code> if a matching plugin setting could not be found 206 */ 207 public static PluginSetting fetchByCompanyId_Last(long companyId, 208 OrderByComparator<PluginSetting> orderByComparator) { 209 return getPersistence() 210 .fetchByCompanyId_Last(companyId, orderByComparator); 211 } 212 213 /** 214 * Returns the plugin settings before and after the current plugin setting in the ordered set where companyId = ?. 215 * 216 * @param pluginSettingId the primary key of the current plugin setting 217 * @param companyId the company ID 218 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 219 * @return the previous, current, and next plugin setting 220 * @throws NoSuchPluginSettingException if a plugin setting with the primary key could not be found 221 */ 222 public static PluginSetting[] findByCompanyId_PrevAndNext( 223 long pluginSettingId, long companyId, 224 OrderByComparator<PluginSetting> orderByComparator) 225 throws com.liferay.portal.NoSuchPluginSettingException { 226 return getPersistence() 227 .findByCompanyId_PrevAndNext(pluginSettingId, companyId, 228 orderByComparator); 229 } 230 231 /** 232 * Removes all the plugin settings where companyId = ? from the database. 233 * 234 * @param companyId the company ID 235 */ 236 public static void removeByCompanyId(long companyId) { 237 getPersistence().removeByCompanyId(companyId); 238 } 239 240 /** 241 * Returns the number of plugin settings where companyId = ?. 242 * 243 * @param companyId the company ID 244 * @return the number of matching plugin settings 245 */ 246 public static int countByCompanyId(long companyId) { 247 return getPersistence().countByCompanyId(companyId); 248 } 249 250 /** 251 * Returns the plugin setting where companyId = ? and pluginId = ? and pluginType = ? or throws a {@link NoSuchPluginSettingException} if it could not be found. 252 * 253 * @param companyId the company ID 254 * @param pluginId the plugin ID 255 * @param pluginType the plugin type 256 * @return the matching plugin setting 257 * @throws NoSuchPluginSettingException if a matching plugin setting could not be found 258 */ 259 public static PluginSetting findByC_I_T(long companyId, 260 java.lang.String pluginId, java.lang.String pluginType) 261 throws com.liferay.portal.NoSuchPluginSettingException { 262 return getPersistence().findByC_I_T(companyId, pluginId, pluginType); 263 } 264 265 /** 266 * Returns the plugin setting where companyId = ? and pluginId = ? and pluginType = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 267 * 268 * @param companyId the company ID 269 * @param pluginId the plugin ID 270 * @param pluginType the plugin type 271 * @return the matching plugin setting, or <code>null</code> if a matching plugin setting could not be found 272 */ 273 public static PluginSetting fetchByC_I_T(long companyId, 274 java.lang.String pluginId, java.lang.String pluginType) { 275 return getPersistence().fetchByC_I_T(companyId, pluginId, pluginType); 276 } 277 278 /** 279 * Returns the plugin setting where companyId = ? and pluginId = ? and pluginType = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 280 * 281 * @param companyId the company ID 282 * @param pluginId the plugin ID 283 * @param pluginType the plugin type 284 * @param retrieveFromCache whether to use the finder cache 285 * @return the matching plugin setting, or <code>null</code> if a matching plugin setting could not be found 286 */ 287 public static PluginSetting fetchByC_I_T(long companyId, 288 java.lang.String pluginId, java.lang.String pluginType, 289 boolean retrieveFromCache) { 290 return getPersistence() 291 .fetchByC_I_T(companyId, pluginId, pluginType, 292 retrieveFromCache); 293 } 294 295 /** 296 * Removes the plugin setting where companyId = ? and pluginId = ? and pluginType = ? from the database. 297 * 298 * @param companyId the company ID 299 * @param pluginId the plugin ID 300 * @param pluginType the plugin type 301 * @return the plugin setting that was removed 302 */ 303 public static PluginSetting removeByC_I_T(long companyId, 304 java.lang.String pluginId, java.lang.String pluginType) 305 throws com.liferay.portal.NoSuchPluginSettingException { 306 return getPersistence().removeByC_I_T(companyId, pluginId, pluginType); 307 } 308 309 /** 310 * Returns the number of plugin settings where companyId = ? and pluginId = ? and pluginType = ?. 311 * 312 * @param companyId the company ID 313 * @param pluginId the plugin ID 314 * @param pluginType the plugin type 315 * @return the number of matching plugin settings 316 */ 317 public static int countByC_I_T(long companyId, java.lang.String pluginId, 318 java.lang.String pluginType) { 319 return getPersistence().countByC_I_T(companyId, pluginId, pluginType); 320 } 321 322 /** 323 * Caches the plugin setting in the entity cache if it is enabled. 324 * 325 * @param pluginSetting the plugin setting 326 */ 327 public static void cacheResult(PluginSetting pluginSetting) { 328 getPersistence().cacheResult(pluginSetting); 329 } 330 331 /** 332 * Caches the plugin settings in the entity cache if it is enabled. 333 * 334 * @param pluginSettings the plugin settings 335 */ 336 public static void cacheResult(List<PluginSetting> pluginSettings) { 337 getPersistence().cacheResult(pluginSettings); 338 } 339 340 /** 341 * Creates a new plugin setting with the primary key. Does not add the plugin setting to the database. 342 * 343 * @param pluginSettingId the primary key for the new plugin setting 344 * @return the new plugin setting 345 */ 346 public static PluginSetting create(long pluginSettingId) { 347 return getPersistence().create(pluginSettingId); 348 } 349 350 /** 351 * Removes the plugin setting with the primary key from the database. Also notifies the appropriate model listeners. 352 * 353 * @param pluginSettingId the primary key of the plugin setting 354 * @return the plugin setting that was removed 355 * @throws NoSuchPluginSettingException if a plugin setting with the primary key could not be found 356 */ 357 public static PluginSetting remove(long pluginSettingId) 358 throws com.liferay.portal.NoSuchPluginSettingException { 359 return getPersistence().remove(pluginSettingId); 360 } 361 362 public static PluginSetting updateImpl(PluginSetting pluginSetting) { 363 return getPersistence().updateImpl(pluginSetting); 364 } 365 366 /** 367 * Returns the plugin setting with the primary key or throws a {@link NoSuchPluginSettingException} if it could not be found. 368 * 369 * @param pluginSettingId the primary key of the plugin setting 370 * @return the plugin setting 371 * @throws NoSuchPluginSettingException if a plugin setting with the primary key could not be found 372 */ 373 public static PluginSetting findByPrimaryKey(long pluginSettingId) 374 throws com.liferay.portal.NoSuchPluginSettingException { 375 return getPersistence().findByPrimaryKey(pluginSettingId); 376 } 377 378 /** 379 * Returns the plugin setting with the primary key or returns <code>null</code> if it could not be found. 380 * 381 * @param pluginSettingId the primary key of the plugin setting 382 * @return the plugin setting, or <code>null</code> if a plugin setting with the primary key could not be found 383 */ 384 public static PluginSetting fetchByPrimaryKey(long pluginSettingId) { 385 return getPersistence().fetchByPrimaryKey(pluginSettingId); 386 } 387 388 public static java.util.Map<java.io.Serializable, PluginSetting> fetchByPrimaryKeys( 389 java.util.Set<java.io.Serializable> primaryKeys) { 390 return getPersistence().fetchByPrimaryKeys(primaryKeys); 391 } 392 393 /** 394 * Returns all the plugin settings. 395 * 396 * @return the plugin settings 397 */ 398 public static List<PluginSetting> findAll() { 399 return getPersistence().findAll(); 400 } 401 402 /** 403 * Returns a range of all the plugin settings. 404 * 405 * <p> 406 * 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 PluginSettingModelImpl}. 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. 407 * </p> 408 * 409 * @param start the lower bound of the range of plugin settings 410 * @param end the upper bound of the range of plugin settings (not inclusive) 411 * @return the range of plugin settings 412 */ 413 public static List<PluginSetting> findAll(int start, int end) { 414 return getPersistence().findAll(start, end); 415 } 416 417 /** 418 * Returns an ordered range of all the plugin settings. 419 * 420 * <p> 421 * 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 PluginSettingModelImpl}. 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. 422 * </p> 423 * 424 * @param start the lower bound of the range of plugin settings 425 * @param end the upper bound of the range of plugin settings (not inclusive) 426 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 427 * @return the ordered range of plugin settings 428 */ 429 public static List<PluginSetting> findAll(int start, int end, 430 OrderByComparator<PluginSetting> orderByComparator) { 431 return getPersistence().findAll(start, end, orderByComparator); 432 } 433 434 /** 435 * Removes all the plugin settings from the database. 436 */ 437 public static void removeAll() { 438 getPersistence().removeAll(); 439 } 440 441 /** 442 * Returns the number of plugin settings. 443 * 444 * @return the number of plugin settings 445 */ 446 public static int countAll() { 447 return getPersistence().countAll(); 448 } 449 450 public static PluginSettingPersistence getPersistence() { 451 if (_persistence == null) { 452 _persistence = (PluginSettingPersistence)PortalBeanLocatorUtil.locate(PluginSettingPersistence.class.getName()); 453 454 ReferenceRegistry.registerReference(PluginSettingUtil.class, 455 "_persistence"); 456 } 457 458 return _persistence; 459 } 460 461 /** 462 * @deprecated As of 6.2.0 463 */ 464 @Deprecated 465 public void setPersistence(PluginSettingPersistence persistence) { 466 } 467 468 private static PluginSettingPersistence _persistence; 469 }