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