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