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