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