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