001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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 to cache 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 to cache 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 to remove 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 * Finds 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 to find 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 * Finds 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 to find 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 * Finds all the plugin settings where companyId = ?. 202 * 203 * @param companyId the company ID to search with 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 * Finds 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 to search with 221 * @param start the lower bound of the range of plugin settings to return 222 * @param end the upper bound of the range of plugin settings to return (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 * Finds 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 to search with 240 * @param start the lower bound of the range of plugin settings to return 241 * @param end the upper bound of the range of plugin settings to return (not inclusive) 242 * @param orderByComparator the comparator to order the results by 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 * Finds 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 to search with 262 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 284 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 307 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 326 * @param pluginId the plugin ID to search with 327 * @param pluginType the plugin type to search with 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 * Finds 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 to search with 343 * @param pluginId the plugin ID to search with 344 * @param pluginType the plugin type to search with 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 * Finds 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 to search with 358 * @param pluginId the plugin ID to search with 359 * @param pluginType the plugin type to search with 360 * @return the matching plugin setting, or <code>null</code> if a matching plugin setting could not be found 361 * @throws SystemException if a system exception occurred 362 */ 363 public static com.liferay.portal.model.PluginSetting fetchByC_I_T( 364 long companyId, java.lang.String pluginId, java.lang.String pluginType, 365 boolean retrieveFromCache) 366 throws com.liferay.portal.kernel.exception.SystemException { 367 return getPersistence() 368 .fetchByC_I_T(companyId, pluginId, pluginType, 369 retrieveFromCache); 370 } 371 372 /** 373 * Finds all the plugin settings. 374 * 375 * @return the plugin settings 376 * @throws SystemException if a system exception occurred 377 */ 378 public static java.util.List<com.liferay.portal.model.PluginSetting> findAll() 379 throws com.liferay.portal.kernel.exception.SystemException { 380 return getPersistence().findAll(); 381 } 382 383 /** 384 * Finds a range of all the plugin settings. 385 * 386 * <p> 387 * 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. 388 * </p> 389 * 390 * @param start the lower bound of the range of plugin settings to return 391 * @param end the upper bound of the range of plugin settings to return (not inclusive) 392 * @return the range of plugin settings 393 * @throws SystemException if a system exception occurred 394 */ 395 public static java.util.List<com.liferay.portal.model.PluginSetting> findAll( 396 int start, int end) 397 throws com.liferay.portal.kernel.exception.SystemException { 398 return getPersistence().findAll(start, end); 399 } 400 401 /** 402 * Finds an ordered range of all the plugin settings. 403 * 404 * <p> 405 * 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. 406 * </p> 407 * 408 * @param start the lower bound of the range of plugin settings to return 409 * @param end the upper bound of the range of plugin settings to return (not inclusive) 410 * @param orderByComparator the comparator to order the results by 411 * @return the ordered range of plugin settings 412 * @throws SystemException if a system exception occurred 413 */ 414 public static java.util.List<com.liferay.portal.model.PluginSetting> findAll( 415 int start, int end, 416 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 417 throws com.liferay.portal.kernel.exception.SystemException { 418 return getPersistence().findAll(start, end, orderByComparator); 419 } 420 421 /** 422 * Removes all the plugin settings where companyId = ? from the database. 423 * 424 * @param companyId the company ID to search with 425 * @throws SystemException if a system exception occurred 426 */ 427 public static void removeByCompanyId(long companyId) 428 throws com.liferay.portal.kernel.exception.SystemException { 429 getPersistence().removeByCompanyId(companyId); 430 } 431 432 /** 433 * Removes the plugin setting where companyId = ? and pluginId = ? and pluginType = ? from the database. 434 * 435 * @param companyId the company ID to search with 436 * @param pluginId the plugin ID to search with 437 * @param pluginType the plugin type to search with 438 * @throws SystemException if a system exception occurred 439 */ 440 public static void removeByC_I_T(long companyId, java.lang.String pluginId, 441 java.lang.String pluginType) 442 throws com.liferay.portal.NoSuchPluginSettingException, 443 com.liferay.portal.kernel.exception.SystemException { 444 getPersistence().removeByC_I_T(companyId, pluginId, pluginType); 445 } 446 447 /** 448 * Removes all the plugin settings from the database. 449 * 450 * @throws SystemException if a system exception occurred 451 */ 452 public static void removeAll() 453 throws com.liferay.portal.kernel.exception.SystemException { 454 getPersistence().removeAll(); 455 } 456 457 /** 458 * Counts all the plugin settings where companyId = ?. 459 * 460 * @param companyId the company ID to search with 461 * @return the number of matching plugin settings 462 * @throws SystemException if a system exception occurred 463 */ 464 public static int countByCompanyId(long companyId) 465 throws com.liferay.portal.kernel.exception.SystemException { 466 return getPersistence().countByCompanyId(companyId); 467 } 468 469 /** 470 * Counts all the plugin settings where companyId = ? and pluginId = ? and pluginType = ?. 471 * 472 * @param companyId the company ID to search with 473 * @param pluginId the plugin ID to search with 474 * @param pluginType the plugin type to search with 475 * @return the number of matching plugin settings 476 * @throws SystemException if a system exception occurred 477 */ 478 public static int countByC_I_T(long companyId, java.lang.String pluginId, 479 java.lang.String pluginType) 480 throws com.liferay.portal.kernel.exception.SystemException { 481 return getPersistence().countByC_I_T(companyId, pluginId, pluginType); 482 } 483 484 /** 485 * Counts all the plugin settings. 486 * 487 * @return the number of plugin settings 488 * @throws SystemException if a system exception occurred 489 */ 490 public static int countAll() 491 throws com.liferay.portal.kernel.exception.SystemException { 492 return getPersistence().countAll(); 493 } 494 495 public static PluginSettingPersistence getPersistence() { 496 if (_persistence == null) { 497 _persistence = (PluginSettingPersistence)PortalBeanLocatorUtil.locate(PluginSettingPersistence.class.getName()); 498 499 ReferenceRegistry.registerReference(PluginSettingUtil.class, 500 "_persistence"); 501 } 502 503 return _persistence; 504 } 505 506 public void setPersistence(PluginSettingPersistence persistence) { 507 _persistence = persistence; 508 509 ReferenceRegistry.registerReference(PluginSettingUtil.class, 510 "_persistence"); 511 } 512 513 private static PluginSettingPersistence _persistence; 514 }