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.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 * Finds the expando column where tableId = ? and name = ? or throws a {@link com.liferay.portlet.expando.NoSuchColumnException} if it could not be found. 321 * 322 * @param tableId the table id to search with 323 * @param name the name to search with 324 * @return the matching expando column 325 * @throws com.liferay.portlet.expando.NoSuchColumnException if a matching expando column could not be found 326 * @throws SystemException if a system exception occurred 327 */ 328 public static com.liferay.portlet.expando.model.ExpandoColumn findByT_N( 329 long tableId, java.lang.String name) 330 throws com.liferay.portal.kernel.exception.SystemException, 331 com.liferay.portlet.expando.NoSuchColumnException { 332 return getPersistence().findByT_N(tableId, name); 333 } 334 335 /** 336 * Finds the expando column where tableId = ? and name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 337 * 338 * @param tableId the table id to search with 339 * @param name the name to search with 340 * @return the matching expando column, or <code>null</code> if a matching expando column could not be found 341 * @throws SystemException if a system exception occurred 342 */ 343 public static com.liferay.portlet.expando.model.ExpandoColumn fetchByT_N( 344 long tableId, java.lang.String name) 345 throws com.liferay.portal.kernel.exception.SystemException { 346 return getPersistence().fetchByT_N(tableId, name); 347 } 348 349 /** 350 * Finds the expando column where tableId = ? and name = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 351 * 352 * @param tableId the table id to search with 353 * @param name the name to search with 354 * @return the matching expando column, or <code>null</code> if a matching expando column could not be found 355 * @throws SystemException if a system exception occurred 356 */ 357 public static com.liferay.portlet.expando.model.ExpandoColumn fetchByT_N( 358 long tableId, java.lang.String name, boolean retrieveFromCache) 359 throws com.liferay.portal.kernel.exception.SystemException { 360 return getPersistence().fetchByT_N(tableId, name, retrieveFromCache); 361 } 362 363 /** 364 * Finds all the expando columns. 365 * 366 * @return the expando columns 367 * @throws SystemException if a system exception occurred 368 */ 369 public static java.util.List<com.liferay.portlet.expando.model.ExpandoColumn> findAll() 370 throws com.liferay.portal.kernel.exception.SystemException { 371 return getPersistence().findAll(); 372 } 373 374 /** 375 * Finds a range of all the expando columns. 376 * 377 * <p> 378 * 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. 379 * </p> 380 * 381 * @param start the lower bound of the range of expando columns to return 382 * @param end the upper bound of the range of expando columns to return (not inclusive) 383 * @return the range of expando columns 384 * @throws SystemException if a system exception occurred 385 */ 386 public static java.util.List<com.liferay.portlet.expando.model.ExpandoColumn> findAll( 387 int start, int end) 388 throws com.liferay.portal.kernel.exception.SystemException { 389 return getPersistence().findAll(start, end); 390 } 391 392 /** 393 * Finds an ordered range of all the expando columns. 394 * 395 * <p> 396 * 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. 397 * </p> 398 * 399 * @param start the lower bound of the range of expando columns to return 400 * @param end the upper bound of the range of expando columns to return (not inclusive) 401 * @param orderByComparator the comparator to order the results by 402 * @return the ordered range of expando columns 403 * @throws SystemException if a system exception occurred 404 */ 405 public static java.util.List<com.liferay.portlet.expando.model.ExpandoColumn> findAll( 406 int start, int end, 407 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 408 throws com.liferay.portal.kernel.exception.SystemException { 409 return getPersistence().findAll(start, end, orderByComparator); 410 } 411 412 /** 413 * Removes all the expando columns where tableId = ? from the database. 414 * 415 * @param tableId the table id to search with 416 * @throws SystemException if a system exception occurred 417 */ 418 public static void removeByTableId(long tableId) 419 throws com.liferay.portal.kernel.exception.SystemException { 420 getPersistence().removeByTableId(tableId); 421 } 422 423 /** 424 * Removes the expando column where tableId = ? and name = ? from the database. 425 * 426 * @param tableId the table id to search with 427 * @param name the name to search with 428 * @throws SystemException if a system exception occurred 429 */ 430 public static void removeByT_N(long tableId, java.lang.String name) 431 throws com.liferay.portal.kernel.exception.SystemException, 432 com.liferay.portlet.expando.NoSuchColumnException { 433 getPersistence().removeByT_N(tableId, name); 434 } 435 436 /** 437 * Removes all the expando columns from the database. 438 * 439 * @throws SystemException if a system exception occurred 440 */ 441 public static void removeAll() 442 throws com.liferay.portal.kernel.exception.SystemException { 443 getPersistence().removeAll(); 444 } 445 446 /** 447 * Counts all the expando columns where tableId = ?. 448 * 449 * @param tableId the table id to search with 450 * @return the number of matching expando columns 451 * @throws SystemException if a system exception occurred 452 */ 453 public static int countByTableId(long tableId) 454 throws com.liferay.portal.kernel.exception.SystemException { 455 return getPersistence().countByTableId(tableId); 456 } 457 458 /** 459 * Counts all the expando columns where tableId = ? and name = ?. 460 * 461 * @param tableId the table id to search with 462 * @param name the name to search with 463 * @return the number of matching expando columns 464 * @throws SystemException if a system exception occurred 465 */ 466 public static int countByT_N(long tableId, java.lang.String name) 467 throws com.liferay.portal.kernel.exception.SystemException { 468 return getPersistence().countByT_N(tableId, name); 469 } 470 471 /** 472 * Counts all the expando columns. 473 * 474 * @return the number of expando columns 475 * @throws SystemException if a system exception occurred 476 */ 477 public static int countAll() 478 throws com.liferay.portal.kernel.exception.SystemException { 479 return getPersistence().countAll(); 480 } 481 482 public static ExpandoColumnPersistence getPersistence() { 483 if (_persistence == null) { 484 _persistence = (ExpandoColumnPersistence)PortalBeanLocatorUtil.locate(ExpandoColumnPersistence.class.getName()); 485 } 486 487 return _persistence; 488 } 489 490 public void setPersistence(ExpandoColumnPersistence persistence) { 491 _persistence = persistence; 492 } 493 494 private static ExpandoColumnPersistence _persistence; 495 }