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