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