001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.model.Company; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the company service. This utility wraps {@link com.liferay.portal.service.persistence.impl.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. 030 * 031 * <p> 032 * Caching information and settings can be found in <code>portal.properties</code> 033 * </p> 034 * 035 * @author Brian Wing Shun Chan 036 * @see CompanyPersistence 037 * @see com.liferay.portal.service.persistence.impl.CompanyPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class CompanyUtil { 042 /* 043 * NOTE FOR DEVELOPERS: 044 * 045 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 046 */ 047 048 /** 049 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 050 */ 051 public static void clearCache() { 052 getPersistence().clearCache(); 053 } 054 055 /** 056 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 057 */ 058 public static void clearCache(Company company) { 059 getPersistence().clearCache(company); 060 } 061 062 /** 063 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 064 */ 065 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 066 return getPersistence().countWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 071 */ 072 public static List<Company> findWithDynamicQuery(DynamicQuery dynamicQuery) { 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 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 082 } 083 084 /** 085 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 086 */ 087 public static List<Company> findWithDynamicQuery( 088 DynamicQuery dynamicQuery, int start, int end, 089 OrderByComparator<Company> orderByComparator) { 090 return getPersistence() 091 .findWithDynamicQuery(dynamicQuery, start, end, 092 orderByComparator); 093 } 094 095 /** 096 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 097 */ 098 public static Company update(Company company) { 099 return getPersistence().update(company); 100 } 101 102 /** 103 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 104 */ 105 public static Company update(Company company, ServiceContext serviceContext) { 106 return getPersistence().update(company, serviceContext); 107 } 108 109 /** 110 * Returns the company where webId = ? or throws a {@link NoSuchCompanyException} if it could not be found. 111 * 112 * @param webId the web ID 113 * @return the matching company 114 * @throws NoSuchCompanyException if a matching company could not be found 115 */ 116 public static Company findByWebId(java.lang.String webId) 117 throws com.liferay.portal.exception.NoSuchCompanyException { 118 return getPersistence().findByWebId(webId); 119 } 120 121 /** 122 * Returns the company where webId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 123 * 124 * @param webId the web ID 125 * @return the matching company, or <code>null</code> if a matching company could not be found 126 */ 127 public static Company fetchByWebId(java.lang.String webId) { 128 return getPersistence().fetchByWebId(webId); 129 } 130 131 /** 132 * Returns the company where webId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 133 * 134 * @param webId the web ID 135 * @param retrieveFromCache whether to retrieve from the finder cache 136 * @return the matching company, or <code>null</code> if a matching company could not be found 137 */ 138 public static Company fetchByWebId(java.lang.String webId, 139 boolean retrieveFromCache) { 140 return getPersistence().fetchByWebId(webId, retrieveFromCache); 141 } 142 143 /** 144 * Removes the company where webId = ? from the database. 145 * 146 * @param webId the web ID 147 * @return the company that was removed 148 */ 149 public static Company removeByWebId(java.lang.String webId) 150 throws com.liferay.portal.exception.NoSuchCompanyException { 151 return getPersistence().removeByWebId(webId); 152 } 153 154 /** 155 * Returns the number of companies where webId = ?. 156 * 157 * @param webId the web ID 158 * @return the number of matching companies 159 */ 160 public static int countByWebId(java.lang.String webId) { 161 return getPersistence().countByWebId(webId); 162 } 163 164 /** 165 * Returns the company where mx = ? or throws a {@link NoSuchCompanyException} if it could not be found. 166 * 167 * @param mx the mx 168 * @return the matching company 169 * @throws NoSuchCompanyException if a matching company could not be found 170 */ 171 public static Company findByMx(java.lang.String mx) 172 throws com.liferay.portal.exception.NoSuchCompanyException { 173 return getPersistence().findByMx(mx); 174 } 175 176 /** 177 * Returns the company where mx = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 178 * 179 * @param mx the mx 180 * @return the matching company, or <code>null</code> if a matching company could not be found 181 */ 182 public static Company fetchByMx(java.lang.String mx) { 183 return getPersistence().fetchByMx(mx); 184 } 185 186 /** 187 * Returns the company where mx = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 188 * 189 * @param mx the mx 190 * @param retrieveFromCache whether to retrieve from the finder cache 191 * @return the matching company, or <code>null</code> if a matching company could not be found 192 */ 193 public static Company fetchByMx(java.lang.String mx, 194 boolean retrieveFromCache) { 195 return getPersistence().fetchByMx(mx, retrieveFromCache); 196 } 197 198 /** 199 * Removes the company where mx = ? from the database. 200 * 201 * @param mx the mx 202 * @return the company that was removed 203 */ 204 public static Company removeByMx(java.lang.String mx) 205 throws com.liferay.portal.exception.NoSuchCompanyException { 206 return getPersistence().removeByMx(mx); 207 } 208 209 /** 210 * Returns the number of companies where mx = ?. 211 * 212 * @param mx the mx 213 * @return the number of matching companies 214 */ 215 public static int countByMx(java.lang.String mx) { 216 return getPersistence().countByMx(mx); 217 } 218 219 /** 220 * Returns the company where logoId = ? or throws a {@link NoSuchCompanyException} if it could not be found. 221 * 222 * @param logoId the logo ID 223 * @return the matching company 224 * @throws NoSuchCompanyException if a matching company could not be found 225 */ 226 public static Company findByLogoId(long logoId) 227 throws com.liferay.portal.exception.NoSuchCompanyException { 228 return getPersistence().findByLogoId(logoId); 229 } 230 231 /** 232 * Returns the company where logoId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 233 * 234 * @param logoId the logo ID 235 * @return the matching company, or <code>null</code> if a matching company could not be found 236 */ 237 public static Company fetchByLogoId(long logoId) { 238 return getPersistence().fetchByLogoId(logoId); 239 } 240 241 /** 242 * Returns the company where logoId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 243 * 244 * @param logoId the logo ID 245 * @param retrieveFromCache whether to retrieve from the finder cache 246 * @return the matching company, or <code>null</code> if a matching company could not be found 247 */ 248 public static Company fetchByLogoId(long logoId, boolean retrieveFromCache) { 249 return getPersistence().fetchByLogoId(logoId, retrieveFromCache); 250 } 251 252 /** 253 * Removes the company where logoId = ? from the database. 254 * 255 * @param logoId the logo ID 256 * @return the company that was removed 257 */ 258 public static Company removeByLogoId(long logoId) 259 throws com.liferay.portal.exception.NoSuchCompanyException { 260 return getPersistence().removeByLogoId(logoId); 261 } 262 263 /** 264 * Returns the number of companies where logoId = ?. 265 * 266 * @param logoId the logo ID 267 * @return the number of matching companies 268 */ 269 public static int countByLogoId(long logoId) { 270 return getPersistence().countByLogoId(logoId); 271 } 272 273 /** 274 * Returns all the companies where system = ?. 275 * 276 * @param system the system 277 * @return the matching companies 278 */ 279 public static List<Company> findBySystem(boolean system) { 280 return getPersistence().findBySystem(system); 281 } 282 283 /** 284 * Returns a range of all the companies where system = ?. 285 * 286 * <p> 287 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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. 288 * </p> 289 * 290 * @param system the system 291 * @param start the lower bound of the range of companies 292 * @param end the upper bound of the range of companies (not inclusive) 293 * @return the range of matching companies 294 */ 295 public static List<Company> findBySystem(boolean system, int start, int end) { 296 return getPersistence().findBySystem(system, start, end); 297 } 298 299 /** 300 * Returns an ordered range of all the companies where system = ?. 301 * 302 * <p> 303 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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. 304 * </p> 305 * 306 * @param system the system 307 * @param start the lower bound of the range of companies 308 * @param end the upper bound of the range of companies (not inclusive) 309 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 310 * @return the ordered range of matching companies 311 */ 312 public static List<Company> findBySystem(boolean system, int start, 313 int end, OrderByComparator<Company> orderByComparator) { 314 return getPersistence() 315 .findBySystem(system, start, end, orderByComparator); 316 } 317 318 /** 319 * Returns an ordered range of all the companies where system = ?. 320 * 321 * <p> 322 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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. 323 * </p> 324 * 325 * @param system the system 326 * @param start the lower bound of the range of companies 327 * @param end the upper bound of the range of companies (not inclusive) 328 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 329 * @param retrieveFromCache whether to retrieve from the finder cache 330 * @return the ordered range of matching companies 331 */ 332 public static List<Company> findBySystem(boolean system, int start, 333 int end, OrderByComparator<Company> orderByComparator, 334 boolean retrieveFromCache) { 335 return getPersistence() 336 .findBySystem(system, start, end, orderByComparator, 337 retrieveFromCache); 338 } 339 340 /** 341 * Returns the first company in the ordered set where system = ?. 342 * 343 * @param system the system 344 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 345 * @return the first matching company 346 * @throws NoSuchCompanyException if a matching company could not be found 347 */ 348 public static Company findBySystem_First(boolean system, 349 OrderByComparator<Company> orderByComparator) 350 throws com.liferay.portal.exception.NoSuchCompanyException { 351 return getPersistence().findBySystem_First(system, orderByComparator); 352 } 353 354 /** 355 * Returns the first company in the ordered set where system = ?. 356 * 357 * @param system the system 358 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 359 * @return the first matching company, or <code>null</code> if a matching company could not be found 360 */ 361 public static Company fetchBySystem_First(boolean system, 362 OrderByComparator<Company> orderByComparator) { 363 return getPersistence().fetchBySystem_First(system, orderByComparator); 364 } 365 366 /** 367 * Returns the last company in the ordered set where system = ?. 368 * 369 * @param system the system 370 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 371 * @return the last matching company 372 * @throws NoSuchCompanyException if a matching company could not be found 373 */ 374 public static Company findBySystem_Last(boolean system, 375 OrderByComparator<Company> orderByComparator) 376 throws com.liferay.portal.exception.NoSuchCompanyException { 377 return getPersistence().findBySystem_Last(system, orderByComparator); 378 } 379 380 /** 381 * Returns the last company in the ordered set where system = ?. 382 * 383 * @param system the system 384 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 385 * @return the last matching company, or <code>null</code> if a matching company could not be found 386 */ 387 public static Company fetchBySystem_Last(boolean system, 388 OrderByComparator<Company> orderByComparator) { 389 return getPersistence().fetchBySystem_Last(system, orderByComparator); 390 } 391 392 /** 393 * Returns the companies before and after the current company in the ordered set where system = ?. 394 * 395 * @param companyId the primary key of the current company 396 * @param system the system 397 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 398 * @return the previous, current, and next company 399 * @throws NoSuchCompanyException if a company with the primary key could not be found 400 */ 401 public static Company[] findBySystem_PrevAndNext(long companyId, 402 boolean system, OrderByComparator<Company> orderByComparator) 403 throws com.liferay.portal.exception.NoSuchCompanyException { 404 return getPersistence() 405 .findBySystem_PrevAndNext(companyId, system, 406 orderByComparator); 407 } 408 409 /** 410 * Removes all the companies where system = ? from the database. 411 * 412 * @param system the system 413 */ 414 public static void removeBySystem(boolean system) { 415 getPersistence().removeBySystem(system); 416 } 417 418 /** 419 * Returns the number of companies where system = ?. 420 * 421 * @param system the system 422 * @return the number of matching companies 423 */ 424 public static int countBySystem(boolean system) { 425 return getPersistence().countBySystem(system); 426 } 427 428 /** 429 * Caches the company in the entity cache if it is enabled. 430 * 431 * @param company the company 432 */ 433 public static void cacheResult(Company company) { 434 getPersistence().cacheResult(company); 435 } 436 437 /** 438 * Caches the companies in the entity cache if it is enabled. 439 * 440 * @param companies the companies 441 */ 442 public static void cacheResult(List<Company> companies) { 443 getPersistence().cacheResult(companies); 444 } 445 446 /** 447 * Creates a new company with the primary key. Does not add the company to the database. 448 * 449 * @param companyId the primary key for the new company 450 * @return the new company 451 */ 452 public static Company create(long companyId) { 453 return getPersistence().create(companyId); 454 } 455 456 /** 457 * Removes the company with the primary key from the database. Also notifies the appropriate model listeners. 458 * 459 * @param companyId the primary key of the company 460 * @return the company that was removed 461 * @throws NoSuchCompanyException if a company with the primary key could not be found 462 */ 463 public static Company remove(long companyId) 464 throws com.liferay.portal.exception.NoSuchCompanyException { 465 return getPersistence().remove(companyId); 466 } 467 468 public static Company updateImpl(Company company) { 469 return getPersistence().updateImpl(company); 470 } 471 472 /** 473 * Returns the company with the primary key or throws a {@link NoSuchCompanyException} if it could not be found. 474 * 475 * @param companyId the primary key of the company 476 * @return the company 477 * @throws NoSuchCompanyException if a company with the primary key could not be found 478 */ 479 public static Company findByPrimaryKey(long companyId) 480 throws com.liferay.portal.exception.NoSuchCompanyException { 481 return getPersistence().findByPrimaryKey(companyId); 482 } 483 484 /** 485 * Returns the company with the primary key or returns <code>null</code> if it could not be found. 486 * 487 * @param companyId the primary key of the company 488 * @return the company, or <code>null</code> if a company with the primary key could not be found 489 */ 490 public static Company fetchByPrimaryKey(long companyId) { 491 return getPersistence().fetchByPrimaryKey(companyId); 492 } 493 494 public static java.util.Map<java.io.Serializable, Company> fetchByPrimaryKeys( 495 java.util.Set<java.io.Serializable> primaryKeys) { 496 return getPersistence().fetchByPrimaryKeys(primaryKeys); 497 } 498 499 /** 500 * Returns all the companies. 501 * 502 * @return the companies 503 */ 504 public static List<Company> findAll() { 505 return getPersistence().findAll(); 506 } 507 508 /** 509 * Returns a range of all the companies. 510 * 511 * <p> 512 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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. 513 * </p> 514 * 515 * @param start the lower bound of the range of companies 516 * @param end the upper bound of the range of companies (not inclusive) 517 * @return the range of companies 518 */ 519 public static List<Company> findAll(int start, int end) { 520 return getPersistence().findAll(start, end); 521 } 522 523 /** 524 * Returns an ordered range of all the companies. 525 * 526 * <p> 527 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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. 528 * </p> 529 * 530 * @param start the lower bound of the range of companies 531 * @param end the upper bound of the range of companies (not inclusive) 532 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 533 * @return the ordered range of companies 534 */ 535 public static List<Company> findAll(int start, int end, 536 OrderByComparator<Company> orderByComparator) { 537 return getPersistence().findAll(start, end, orderByComparator); 538 } 539 540 /** 541 * Returns an ordered range of all the companies. 542 * 543 * <p> 544 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CompanyModelImpl}. 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. 545 * </p> 546 * 547 * @param start the lower bound of the range of companies 548 * @param end the upper bound of the range of companies (not inclusive) 549 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 550 * @param retrieveFromCache whether to retrieve from the finder cache 551 * @return the ordered range of companies 552 */ 553 public static List<Company> findAll(int start, int end, 554 OrderByComparator<Company> orderByComparator, boolean retrieveFromCache) { 555 return getPersistence() 556 .findAll(start, end, orderByComparator, retrieveFromCache); 557 } 558 559 /** 560 * Removes all the companies from the database. 561 */ 562 public static void removeAll() { 563 getPersistence().removeAll(); 564 } 565 566 /** 567 * Returns the number of companies. 568 * 569 * @return the number of companies 570 */ 571 public static int countAll() { 572 return getPersistence().countAll(); 573 } 574 575 public static java.util.Set<java.lang.String> getBadColumnNames() { 576 return getPersistence().getBadColumnNames(); 577 } 578 579 public static CompanyPersistence getPersistence() { 580 if (_persistence == null) { 581 _persistence = (CompanyPersistence)PortalBeanLocatorUtil.locate(CompanyPersistence.class.getName()); 582 583 ReferenceRegistry.registerReference(CompanyUtil.class, 584 "_persistence"); 585 } 586 587 return _persistence; 588 } 589 590 private static CompanyPersistence _persistence; 591 }