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 * Returns all the expando tables where companyId = ? and classNameId = ?. 115 * 116 * @param companyId the company ID 117 * @param classNameId the class name ID 118 * @return the matching expando tables 119 * @throws SystemException if a system exception occurred 120 */ 121 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 122 long companyId, long classNameId) 123 throws com.liferay.portal.kernel.exception.SystemException { 124 return getPersistence().findByC_C(companyId, classNameId); 125 } 126 127 /** 128 * Returns a range of all the expando tables where companyId = ? and classNameId = ?. 129 * 130 * <p> 131 * 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.portlet.expando.model.impl.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. 132 * </p> 133 * 134 * @param companyId the company ID 135 * @param classNameId the class name ID 136 * @param start the lower bound of the range of expando tables 137 * @param end the upper bound of the range of expando tables (not inclusive) 138 * @return the range of matching expando tables 139 * @throws SystemException if a system exception occurred 140 */ 141 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 142 long companyId, long classNameId, int start, int end) 143 throws com.liferay.portal.kernel.exception.SystemException { 144 return getPersistence().findByC_C(companyId, classNameId, start, end); 145 } 146 147 /** 148 * Returns an ordered range of all the expando tables where companyId = ? and classNameId = ?. 149 * 150 * <p> 151 * 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.portlet.expando.model.impl.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. 152 * </p> 153 * 154 * @param companyId the company ID 155 * @param classNameId the class name ID 156 * @param start the lower bound of the range of expando tables 157 * @param end the upper bound of the range of expando tables (not inclusive) 158 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 159 * @return the ordered range of matching expando tables 160 * @throws SystemException if a system exception occurred 161 */ 162 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 163 long companyId, long classNameId, int start, int end, 164 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 165 throws com.liferay.portal.kernel.exception.SystemException { 166 return getPersistence() 167 .findByC_C(companyId, classNameId, start, end, 168 orderByComparator); 169 } 170 171 /** 172 * Returns the first expando table in the ordered set where companyId = ? and classNameId = ?. 173 * 174 * @param companyId the company ID 175 * @param classNameId the class name ID 176 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 177 * @return the first matching expando table 178 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 179 * @throws SystemException if a system exception occurred 180 */ 181 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_First( 182 long companyId, long classNameId, 183 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 184 throws com.liferay.portal.kernel.exception.SystemException, 185 com.liferay.portlet.expando.NoSuchTableException { 186 return getPersistence() 187 .findByC_C_First(companyId, classNameId, orderByComparator); 188 } 189 190 /** 191 * Returns the first expando table in the ordered set where companyId = ? and classNameId = ?. 192 * 193 * @param companyId the company ID 194 * @param classNameId the class name ID 195 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 196 * @return the first matching expando table, or <code>null</code> if a matching expando table could not be found 197 * @throws SystemException if a system exception occurred 198 */ 199 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_First( 200 long companyId, long classNameId, 201 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 202 throws com.liferay.portal.kernel.exception.SystemException { 203 return getPersistence() 204 .fetchByC_C_First(companyId, classNameId, orderByComparator); 205 } 206 207 /** 208 * Returns the last expando table in the ordered set where companyId = ? and classNameId = ?. 209 * 210 * @param companyId the company ID 211 * @param classNameId the class name ID 212 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 213 * @return the last matching expando table 214 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 215 * @throws SystemException if a system exception occurred 216 */ 217 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_Last( 218 long companyId, long classNameId, 219 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 220 throws com.liferay.portal.kernel.exception.SystemException, 221 com.liferay.portlet.expando.NoSuchTableException { 222 return getPersistence() 223 .findByC_C_Last(companyId, classNameId, orderByComparator); 224 } 225 226 /** 227 * Returns the last expando table in the ordered set where companyId = ? and classNameId = ?. 228 * 229 * @param companyId the company ID 230 * @param classNameId the class name ID 231 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 232 * @return the last matching expando table, or <code>null</code> if a matching expando table could not be found 233 * @throws SystemException if a system exception occurred 234 */ 235 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_Last( 236 long companyId, long classNameId, 237 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 238 throws com.liferay.portal.kernel.exception.SystemException { 239 return getPersistence() 240 .fetchByC_C_Last(companyId, classNameId, orderByComparator); 241 } 242 243 /** 244 * Returns the expando tables before and after the current expando table in the ordered set where companyId = ? and classNameId = ?. 245 * 246 * @param tableId the primary key of the current expando table 247 * @param companyId the company ID 248 * @param classNameId the class name ID 249 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 250 * @return the previous, current, and next expando table 251 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 252 * @throws SystemException if a system exception occurred 253 */ 254 public static com.liferay.portlet.expando.model.ExpandoTable[] findByC_C_PrevAndNext( 255 long tableId, long companyId, long classNameId, 256 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 257 throws com.liferay.portal.kernel.exception.SystemException, 258 com.liferay.portlet.expando.NoSuchTableException { 259 return getPersistence() 260 .findByC_C_PrevAndNext(tableId, companyId, classNameId, 261 orderByComparator); 262 } 263 264 /** 265 * Removes all the expando tables where companyId = ? and classNameId = ? from the database. 266 * 267 * @param companyId the company ID 268 * @param classNameId the class name ID 269 * @throws SystemException if a system exception occurred 270 */ 271 public static void removeByC_C(long companyId, long classNameId) 272 throws com.liferay.portal.kernel.exception.SystemException { 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 * @throws SystemException if a system exception occurred 283 */ 284 public static int countByC_C(long companyId, long classNameId) 285 throws com.liferay.portal.kernel.exception.SystemException { 286 return getPersistence().countByC_C(companyId, classNameId); 287 } 288 289 /** 290 * 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. 291 * 292 * @param companyId the company ID 293 * @param classNameId the class name ID 294 * @param name the name 295 * @return the matching expando table 296 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 297 * @throws SystemException if a system exception occurred 298 */ 299 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_N( 300 long companyId, long classNameId, java.lang.String name) 301 throws com.liferay.portal.kernel.exception.SystemException, 302 com.liferay.portlet.expando.NoSuchTableException { 303 return getPersistence().findByC_C_N(companyId, classNameId, name); 304 } 305 306 /** 307 * 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. 308 * 309 * @param companyId the company ID 310 * @param classNameId the class name ID 311 * @param name the name 312 * @return the 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_N( 316 long companyId, long classNameId, java.lang.String name) 317 throws com.liferay.portal.kernel.exception.SystemException { 318 return getPersistence().fetchByC_C_N(companyId, classNameId, name); 319 } 320 321 /** 322 * 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. 323 * 324 * @param companyId the company ID 325 * @param classNameId the class name ID 326 * @param name the name 327 * @param retrieveFromCache whether to use the finder cache 328 * @return the matching expando table, or <code>null</code> if a matching expando table could not be found 329 * @throws SystemException if a system exception occurred 330 */ 331 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N( 332 long companyId, long classNameId, java.lang.String name, 333 boolean retrieveFromCache) 334 throws com.liferay.portal.kernel.exception.SystemException { 335 return getPersistence() 336 .fetchByC_C_N(companyId, classNameId, name, retrieveFromCache); 337 } 338 339 /** 340 * Removes the expando table where companyId = ? and classNameId = ? and name = ? from the database. 341 * 342 * @param companyId the company ID 343 * @param classNameId the class name ID 344 * @param name the name 345 * @return the expando table that was removed 346 * @throws SystemException if a system exception occurred 347 */ 348 public static com.liferay.portlet.expando.model.ExpandoTable removeByC_C_N( 349 long companyId, long classNameId, java.lang.String name) 350 throws com.liferay.portal.kernel.exception.SystemException, 351 com.liferay.portlet.expando.NoSuchTableException { 352 return getPersistence().removeByC_C_N(companyId, classNameId, name); 353 } 354 355 /** 356 * Returns the number of expando tables where companyId = ? and classNameId = ? and name = ?. 357 * 358 * @param companyId the company ID 359 * @param classNameId the class name ID 360 * @param name the name 361 * @return the number of matching expando tables 362 * @throws SystemException if a system exception occurred 363 */ 364 public static int countByC_C_N(long companyId, long classNameId, 365 java.lang.String name) 366 throws com.liferay.portal.kernel.exception.SystemException { 367 return getPersistence().countByC_C_N(companyId, classNameId, name); 368 } 369 370 /** 371 * Caches the expando table in the entity cache if it is enabled. 372 * 373 * @param expandoTable the expando table 374 */ 375 public static void cacheResult( 376 com.liferay.portlet.expando.model.ExpandoTable expandoTable) { 377 getPersistence().cacheResult(expandoTable); 378 } 379 380 /** 381 * Caches the expando tables in the entity cache if it is enabled. 382 * 383 * @param expandoTables the expando tables 384 */ 385 public static void cacheResult( 386 java.util.List<com.liferay.portlet.expando.model.ExpandoTable> expandoTables) { 387 getPersistence().cacheResult(expandoTables); 388 } 389 390 /** 391 * Creates a new expando table with the primary key. Does not add the expando table to the database. 392 * 393 * @param tableId the primary key for the new expando table 394 * @return the new expando table 395 */ 396 public static com.liferay.portlet.expando.model.ExpandoTable create( 397 long tableId) { 398 return getPersistence().create(tableId); 399 } 400 401 /** 402 * Removes the expando table with the primary key from the database. Also notifies the appropriate model listeners. 403 * 404 * @param tableId the primary key of the expando table 405 * @return the expando table that was removed 406 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 407 * @throws SystemException if a system exception occurred 408 */ 409 public static com.liferay.portlet.expando.model.ExpandoTable remove( 410 long tableId) 411 throws com.liferay.portal.kernel.exception.SystemException, 412 com.liferay.portlet.expando.NoSuchTableException { 413 return getPersistence().remove(tableId); 414 } 415 416 public static com.liferay.portlet.expando.model.ExpandoTable updateImpl( 417 com.liferay.portlet.expando.model.ExpandoTable expandoTable) 418 throws com.liferay.portal.kernel.exception.SystemException { 419 return getPersistence().updateImpl(expandoTable); 420 } 421 422 /** 423 * Returns the expando table with the primary key or throws a {@link com.liferay.portlet.expando.NoSuchTableException} if it could not be found. 424 * 425 * @param tableId the primary key of the expando table 426 * @return the expando table 427 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 428 * @throws SystemException if a system exception occurred 429 */ 430 public static com.liferay.portlet.expando.model.ExpandoTable findByPrimaryKey( 431 long tableId) 432 throws com.liferay.portal.kernel.exception.SystemException, 433 com.liferay.portlet.expando.NoSuchTableException { 434 return getPersistence().findByPrimaryKey(tableId); 435 } 436 437 /** 438 * Returns the expando table with the primary key or returns <code>null</code> if it could not be found. 439 * 440 * @param tableId the primary key of the expando table 441 * @return the expando table, or <code>null</code> if a expando table with the primary key could not be found 442 * @throws SystemException if a system exception occurred 443 */ 444 public static com.liferay.portlet.expando.model.ExpandoTable fetchByPrimaryKey( 445 long tableId) 446 throws com.liferay.portal.kernel.exception.SystemException { 447 return getPersistence().fetchByPrimaryKey(tableId); 448 } 449 450 /** 451 * Returns all the expando tables. 452 * 453 * @return the expando tables 454 * @throws SystemException if a system exception occurred 455 */ 456 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll() 457 throws com.liferay.portal.kernel.exception.SystemException { 458 return getPersistence().findAll(); 459 } 460 461 /** 462 * Returns a range of all the expando tables. 463 * 464 * <p> 465 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 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.portlet.expando.model.impl.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. 466 * </p> 467 * 468 * @param start the lower bound of the range of expando tables 469 * @param end the upper bound of the range of expando tables (not inclusive) 470 * @return the range of expando tables 471 * @throws SystemException if a system exception occurred 472 */ 473 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll( 474 int start, int end) 475 throws com.liferay.portal.kernel.exception.SystemException { 476 return getPersistence().findAll(start, end); 477 } 478 479 /** 480 * Returns an ordered range of all the expando tables. 481 * 482 * <p> 483 * 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.portlet.expando.model.impl.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. 484 * </p> 485 * 486 * @param start the lower bound of the range of expando tables 487 * @param end the upper bound of the range of expando tables (not inclusive) 488 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 489 * @return the ordered range of expando tables 490 * @throws SystemException if a system exception occurred 491 */ 492 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll( 493 int start, int end, 494 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 495 throws com.liferay.portal.kernel.exception.SystemException { 496 return getPersistence().findAll(start, end, orderByComparator); 497 } 498 499 /** 500 * Removes all the expando tables from the database. 501 * 502 * @throws SystemException if a system exception occurred 503 */ 504 public static void removeAll() 505 throws com.liferay.portal.kernel.exception.SystemException { 506 getPersistence().removeAll(); 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 }