001 /** 002 * Copyright (c) 2000-2013 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.ExpandoRow; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the expando row service. This utility wraps {@link ExpandoRowPersistenceImpl} 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 ExpandoRowPersistence 037 * @see ExpandoRowPersistenceImpl 038 * @generated 039 */ 040 public class ExpandoRowUtil { 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(ExpandoRow expandoRow) { 058 getPersistence().clearCache(expandoRow); 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<ExpandoRow> 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<ExpandoRow> 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<ExpandoRow> 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, boolean) 099 */ 100 public static ExpandoRow update(ExpandoRow expandoRow, boolean merge) 101 throws SystemException { 102 return getPersistence().update(expandoRow, merge); 103 } 104 105 /** 106 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 107 */ 108 public static ExpandoRow update(ExpandoRow expandoRow, boolean merge, 109 ServiceContext serviceContext) throws SystemException { 110 return getPersistence().update(expandoRow, merge, serviceContext); 111 } 112 113 /** 114 * Caches the expando row in the entity cache if it is enabled. 115 * 116 * @param expandoRow the expando row 117 */ 118 public static void cacheResult( 119 com.liferay.portlet.expando.model.ExpandoRow expandoRow) { 120 getPersistence().cacheResult(expandoRow); 121 } 122 123 /** 124 * Caches the expando rows in the entity cache if it is enabled. 125 * 126 * @param expandoRows the expando rows 127 */ 128 public static void cacheResult( 129 java.util.List<com.liferay.portlet.expando.model.ExpandoRow> expandoRows) { 130 getPersistence().cacheResult(expandoRows); 131 } 132 133 /** 134 * Creates a new expando row with the primary key. Does not add the expando row to the database. 135 * 136 * @param rowId the primary key for the new expando row 137 * @return the new expando row 138 */ 139 public static com.liferay.portlet.expando.model.ExpandoRow create( 140 long rowId) { 141 return getPersistence().create(rowId); 142 } 143 144 /** 145 * Removes the expando row with the primary key from the database. Also notifies the appropriate model listeners. 146 * 147 * @param rowId the primary key of the expando row 148 * @return the expando row that was removed 149 * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row 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.ExpandoRow remove( 153 long rowId) 154 throws com.liferay.portal.kernel.exception.SystemException, 155 com.liferay.portlet.expando.NoSuchRowException { 156 return getPersistence().remove(rowId); 157 } 158 159 public static com.liferay.portlet.expando.model.ExpandoRow updateImpl( 160 com.liferay.portlet.expando.model.ExpandoRow expandoRow, boolean merge) 161 throws com.liferay.portal.kernel.exception.SystemException { 162 return getPersistence().updateImpl(expandoRow, merge); 163 } 164 165 /** 166 * Returns the expando row with the primary key or throws a {@link com.liferay.portlet.expando.NoSuchRowException} if it could not be found. 167 * 168 * @param rowId the primary key of the expando row 169 * @return the expando row 170 * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row 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.ExpandoRow findByPrimaryKey( 174 long rowId) 175 throws com.liferay.portal.kernel.exception.SystemException, 176 com.liferay.portlet.expando.NoSuchRowException { 177 return getPersistence().findByPrimaryKey(rowId); 178 } 179 180 /** 181 * Returns the expando row with the primary key or returns <code>null</code> if it could not be found. 182 * 183 * @param rowId the primary key of the expando row 184 * @return the expando row, or <code>null</code> if a expando row 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.ExpandoRow fetchByPrimaryKey( 188 long rowId) throws com.liferay.portal.kernel.exception.SystemException { 189 return getPersistence().fetchByPrimaryKey(rowId); 190 } 191 192 /** 193 * Returns all the expando rows where tableId = ?. 194 * 195 * @param tableId the table ID 196 * @return the matching expando rows 197 * @throws SystemException if a system exception occurred 198 */ 199 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId( 200 long tableId) 201 throws com.liferay.portal.kernel.exception.SystemException { 202 return getPersistence().findByTableId(tableId); 203 } 204 205 /** 206 * Returns a range of all the expando rows where tableId = ?. 207 * 208 * <p> 209 * 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. 210 * </p> 211 * 212 * @param tableId the table ID 213 * @param start the lower bound of the range of expando rows 214 * @param end the upper bound of the range of expando rows (not inclusive) 215 * @return the range of matching expando rows 216 * @throws SystemException if a system exception occurred 217 */ 218 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId( 219 long tableId, int start, int end) 220 throws com.liferay.portal.kernel.exception.SystemException { 221 return getPersistence().findByTableId(tableId, start, end); 222 } 223 224 /** 225 * Returns an ordered range of all the expando rows where tableId = ?. 226 * 227 * <p> 228 * 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. 229 * </p> 230 * 231 * @param tableId the table ID 232 * @param start the lower bound of the range of expando rows 233 * @param end the upper bound of the range of expando rows (not inclusive) 234 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 235 * @return the ordered range of matching expando rows 236 * @throws SystemException if a system exception occurred 237 */ 238 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId( 239 long tableId, int start, int end, 240 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 241 throws com.liferay.portal.kernel.exception.SystemException { 242 return getPersistence() 243 .findByTableId(tableId, start, end, orderByComparator); 244 } 245 246 /** 247 * Returns the first expando row in the ordered set where tableId = ?. 248 * 249 * @param tableId the table ID 250 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 251 * @return the first matching expando row 252 * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found 253 * @throws SystemException if a system exception occurred 254 */ 255 public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_First( 256 long tableId, 257 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 258 throws com.liferay.portal.kernel.exception.SystemException, 259 com.liferay.portlet.expando.NoSuchRowException { 260 return getPersistence().findByTableId_First(tableId, orderByComparator); 261 } 262 263 /** 264 * Returns the first expando row in the ordered set where tableId = ?. 265 * 266 * @param tableId the table ID 267 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 268 * @return the first matching expando row, or <code>null</code> if a matching expando row could not be found 269 * @throws SystemException if a system exception occurred 270 */ 271 public static com.liferay.portlet.expando.model.ExpandoRow fetchByTableId_First( 272 long tableId, 273 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 274 throws com.liferay.portal.kernel.exception.SystemException { 275 return getPersistence().fetchByTableId_First(tableId, orderByComparator); 276 } 277 278 /** 279 * Returns the last expando row in the ordered set where tableId = ?. 280 * 281 * @param tableId the table ID 282 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 283 * @return the last matching expando row 284 * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found 285 * @throws SystemException if a system exception occurred 286 */ 287 public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_Last( 288 long tableId, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.kernel.exception.SystemException, 291 com.liferay.portlet.expando.NoSuchRowException { 292 return getPersistence().findByTableId_Last(tableId, orderByComparator); 293 } 294 295 /** 296 * Returns the last expando row in the ordered set where tableId = ?. 297 * 298 * @param tableId the table ID 299 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 300 * @return the last matching expando row, or <code>null</code> if a matching expando row could not be found 301 * @throws SystemException if a system exception occurred 302 */ 303 public static com.liferay.portlet.expando.model.ExpandoRow fetchByTableId_Last( 304 long tableId, 305 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 306 throws com.liferay.portal.kernel.exception.SystemException { 307 return getPersistence().fetchByTableId_Last(tableId, orderByComparator); 308 } 309 310 /** 311 * Returns the expando rows before and after the current expando row in the ordered set where tableId = ?. 312 * 313 * @param rowId the primary key of the current expando row 314 * @param tableId the table ID 315 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 316 * @return the previous, current, and next expando row 317 * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row with the primary key could not be found 318 * @throws SystemException if a system exception occurred 319 */ 320 public static com.liferay.portlet.expando.model.ExpandoRow[] findByTableId_PrevAndNext( 321 long rowId, long tableId, 322 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 323 throws com.liferay.portal.kernel.exception.SystemException, 324 com.liferay.portlet.expando.NoSuchRowException { 325 return getPersistence() 326 .findByTableId_PrevAndNext(rowId, tableId, orderByComparator); 327 } 328 329 /** 330 * Returns the expando row where tableId = ? and classPK = ? or throws a {@link com.liferay.portlet.expando.NoSuchRowException} if it could not be found. 331 * 332 * @param tableId the table ID 333 * @param classPK the class p k 334 * @return the matching expando row 335 * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found 336 * @throws SystemException if a system exception occurred 337 */ 338 public static com.liferay.portlet.expando.model.ExpandoRow findByT_C( 339 long tableId, long classPK) 340 throws com.liferay.portal.kernel.exception.SystemException, 341 com.liferay.portlet.expando.NoSuchRowException { 342 return getPersistence().findByT_C(tableId, classPK); 343 } 344 345 /** 346 * Returns the expando row where tableId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 347 * 348 * @param tableId the table ID 349 * @param classPK the class p k 350 * @return the matching expando row, or <code>null</code> if a matching expando row could not be found 351 * @throws SystemException if a system exception occurred 352 */ 353 public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C( 354 long tableId, long classPK) 355 throws com.liferay.portal.kernel.exception.SystemException { 356 return getPersistence().fetchByT_C(tableId, classPK); 357 } 358 359 /** 360 * Returns the expando row where tableId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 361 * 362 * @param tableId the table ID 363 * @param classPK the class p k 364 * @param retrieveFromCache whether to use the finder cache 365 * @return the matching expando row, or <code>null</code> if a matching expando row could not be found 366 * @throws SystemException if a system exception occurred 367 */ 368 public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C( 369 long tableId, long classPK, boolean retrieveFromCache) 370 throws com.liferay.portal.kernel.exception.SystemException { 371 return getPersistence().fetchByT_C(tableId, classPK, retrieveFromCache); 372 } 373 374 /** 375 * Returns all the expando rows. 376 * 377 * @return the expando rows 378 * @throws SystemException if a system exception occurred 379 */ 380 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll() 381 throws com.liferay.portal.kernel.exception.SystemException { 382 return getPersistence().findAll(); 383 } 384 385 /** 386 * Returns a range of all the expando rows. 387 * 388 * <p> 389 * 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. 390 * </p> 391 * 392 * @param start the lower bound of the range of expando rows 393 * @param end the upper bound of the range of expando rows (not inclusive) 394 * @return the range of expando rows 395 * @throws SystemException if a system exception occurred 396 */ 397 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll( 398 int start, int end) 399 throws com.liferay.portal.kernel.exception.SystemException { 400 return getPersistence().findAll(start, end); 401 } 402 403 /** 404 * Returns an ordered range of all the expando rows. 405 * 406 * <p> 407 * 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. 408 * </p> 409 * 410 * @param start the lower bound of the range of expando rows 411 * @param end the upper bound of the range of expando rows (not inclusive) 412 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 413 * @return the ordered range of expando rows 414 * @throws SystemException if a system exception occurred 415 */ 416 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll( 417 int start, int end, 418 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 419 throws com.liferay.portal.kernel.exception.SystemException { 420 return getPersistence().findAll(start, end, orderByComparator); 421 } 422 423 /** 424 * Removes all the expando rows where tableId = ? from the database. 425 * 426 * @param tableId the table ID 427 * @throws SystemException if a system exception occurred 428 */ 429 public static void removeByTableId(long tableId) 430 throws com.liferay.portal.kernel.exception.SystemException { 431 getPersistence().removeByTableId(tableId); 432 } 433 434 /** 435 * Removes the expando row where tableId = ? and classPK = ? from the database. 436 * 437 * @param tableId the table ID 438 * @param classPK the class p k 439 * @return the expando row that was removed 440 * @throws SystemException if a system exception occurred 441 */ 442 public static com.liferay.portlet.expando.model.ExpandoRow removeByT_C( 443 long tableId, long classPK) 444 throws com.liferay.portal.kernel.exception.SystemException, 445 com.liferay.portlet.expando.NoSuchRowException { 446 return getPersistence().removeByT_C(tableId, classPK); 447 } 448 449 /** 450 * Removes all the expando rows from the database. 451 * 452 * @throws SystemException if a system exception occurred 453 */ 454 public static void removeAll() 455 throws com.liferay.portal.kernel.exception.SystemException { 456 getPersistence().removeAll(); 457 } 458 459 /** 460 * Returns the number of expando rows where tableId = ?. 461 * 462 * @param tableId the table ID 463 * @return the number of matching expando rows 464 * @throws SystemException if a system exception occurred 465 */ 466 public static int countByTableId(long tableId) 467 throws com.liferay.portal.kernel.exception.SystemException { 468 return getPersistence().countByTableId(tableId); 469 } 470 471 /** 472 * Returns the number of expando rows where tableId = ? and classPK = ?. 473 * 474 * @param tableId the table ID 475 * @param classPK the class p k 476 * @return the number of matching expando rows 477 * @throws SystemException if a system exception occurred 478 */ 479 public static int countByT_C(long tableId, long classPK) 480 throws com.liferay.portal.kernel.exception.SystemException { 481 return getPersistence().countByT_C(tableId, classPK); 482 } 483 484 /** 485 * Returns the number of expando rows. 486 * 487 * @return the number of expando rows 488 * @throws SystemException if a system exception occurred 489 */ 490 public static int countAll() 491 throws com.liferay.portal.kernel.exception.SystemException { 492 return getPersistence().countAll(); 493 } 494 495 public static ExpandoRowPersistence getPersistence() { 496 if (_persistence == null) { 497 _persistence = (ExpandoRowPersistence)PortalBeanLocatorUtil.locate(ExpandoRowPersistence.class.getName()); 498 499 ReferenceRegistry.registerReference(ExpandoRowUtil.class, 500 "_persistence"); 501 } 502 503 return _persistence; 504 } 505 506 /** 507 * @deprecated 508 */ 509 public void setPersistence(ExpandoRowPersistence persistence) { 510 } 511 512 private static ExpandoRowPersistence _persistence; 513 }