001 /** 002 * Copyright (c) 2000-2010 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.service.ServiceContext; 022 023 import com.liferay.portlet.expando.model.ExpandoRow; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the expando row service. 029 * 030 * <p> 031 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class. 032 * </p> 033 * 034 * @author Brian Wing Shun Chan 035 * @see ExpandoRowPersistence 036 * @see ExpandoRowPersistenceImpl 037 * @generated 038 */ 039 public class ExpandoRowUtil { 040 /** 041 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 042 */ 043 public static void clearCache() { 044 getPersistence().clearCache(); 045 } 046 047 /** 048 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 049 */ 050 public static void clearCache(ExpandoRow expandoRow) { 051 getPersistence().clearCache(expandoRow); 052 } 053 054 /** 055 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 056 */ 057 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 058 throws SystemException { 059 return getPersistence().countWithDynamicQuery(dynamicQuery); 060 } 061 062 /** 063 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 064 */ 065 public static List<ExpandoRow> findWithDynamicQuery( 066 DynamicQuery dynamicQuery) throws SystemException { 067 return getPersistence().findWithDynamicQuery(dynamicQuery); 068 } 069 070 /** 071 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 072 */ 073 public static List<ExpandoRow> findWithDynamicQuery( 074 DynamicQuery dynamicQuery, int start, int end) 075 throws SystemException { 076 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 077 } 078 079 /** 080 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 081 */ 082 public static List<ExpandoRow> findWithDynamicQuery( 083 DynamicQuery dynamicQuery, int start, int end, 084 OrderByComparator orderByComparator) throws SystemException { 085 return getPersistence() 086 .findWithDynamicQuery(dynamicQuery, start, end, 087 orderByComparator); 088 } 089 090 /** 091 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 092 */ 093 public static ExpandoRow remove(ExpandoRow expandoRow) 094 throws SystemException { 095 return getPersistence().remove(expandoRow); 096 } 097 098 /** 099 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 100 */ 101 public static ExpandoRow update(ExpandoRow expandoRow, boolean merge) 102 throws SystemException { 103 return getPersistence().update(expandoRow, merge); 104 } 105 106 /** 107 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 108 */ 109 public static ExpandoRow update(ExpandoRow expandoRow, boolean merge, 110 ServiceContext serviceContext) throws SystemException { 111 return getPersistence().update(expandoRow, merge, serviceContext); 112 } 113 114 /** 115 * Caches the expando row in the entity cache if it is enabled. 116 * 117 * @param expandoRow the expando row to cache 118 */ 119 public static void cacheResult( 120 com.liferay.portlet.expando.model.ExpandoRow expandoRow) { 121 getPersistence().cacheResult(expandoRow); 122 } 123 124 /** 125 * Caches the expando rows in the entity cache if it is enabled. 126 * 127 * @param expandoRows the expando rows to cache 128 */ 129 public static void cacheResult( 130 java.util.List<com.liferay.portlet.expando.model.ExpandoRow> expandoRows) { 131 getPersistence().cacheResult(expandoRows); 132 } 133 134 /** 135 * Creates a new expando row with the primary key. 136 * 137 * @param rowId the primary key for the new expando row 138 * @return the new expando row 139 */ 140 public static com.liferay.portlet.expando.model.ExpandoRow create( 141 long rowId) { 142 return getPersistence().create(rowId); 143 } 144 145 /** 146 * Removes the expando row with the primary key from the database. Also notifies the appropriate model listeners. 147 * 148 * @param rowId the primary key of the expando row to remove 149 * @return the expando row that was removed 150 * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row with the primary key could not be found 151 * @throws SystemException if a system exception occurred 152 */ 153 public static com.liferay.portlet.expando.model.ExpandoRow remove( 154 long rowId) 155 throws com.liferay.portal.kernel.exception.SystemException, 156 com.liferay.portlet.expando.NoSuchRowException { 157 return getPersistence().remove(rowId); 158 } 159 160 public static com.liferay.portlet.expando.model.ExpandoRow updateImpl( 161 com.liferay.portlet.expando.model.ExpandoRow expandoRow, boolean merge) 162 throws com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().updateImpl(expandoRow, merge); 164 } 165 166 /** 167 * Finds the expando row with the primary key or throws a {@link com.liferay.portlet.expando.NoSuchRowException} if it could not be found. 168 * 169 * @param rowId the primary key of the expando row to find 170 * @return the expando row 171 * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row with the primary key could not be found 172 * @throws SystemException if a system exception occurred 173 */ 174 public static com.liferay.portlet.expando.model.ExpandoRow findByPrimaryKey( 175 long rowId) 176 throws com.liferay.portal.kernel.exception.SystemException, 177 com.liferay.portlet.expando.NoSuchRowException { 178 return getPersistence().findByPrimaryKey(rowId); 179 } 180 181 /** 182 * Finds the expando row with the primary key or returns <code>null</code> if it could not be found. 183 * 184 * @param rowId the primary key of the expando row to find 185 * @return the expando row, or <code>null</code> if a expando row with the primary key could not be found 186 * @throws SystemException if a system exception occurred 187 */ 188 public static com.liferay.portlet.expando.model.ExpandoRow fetchByPrimaryKey( 189 long rowId) throws com.liferay.portal.kernel.exception.SystemException { 190 return getPersistence().fetchByPrimaryKey(rowId); 191 } 192 193 /** 194 * Finds all the expando rows where tableId = ?. 195 * 196 * @param tableId the table id to search with 197 * @return the matching expando rows 198 * @throws SystemException if a system exception occurred 199 */ 200 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId( 201 long tableId) 202 throws com.liferay.portal.kernel.exception.SystemException { 203 return getPersistence().findByTableId(tableId); 204 } 205 206 /** 207 * Finds a range of all the expando rows where tableId = ?. 208 * 209 * <p> 210 * 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. 211 * </p> 212 * 213 * @param tableId the table id to search with 214 * @param start the lower bound of the range of expando rows to return 215 * @param end the upper bound of the range of expando rows to return (not inclusive) 216 * @return the range of matching expando rows 217 * @throws SystemException if a system exception occurred 218 */ 219 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId( 220 long tableId, int start, int end) 221 throws com.liferay.portal.kernel.exception.SystemException { 222 return getPersistence().findByTableId(tableId, start, end); 223 } 224 225 /** 226 * Finds an ordered range of all the expando rows where tableId = ?. 227 * 228 * <p> 229 * 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. 230 * </p> 231 * 232 * @param tableId the table id to search with 233 * @param start the lower bound of the range of expando rows to return 234 * @param end the upper bound of the range of expando rows to return (not inclusive) 235 * @param orderByComparator the comparator to order the results by 236 * @return the ordered range of matching expando rows 237 * @throws SystemException if a system exception occurred 238 */ 239 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId( 240 long tableId, int start, int end, 241 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 242 throws com.liferay.portal.kernel.exception.SystemException { 243 return getPersistence() 244 .findByTableId(tableId, start, end, orderByComparator); 245 } 246 247 /** 248 * Finds the first expando row in the ordered set where tableId = ?. 249 * 250 * <p> 251 * 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. 252 * </p> 253 * 254 * @param tableId the table id to search with 255 * @param orderByComparator the comparator to order the set by 256 * @return the first matching expando row 257 * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found 258 * @throws SystemException if a system exception occurred 259 */ 260 public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_First( 261 long tableId, 262 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 263 throws com.liferay.portal.kernel.exception.SystemException, 264 com.liferay.portlet.expando.NoSuchRowException { 265 return getPersistence().findByTableId_First(tableId, orderByComparator); 266 } 267 268 /** 269 * Finds the last expando row in the ordered set where tableId = ?. 270 * 271 * <p> 272 * 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. 273 * </p> 274 * 275 * @param tableId the table id to search with 276 * @param orderByComparator the comparator to order the set by 277 * @return the last matching expando row 278 * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found 279 * @throws SystemException if a system exception occurred 280 */ 281 public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_Last( 282 long tableId, 283 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 284 throws com.liferay.portal.kernel.exception.SystemException, 285 com.liferay.portlet.expando.NoSuchRowException { 286 return getPersistence().findByTableId_Last(tableId, orderByComparator); 287 } 288 289 /** 290 * Finds the expando rows before and after the current expando row in the ordered set where tableId = ?. 291 * 292 * <p> 293 * 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. 294 * </p> 295 * 296 * @param rowId the primary key of the current expando row 297 * @param tableId the table id to search with 298 * @param orderByComparator the comparator to order the set by 299 * @return the previous, current, and next expando row 300 * @throws com.liferay.portlet.expando.NoSuchRowException if a expando row with the primary key could not be found 301 * @throws SystemException if a system exception occurred 302 */ 303 public static com.liferay.portlet.expando.model.ExpandoRow[] findByTableId_PrevAndNext( 304 long rowId, long tableId, 305 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 306 throws com.liferay.portal.kernel.exception.SystemException, 307 com.liferay.portlet.expando.NoSuchRowException { 308 return getPersistence() 309 .findByTableId_PrevAndNext(rowId, tableId, orderByComparator); 310 } 311 312 /** 313 * Finds the expando row where tableId = ? and classPK = ? or throws a {@link com.liferay.portlet.expando.NoSuchRowException} if it could not be found. 314 * 315 * @param tableId the table id to search with 316 * @param classPK the class p k to search with 317 * @return the matching expando row 318 * @throws com.liferay.portlet.expando.NoSuchRowException if a matching expando row could not be found 319 * @throws SystemException if a system exception occurred 320 */ 321 public static com.liferay.portlet.expando.model.ExpandoRow findByT_C( 322 long tableId, long classPK) 323 throws com.liferay.portal.kernel.exception.SystemException, 324 com.liferay.portlet.expando.NoSuchRowException { 325 return getPersistence().findByT_C(tableId, classPK); 326 } 327 328 /** 329 * Finds the expando row where tableId = ? and classPK = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 330 * 331 * @param tableId the table id to search with 332 * @param classPK the class p k to search with 333 * @return the matching expando row, or <code>null</code> if a matching expando row could not be found 334 * @throws SystemException if a system exception occurred 335 */ 336 public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C( 337 long tableId, long classPK) 338 throws com.liferay.portal.kernel.exception.SystemException { 339 return getPersistence().fetchByT_C(tableId, classPK); 340 } 341 342 /** 343 * Finds the expando row where tableId = ? and classPK = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 344 * 345 * @param tableId the table id to search with 346 * @param classPK the class p k to search with 347 * @return the matching expando row, or <code>null</code> if a matching expando row could not be found 348 * @throws SystemException if a system exception occurred 349 */ 350 public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C( 351 long tableId, long classPK, boolean retrieveFromCache) 352 throws com.liferay.portal.kernel.exception.SystemException { 353 return getPersistence().fetchByT_C(tableId, classPK, retrieveFromCache); 354 } 355 356 /** 357 * Finds all the expando rows. 358 * 359 * @return the expando rows 360 * @throws SystemException if a system exception occurred 361 */ 362 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll() 363 throws com.liferay.portal.kernel.exception.SystemException { 364 return getPersistence().findAll(); 365 } 366 367 /** 368 * Finds a range of all the expando rows. 369 * 370 * <p> 371 * 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. 372 * </p> 373 * 374 * @param start the lower bound of the range of expando rows to return 375 * @param end the upper bound of the range of expando rows to return (not inclusive) 376 * @return the range of expando rows 377 * @throws SystemException if a system exception occurred 378 */ 379 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll( 380 int start, int end) 381 throws com.liferay.portal.kernel.exception.SystemException { 382 return getPersistence().findAll(start, end); 383 } 384 385 /** 386 * Finds an ordered 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 to return 393 * @param end the upper bound of the range of expando rows to return (not inclusive) 394 * @param orderByComparator the comparator to order the results by 395 * @return the ordered range of expando rows 396 * @throws SystemException if a system exception occurred 397 */ 398 public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll( 399 int start, int end, 400 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 401 throws com.liferay.portal.kernel.exception.SystemException { 402 return getPersistence().findAll(start, end, orderByComparator); 403 } 404 405 /** 406 * Removes all the expando rows where tableId = ? from the database. 407 * 408 * @param tableId the table id to search with 409 * @throws SystemException if a system exception occurred 410 */ 411 public static void removeByTableId(long tableId) 412 throws com.liferay.portal.kernel.exception.SystemException { 413 getPersistence().removeByTableId(tableId); 414 } 415 416 /** 417 * Removes the expando row where tableId = ? and classPK = ? from the database. 418 * 419 * @param tableId the table id to search with 420 * @param classPK the class p k to search with 421 * @throws SystemException if a system exception occurred 422 */ 423 public static void removeByT_C(long tableId, long classPK) 424 throws com.liferay.portal.kernel.exception.SystemException, 425 com.liferay.portlet.expando.NoSuchRowException { 426 getPersistence().removeByT_C(tableId, classPK); 427 } 428 429 /** 430 * Removes all the expando rows from the database. 431 * 432 * @throws SystemException if a system exception occurred 433 */ 434 public static void removeAll() 435 throws com.liferay.portal.kernel.exception.SystemException { 436 getPersistence().removeAll(); 437 } 438 439 /** 440 * Counts all the expando rows where tableId = ?. 441 * 442 * @param tableId the table id to search with 443 * @return the number of matching expando rows 444 * @throws SystemException if a system exception occurred 445 */ 446 public static int countByTableId(long tableId) 447 throws com.liferay.portal.kernel.exception.SystemException { 448 return getPersistence().countByTableId(tableId); 449 } 450 451 /** 452 * Counts all the expando rows where tableId = ? and classPK = ?. 453 * 454 * @param tableId the table id to search with 455 * @param classPK the class p k to search with 456 * @return the number of matching expando rows 457 * @throws SystemException if a system exception occurred 458 */ 459 public static int countByT_C(long tableId, long classPK) 460 throws com.liferay.portal.kernel.exception.SystemException { 461 return getPersistence().countByT_C(tableId, classPK); 462 } 463 464 /** 465 * Counts all the expando rows. 466 * 467 * @return the number of expando rows 468 * @throws SystemException if a system exception occurred 469 */ 470 public static int countAll() 471 throws com.liferay.portal.kernel.exception.SystemException { 472 return getPersistence().countAll(); 473 } 474 475 public static ExpandoRowPersistence getPersistence() { 476 if (_persistence == null) { 477 _persistence = (ExpandoRowPersistence)PortalBeanLocatorUtil.locate(ExpandoRowPersistence.class.getName()); 478 } 479 480 return _persistence; 481 } 482 483 public void setPersistence(ExpandoRowPersistence persistence) { 484 _persistence = persistence; 485 } 486 487 private static ExpandoRowPersistence _persistence; 488 }