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