001 /** 002 * Copyright (c) 2000-2012 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.Company; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the company service. This utility wraps {@link CompanyPersistenceImpl} 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 CompanyPersistence 036 * @see CompanyPersistenceImpl 037 * @generated 038 */ 039 public class CompanyUtil { 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(Company company) { 057 getPersistence().clearCache(company); 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<Company> findWithDynamicQuery(DynamicQuery dynamicQuery) 072 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<Company> 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<Company> 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#update(com.liferay.portal.model.BaseModel, boolean) 098 */ 099 public static Company update(Company company, boolean merge) 100 throws SystemException { 101 return getPersistence().update(company, merge); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 106 */ 107 public static Company update(Company company, boolean merge, 108 ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(company, merge, serviceContext); 110 } 111 112 /** 113 * Caches the company in the entity cache if it is enabled. 114 * 115 * @param company the company 116 */ 117 public static void cacheResult(com.liferay.portal.model.Company company) { 118 getPersistence().cacheResult(company); 119 } 120 121 /** 122 * Caches the companies in the entity cache if it is enabled. 123 * 124 * @param companies the companies 125 */ 126 public static void cacheResult( 127 java.util.List<com.liferay.portal.model.Company> companies) { 128 getPersistence().cacheResult(companies); 129 } 130 131 /** 132 * Creates a new company with the primary key. Does not add the company to the database. 133 * 134 * @param companyId the primary key for the new company 135 * @return the new company 136 */ 137 public static com.liferay.portal.model.Company create(long companyId) { 138 return getPersistence().create(companyId); 139 } 140 141 /** 142 * Removes the company with the primary key from the database. Also notifies the appropriate model listeners. 143 * 144 * @param companyId the primary key of the company 145 * @return the company that was removed 146 * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found 147 * @throws SystemException if a system exception occurred 148 */ 149 public static com.liferay.portal.model.Company remove(long companyId) 150 throws com.liferay.portal.NoSuchCompanyException, 151 com.liferay.portal.kernel.exception.SystemException { 152 return getPersistence().remove(companyId); 153 } 154 155 public static com.liferay.portal.model.Company updateImpl( 156 com.liferay.portal.model.Company company, boolean merge) 157 throws com.liferay.portal.kernel.exception.SystemException { 158 return getPersistence().updateImpl(company, merge); 159 } 160 161 /** 162 * Returns the company with the primary key or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 163 * 164 * @param companyId the primary key of the company 165 * @return the company 166 * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found 167 * @throws SystemException if a system exception occurred 168 */ 169 public static com.liferay.portal.model.Company findByPrimaryKey( 170 long companyId) 171 throws com.liferay.portal.NoSuchCompanyException, 172 com.liferay.portal.kernel.exception.SystemException { 173 return getPersistence().findByPrimaryKey(companyId); 174 } 175 176 /** 177 * Returns the company with the primary key or returns <code>null</code> if it could not be found. 178 * 179 * @param companyId the primary key of the company 180 * @return the company, or <code>null</code> if a company with the primary key could not be found 181 * @throws SystemException if a system exception occurred 182 */ 183 public static com.liferay.portal.model.Company fetchByPrimaryKey( 184 long companyId) 185 throws com.liferay.portal.kernel.exception.SystemException { 186 return getPersistence().fetchByPrimaryKey(companyId); 187 } 188 189 /** 190 * Returns the company where webId = ? or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 191 * 192 * @param webId the web ID 193 * @return the matching company 194 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 195 * @throws SystemException if a system exception occurred 196 */ 197 public static com.liferay.portal.model.Company findByWebId( 198 java.lang.String webId) 199 throws com.liferay.portal.NoSuchCompanyException, 200 com.liferay.portal.kernel.exception.SystemException { 201 return getPersistence().findByWebId(webId); 202 } 203 204 /** 205 * Returns the company where webId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 206 * 207 * @param webId the web ID 208 * @return the matching company, or <code>null</code> if a matching company could not be found 209 * @throws SystemException if a system exception occurred 210 */ 211 public static com.liferay.portal.model.Company fetchByWebId( 212 java.lang.String webId) 213 throws com.liferay.portal.kernel.exception.SystemException { 214 return getPersistence().fetchByWebId(webId); 215 } 216 217 /** 218 * Returns the company where webId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 219 * 220 * @param webId the web ID 221 * @param retrieveFromCache whether to use the finder cache 222 * @return the matching company, or <code>null</code> if a matching company could not be found 223 * @throws SystemException if a system exception occurred 224 */ 225 public static com.liferay.portal.model.Company fetchByWebId( 226 java.lang.String webId, boolean retrieveFromCache) 227 throws com.liferay.portal.kernel.exception.SystemException { 228 return getPersistence().fetchByWebId(webId, retrieveFromCache); 229 } 230 231 /** 232 * Returns the company where mx = ? or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 233 * 234 * @param mx the mx 235 * @return the matching company 236 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 237 * @throws SystemException if a system exception occurred 238 */ 239 public static com.liferay.portal.model.Company findByMx(java.lang.String mx) 240 throws com.liferay.portal.NoSuchCompanyException, 241 com.liferay.portal.kernel.exception.SystemException { 242 return getPersistence().findByMx(mx); 243 } 244 245 /** 246 * Returns the company where mx = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 247 * 248 * @param mx the mx 249 * @return the matching company, or <code>null</code> if a matching company could not be found 250 * @throws SystemException if a system exception occurred 251 */ 252 public static com.liferay.portal.model.Company fetchByMx( 253 java.lang.String mx) 254 throws com.liferay.portal.kernel.exception.SystemException { 255 return getPersistence().fetchByMx(mx); 256 } 257 258 /** 259 * Returns the company where mx = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 260 * 261 * @param mx the mx 262 * @param retrieveFromCache whether to use the finder cache 263 * @return the matching company, or <code>null</code> if a matching company could not be found 264 * @throws SystemException if a system exception occurred 265 */ 266 public static com.liferay.portal.model.Company fetchByMx( 267 java.lang.String mx, boolean retrieveFromCache) 268 throws com.liferay.portal.kernel.exception.SystemException { 269 return getPersistence().fetchByMx(mx, retrieveFromCache); 270 } 271 272 /** 273 * Returns the company where logoId = ? or throws a {@link com.liferay.portal.NoSuchCompanyException} if it could not be found. 274 * 275 * @param logoId the logo ID 276 * @return the matching company 277 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 278 * @throws SystemException if a system exception occurred 279 */ 280 public static com.liferay.portal.model.Company findByLogoId(long logoId) 281 throws com.liferay.portal.NoSuchCompanyException, 282 com.liferay.portal.kernel.exception.SystemException { 283 return getPersistence().findByLogoId(logoId); 284 } 285 286 /** 287 * Returns the company where logoId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 288 * 289 * @param logoId the logo ID 290 * @return the matching company, or <code>null</code> if a matching company could not be found 291 * @throws SystemException if a system exception occurred 292 */ 293 public static com.liferay.portal.model.Company fetchByLogoId(long logoId) 294 throws com.liferay.portal.kernel.exception.SystemException { 295 return getPersistence().fetchByLogoId(logoId); 296 } 297 298 /** 299 * Returns the company where logoId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 300 * 301 * @param logoId the logo ID 302 * @param retrieveFromCache whether to use the finder cache 303 * @return the matching company, or <code>null</code> if a matching company could not be found 304 * @throws SystemException if a system exception occurred 305 */ 306 public static com.liferay.portal.model.Company fetchByLogoId(long logoId, 307 boolean retrieveFromCache) 308 throws com.liferay.portal.kernel.exception.SystemException { 309 return getPersistence().fetchByLogoId(logoId, retrieveFromCache); 310 } 311 312 /** 313 * Returns all the companies where system = ?. 314 * 315 * @param system the system 316 * @return the matching companies 317 * @throws SystemException if a system exception occurred 318 */ 319 public static java.util.List<com.liferay.portal.model.Company> findBySystem( 320 boolean system) 321 throws com.liferay.portal.kernel.exception.SystemException { 322 return getPersistence().findBySystem(system); 323 } 324 325 /** 326 * Returns a range of all the companies where system = ?. 327 * 328 * <p> 329 * 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. 330 * </p> 331 * 332 * @param system the system 333 * @param start the lower bound of the range of companies 334 * @param end the upper bound of the range of companies (not inclusive) 335 * @return the range of matching companies 336 * @throws SystemException if a system exception occurred 337 */ 338 public static java.util.List<com.liferay.portal.model.Company> findBySystem( 339 boolean system, int start, int end) 340 throws com.liferay.portal.kernel.exception.SystemException { 341 return getPersistence().findBySystem(system, start, end); 342 } 343 344 /** 345 * Returns an ordered range of all the companies where system = ?. 346 * 347 * <p> 348 * 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. 349 * </p> 350 * 351 * @param system the system 352 * @param start the lower bound of the range of companies 353 * @param end the upper bound of the range of companies (not inclusive) 354 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 355 * @return the ordered range of matching companies 356 * @throws SystemException if a system exception occurred 357 */ 358 public static java.util.List<com.liferay.portal.model.Company> findBySystem( 359 boolean system, int start, int end, 360 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 361 throws com.liferay.portal.kernel.exception.SystemException { 362 return getPersistence() 363 .findBySystem(system, start, end, orderByComparator); 364 } 365 366 /** 367 * Returns the first company in the ordered set where system = ?. 368 * 369 * <p> 370 * 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. 371 * </p> 372 * 373 * @param system the system 374 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 375 * @return the first matching company 376 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 377 * @throws SystemException if a system exception occurred 378 */ 379 public static com.liferay.portal.model.Company findBySystem_First( 380 boolean system, 381 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 382 throws com.liferay.portal.NoSuchCompanyException, 383 com.liferay.portal.kernel.exception.SystemException { 384 return getPersistence().findBySystem_First(system, orderByComparator); 385 } 386 387 /** 388 * Returns the last company in the ordered set where system = ?. 389 * 390 * <p> 391 * 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. 392 * </p> 393 * 394 * @param system the system 395 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 396 * @return the last matching company 397 * @throws com.liferay.portal.NoSuchCompanyException if a matching company could not be found 398 * @throws SystemException if a system exception occurred 399 */ 400 public static com.liferay.portal.model.Company findBySystem_Last( 401 boolean system, 402 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 403 throws com.liferay.portal.NoSuchCompanyException, 404 com.liferay.portal.kernel.exception.SystemException { 405 return getPersistence().findBySystem_Last(system, orderByComparator); 406 } 407 408 /** 409 * Returns the companies before and after the current company in the ordered set where system = ?. 410 * 411 * <p> 412 * 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. 413 * </p> 414 * 415 * @param companyId the primary key of the current company 416 * @param system the system 417 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 418 * @return the previous, current, and next company 419 * @throws com.liferay.portal.NoSuchCompanyException if a company with the primary key could not be found 420 * @throws SystemException if a system exception occurred 421 */ 422 public static com.liferay.portal.model.Company[] findBySystem_PrevAndNext( 423 long companyId, boolean system, 424 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 425 throws com.liferay.portal.NoSuchCompanyException, 426 com.liferay.portal.kernel.exception.SystemException { 427 return getPersistence() 428 .findBySystem_PrevAndNext(companyId, system, 429 orderByComparator); 430 } 431 432 /** 433 * Returns all the companies. 434 * 435 * @return the companies 436 * @throws SystemException if a system exception occurred 437 */ 438 public static java.util.List<com.liferay.portal.model.Company> findAll() 439 throws com.liferay.portal.kernel.exception.SystemException { 440 return getPersistence().findAll(); 441 } 442 443 /** 444 * Returns a range of all the companies. 445 * 446 * <p> 447 * 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. 448 * </p> 449 * 450 * @param start the lower bound of the range of companies 451 * @param end the upper bound of the range of companies (not inclusive) 452 * @return the range of companies 453 * @throws SystemException if a system exception occurred 454 */ 455 public static java.util.List<com.liferay.portal.model.Company> findAll( 456 int start, int end) 457 throws com.liferay.portal.kernel.exception.SystemException { 458 return getPersistence().findAll(start, end); 459 } 460 461 /** 462 * Returns an ordered range of all the companies. 463 * 464 * <p> 465 * 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. 466 * </p> 467 * 468 * @param start the lower bound of the range of companies 469 * @param end the upper bound of the range of companies (not inclusive) 470 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 471 * @return the ordered range of companies 472 * @throws SystemException if a system exception occurred 473 */ 474 public static java.util.List<com.liferay.portal.model.Company> findAll( 475 int start, int end, 476 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 477 throws com.liferay.portal.kernel.exception.SystemException { 478 return getPersistence().findAll(start, end, orderByComparator); 479 } 480 481 /** 482 * Removes the company where webId = ? from the database. 483 * 484 * @param webId the web ID 485 * @throws SystemException if a system exception occurred 486 */ 487 public static void removeByWebId(java.lang.String webId) 488 throws com.liferay.portal.NoSuchCompanyException, 489 com.liferay.portal.kernel.exception.SystemException { 490 getPersistence().removeByWebId(webId); 491 } 492 493 /** 494 * Removes the company where mx = ? from the database. 495 * 496 * @param mx the mx 497 * @throws SystemException if a system exception occurred 498 */ 499 public static void removeByMx(java.lang.String mx) 500 throws com.liferay.portal.NoSuchCompanyException, 501 com.liferay.portal.kernel.exception.SystemException { 502 getPersistence().removeByMx(mx); 503 } 504 505 /** 506 * Removes the company where logoId = ? from the database. 507 * 508 * @param logoId the logo ID 509 * @throws SystemException if a system exception occurred 510 */ 511 public static void removeByLogoId(long logoId) 512 throws com.liferay.portal.NoSuchCompanyException, 513 com.liferay.portal.kernel.exception.SystemException { 514 getPersistence().removeByLogoId(logoId); 515 } 516 517 /** 518 * Removes all the companies where system = ? from the database. 519 * 520 * @param system the system 521 * @throws SystemException if a system exception occurred 522 */ 523 public static void removeBySystem(boolean system) 524 throws com.liferay.portal.kernel.exception.SystemException { 525 getPersistence().removeBySystem(system); 526 } 527 528 /** 529 * Removes all the companies from the database. 530 * 531 * @throws SystemException if a system exception occurred 532 */ 533 public static void removeAll() 534 throws com.liferay.portal.kernel.exception.SystemException { 535 getPersistence().removeAll(); 536 } 537 538 /** 539 * Returns the number of companies where webId = ?. 540 * 541 * @param webId the web ID 542 * @return the number of matching companies 543 * @throws SystemException if a system exception occurred 544 */ 545 public static int countByWebId(java.lang.String webId) 546 throws com.liferay.portal.kernel.exception.SystemException { 547 return getPersistence().countByWebId(webId); 548 } 549 550 /** 551 * Returns the number of companies where mx = ?. 552 * 553 * @param mx the mx 554 * @return the number of matching companies 555 * @throws SystemException if a system exception occurred 556 */ 557 public static int countByMx(java.lang.String mx) 558 throws com.liferay.portal.kernel.exception.SystemException { 559 return getPersistence().countByMx(mx); 560 } 561 562 /** 563 * Returns the number of companies where logoId = ?. 564 * 565 * @param logoId the logo ID 566 * @return the number of matching companies 567 * @throws SystemException if a system exception occurred 568 */ 569 public static int countByLogoId(long logoId) 570 throws com.liferay.portal.kernel.exception.SystemException { 571 return getPersistence().countByLogoId(logoId); 572 } 573 574 /** 575 * Returns the number of companies where system = ?. 576 * 577 * @param system the system 578 * @return the number of matching companies 579 * @throws SystemException if a system exception occurred 580 */ 581 public static int countBySystem(boolean system) 582 throws com.liferay.portal.kernel.exception.SystemException { 583 return getPersistence().countBySystem(system); 584 } 585 586 /** 587 * Returns the number of companies. 588 * 589 * @return the number of companies 590 * @throws SystemException if a system exception occurred 591 */ 592 public static int countAll() 593 throws com.liferay.portal.kernel.exception.SystemException { 594 return getPersistence().countAll(); 595 } 596 597 public static CompanyPersistence getPersistence() { 598 if (_persistence == null) { 599 _persistence = (CompanyPersistence)PortalBeanLocatorUtil.locate(CompanyPersistence.class.getName()); 600 601 ReferenceRegistry.registerReference(CompanyUtil.class, 602 "_persistence"); 603 } 604 605 return _persistence; 606 } 607 608 public void setPersistence(CompanyPersistence persistence) { 609 _persistence = persistence; 610 611 ReferenceRegistry.registerReference(CompanyUtil.class, "_persistence"); 612 } 613 614 private static CompanyPersistence _persistence; 615 }