001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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#remove(com.liferay.portal.model.BaseModel) 099 */ 100 public static ExpandoTable remove(ExpandoTable expandoTable) 101 throws SystemException { 102 return getPersistence().remove(expandoTable); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 107 */ 108 public static ExpandoTable update(ExpandoTable expandoTable, boolean merge) 109 throws SystemException { 110 return getPersistence().update(expandoTable, merge); 111 } 112 113 /** 114 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 115 */ 116 public static ExpandoTable update(ExpandoTable expandoTable, boolean merge, 117 ServiceContext serviceContext) throws SystemException { 118 return getPersistence().update(expandoTable, merge, serviceContext); 119 } 120 121 /** 122 * Caches the expando table in the entity cache if it is enabled. 123 * 124 * @param expandoTable the expando table to cache 125 */ 126 public static void cacheResult( 127 com.liferay.portlet.expando.model.ExpandoTable expandoTable) { 128 getPersistence().cacheResult(expandoTable); 129 } 130 131 /** 132 * Caches the expando tables in the entity cache if it is enabled. 133 * 134 * @param expandoTables the expando tables to cache 135 */ 136 public static void cacheResult( 137 java.util.List<com.liferay.portlet.expando.model.ExpandoTable> expandoTables) { 138 getPersistence().cacheResult(expandoTables); 139 } 140 141 /** 142 * Creates a new expando table with the primary key. Does not add the expando table to the database. 143 * 144 * @param tableId the primary key for the new expando table 145 * @return the new expando table 146 */ 147 public static com.liferay.portlet.expando.model.ExpandoTable create( 148 long tableId) { 149 return getPersistence().create(tableId); 150 } 151 152 /** 153 * Removes the expando table with the primary key from the database. Also notifies the appropriate model listeners. 154 * 155 * @param tableId the primary key of the expando table to remove 156 * @return the expando table that was removed 157 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 158 * @throws SystemException if a system exception occurred 159 */ 160 public static com.liferay.portlet.expando.model.ExpandoTable remove( 161 long tableId) 162 throws com.liferay.portal.kernel.exception.SystemException, 163 com.liferay.portlet.expando.NoSuchTableException { 164 return getPersistence().remove(tableId); 165 } 166 167 public static com.liferay.portlet.expando.model.ExpandoTable updateImpl( 168 com.liferay.portlet.expando.model.ExpandoTable expandoTable, 169 boolean merge) 170 throws com.liferay.portal.kernel.exception.SystemException { 171 return getPersistence().updateImpl(expandoTable, merge); 172 } 173 174 /** 175 * Finds the expando table with the primary key or throws a {@link com.liferay.portlet.expando.NoSuchTableException} if it could not be found. 176 * 177 * @param tableId the primary key of the expando table to find 178 * @return the expando table 179 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 180 * @throws SystemException if a system exception occurred 181 */ 182 public static com.liferay.portlet.expando.model.ExpandoTable findByPrimaryKey( 183 long tableId) 184 throws com.liferay.portal.kernel.exception.SystemException, 185 com.liferay.portlet.expando.NoSuchTableException { 186 return getPersistence().findByPrimaryKey(tableId); 187 } 188 189 /** 190 * Finds the expando table with the primary key or returns <code>null</code> if it could not be found. 191 * 192 * @param tableId the primary key of the expando table to find 193 * @return the expando table, or <code>null</code> if a expando table with the primary key could not be found 194 * @throws SystemException if a system exception occurred 195 */ 196 public static com.liferay.portlet.expando.model.ExpandoTable fetchByPrimaryKey( 197 long tableId) 198 throws com.liferay.portal.kernel.exception.SystemException { 199 return getPersistence().fetchByPrimaryKey(tableId); 200 } 201 202 /** 203 * Finds all the expando tables where companyId = ? and classNameId = ?. 204 * 205 * @param companyId the company ID to search with 206 * @param classNameId the class name ID to search with 207 * @return the matching expando tables 208 * @throws SystemException if a system exception occurred 209 */ 210 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 211 long companyId, long classNameId) 212 throws com.liferay.portal.kernel.exception.SystemException { 213 return getPersistence().findByC_C(companyId, classNameId); 214 } 215 216 /** 217 * Finds a range of all the expando tables where companyId = ? and classNameId = ?. 218 * 219 * <p> 220 * 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. 221 * </p> 222 * 223 * @param companyId the company ID to search with 224 * @param classNameId the class name ID to search with 225 * @param start the lower bound of the range of expando tables to return 226 * @param end the upper bound of the range of expando tables to return (not inclusive) 227 * @return the range of matching expando tables 228 * @throws SystemException if a system exception occurred 229 */ 230 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 231 long companyId, long classNameId, int start, int end) 232 throws com.liferay.portal.kernel.exception.SystemException { 233 return getPersistence().findByC_C(companyId, classNameId, start, end); 234 } 235 236 /** 237 * Finds an ordered range of all the expando tables where companyId = ? and classNameId = ?. 238 * 239 * <p> 240 * 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. 241 * </p> 242 * 243 * @param companyId the company ID to search with 244 * @param classNameId the class name ID to search with 245 * @param start the lower bound of the range of expando tables to return 246 * @param end the upper bound of the range of expando tables to return (not inclusive) 247 * @param orderByComparator the comparator to order the results by 248 * @return the ordered range of matching expando tables 249 * @throws SystemException if a system exception occurred 250 */ 251 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 252 long companyId, long classNameId, int start, int end, 253 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 254 throws com.liferay.portal.kernel.exception.SystemException { 255 return getPersistence() 256 .findByC_C(companyId, classNameId, start, end, 257 orderByComparator); 258 } 259 260 /** 261 * Finds the first expando table in the ordered set where companyId = ? and classNameId = ?. 262 * 263 * <p> 264 * 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. 265 * </p> 266 * 267 * @param companyId the company ID to search with 268 * @param classNameId the class name ID to search with 269 * @param orderByComparator the comparator to order the set by 270 * @return the first matching expando table 271 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 272 * @throws SystemException if a system exception occurred 273 */ 274 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_First( 275 long companyId, long classNameId, 276 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 277 throws com.liferay.portal.kernel.exception.SystemException, 278 com.liferay.portlet.expando.NoSuchTableException { 279 return getPersistence() 280 .findByC_C_First(companyId, classNameId, orderByComparator); 281 } 282 283 /** 284 * Finds the last expando table in the ordered set where companyId = ? and classNameId = ?. 285 * 286 * <p> 287 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 288 * </p> 289 * 290 * @param companyId the company ID to search with 291 * @param classNameId the class name ID to search with 292 * @param orderByComparator the comparator to order the set by 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 * Finds the expando tables before and after the current expando table in the ordered set where companyId = ? and classNameId = ?. 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. 311 * </p> 312 * 313 * @param tableId the primary key of the current expando table 314 * @param companyId the company ID to search with 315 * @param classNameId the class name ID to search with 316 * @param orderByComparator the comparator to order the set by 317 * @return the previous, current, and next expando table 318 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 319 * @throws SystemException if a system exception occurred 320 */ 321 public static com.liferay.portlet.expando.model.ExpandoTable[] findByC_C_PrevAndNext( 322 long tableId, long companyId, long classNameId, 323 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 324 throws com.liferay.portal.kernel.exception.SystemException, 325 com.liferay.portlet.expando.NoSuchTableException { 326 return getPersistence() 327 .findByC_C_PrevAndNext(tableId, companyId, classNameId, 328 orderByComparator); 329 } 330 331 /** 332 * Finds the expando table where companyId = ? and classNameId = ? and name = ? or throws a {@link com.liferay.portlet.expando.NoSuchTableException} if it could not be found. 333 * 334 * @param companyId the company ID to search with 335 * @param classNameId the class name ID to search with 336 * @param name the name to search with 337 * @return the matching expando table 338 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 339 * @throws SystemException if a system exception occurred 340 */ 341 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_N( 342 long companyId, long classNameId, java.lang.String name) 343 throws com.liferay.portal.kernel.exception.SystemException, 344 com.liferay.portlet.expando.NoSuchTableException { 345 return getPersistence().findByC_C_N(companyId, classNameId, name); 346 } 347 348 /** 349 * Finds the expando table where companyId = ? and classNameId = ? and name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 350 * 351 * @param companyId the company ID to search with 352 * @param classNameId the class name ID to search with 353 * @param name the name to search with 354 * @return the matching expando table, or <code>null</code> if a matching expando table could not be found 355 * @throws SystemException if a system exception occurred 356 */ 357 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N( 358 long companyId, long classNameId, java.lang.String name) 359 throws com.liferay.portal.kernel.exception.SystemException { 360 return getPersistence().fetchByC_C_N(companyId, classNameId, name); 361 } 362 363 /** 364 * Finds 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. 365 * 366 * @param companyId the company ID to search with 367 * @param classNameId the class name ID to search with 368 * @param name the name to search with 369 * @return the matching expando table, or <code>null</code> if a matching expando table could not be found 370 * @throws SystemException if a system exception occurred 371 */ 372 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N( 373 long companyId, long classNameId, java.lang.String name, 374 boolean retrieveFromCache) 375 throws com.liferay.portal.kernel.exception.SystemException { 376 return getPersistence() 377 .fetchByC_C_N(companyId, classNameId, name, retrieveFromCache); 378 } 379 380 /** 381 * Finds all the expando tables. 382 * 383 * @return the expando tables 384 * @throws SystemException if a system exception occurred 385 */ 386 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll() 387 throws com.liferay.portal.kernel.exception.SystemException { 388 return getPersistence().findAll(); 389 } 390 391 /** 392 * Finds a range of all the expando tables. 393 * 394 * <p> 395 * 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. 396 * </p> 397 * 398 * @param start the lower bound of the range of expando tables to return 399 * @param end the upper bound of the range of expando tables to return (not inclusive) 400 * @return the range of expando tables 401 * @throws SystemException if a system exception occurred 402 */ 403 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll( 404 int start, int end) 405 throws com.liferay.portal.kernel.exception.SystemException { 406 return getPersistence().findAll(start, end); 407 } 408 409 /** 410 * Finds an ordered range of all the expando tables. 411 * 412 * <p> 413 * 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. 414 * </p> 415 * 416 * @param start the lower bound of the range of expando tables to return 417 * @param end the upper bound of the range of expando tables to return (not inclusive) 418 * @param orderByComparator the comparator to order the results by 419 * @return the ordered range of expando tables 420 * @throws SystemException if a system exception occurred 421 */ 422 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll( 423 int start, int end, 424 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 425 throws com.liferay.portal.kernel.exception.SystemException { 426 return getPersistence().findAll(start, end, orderByComparator); 427 } 428 429 /** 430 * Removes all the expando tables where companyId = ? and classNameId = ? from the database. 431 * 432 * @param companyId the company ID to search with 433 * @param classNameId the class name ID to search with 434 * @throws SystemException if a system exception occurred 435 */ 436 public static void removeByC_C(long companyId, long classNameId) 437 throws com.liferay.portal.kernel.exception.SystemException { 438 getPersistence().removeByC_C(companyId, classNameId); 439 } 440 441 /** 442 * Removes the expando table where companyId = ? and classNameId = ? and name = ? from the database. 443 * 444 * @param companyId the company ID to search with 445 * @param classNameId the class name ID to search with 446 * @param name the name to search with 447 * @throws SystemException if a system exception occurred 448 */ 449 public static void removeByC_C_N(long companyId, long classNameId, 450 java.lang.String name) 451 throws com.liferay.portal.kernel.exception.SystemException, 452 com.liferay.portlet.expando.NoSuchTableException { 453 getPersistence().removeByC_C_N(companyId, classNameId, name); 454 } 455 456 /** 457 * Removes all the expando tables from the database. 458 * 459 * @throws SystemException if a system exception occurred 460 */ 461 public static void removeAll() 462 throws com.liferay.portal.kernel.exception.SystemException { 463 getPersistence().removeAll(); 464 } 465 466 /** 467 * Counts all the expando tables where companyId = ? and classNameId = ?. 468 * 469 * @param companyId the company ID to search with 470 * @param classNameId the class name ID to search with 471 * @return the number of matching expando tables 472 * @throws SystemException if a system exception occurred 473 */ 474 public static int countByC_C(long companyId, long classNameId) 475 throws com.liferay.portal.kernel.exception.SystemException { 476 return getPersistence().countByC_C(companyId, classNameId); 477 } 478 479 /** 480 * Counts all the expando tables where companyId = ? and classNameId = ? and name = ?. 481 * 482 * @param companyId the company ID to search with 483 * @param classNameId the class name ID to search with 484 * @param name the name to search with 485 * @return the number of matching expando tables 486 * @throws SystemException if a system exception occurred 487 */ 488 public static int countByC_C_N(long companyId, long classNameId, 489 java.lang.String name) 490 throws com.liferay.portal.kernel.exception.SystemException { 491 return getPersistence().countByC_C_N(companyId, classNameId, name); 492 } 493 494 /** 495 * Counts all the expando tables. 496 * 497 * @return the number of expando tables 498 * @throws SystemException if a system exception occurred 499 */ 500 public static int countAll() 501 throws com.liferay.portal.kernel.exception.SystemException { 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 public void setPersistence(ExpandoTablePersistence persistence) { 517 _persistence = persistence; 518 519 ReferenceRegistry.registerReference(ExpandoTableUtil.class, 520 "_persistence"); 521 } 522 523 private static ExpandoTablePersistence _persistence; 524 }