001 /** 002 * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.util.OrderByComparator; 022 import com.liferay.portal.kernel.util.ReferenceRegistry; 023 import com.liferay.portal.service.ServiceContext; 024 025 import com.liferay.portlet.expando.model.ExpandoTable; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the expando table service. This utility wraps {@link ExpandoTablePersistenceImpl} 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. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see ExpandoTablePersistence 038 * @see ExpandoTablePersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class ExpandoTableUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(ExpandoTable expandoTable) { 060 getPersistence().clearCache(expandoTable); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 067 return getPersistence().countWithDynamicQuery(dynamicQuery); 068 } 069 070 /** 071 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 072 */ 073 public static List<ExpandoTable> findWithDynamicQuery( 074 DynamicQuery dynamicQuery) { 075 return getPersistence().findWithDynamicQuery(dynamicQuery); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 080 */ 081 public static List<ExpandoTable> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end) { 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<ExpandoTable> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator<ExpandoTable> orderByComparator) { 092 return getPersistence() 093 .findWithDynamicQuery(dynamicQuery, start, end, 094 orderByComparator); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 099 */ 100 public static ExpandoTable update(ExpandoTable expandoTable) { 101 return getPersistence().update(expandoTable); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static ExpandoTable update(ExpandoTable expandoTable, 108 ServiceContext serviceContext) { 109 return getPersistence().update(expandoTable, serviceContext); 110 } 111 112 /** 113 * Returns all the expando tables where companyId = ? and classNameId = ?. 114 * 115 * @param companyId the company ID 116 * @param classNameId the class name ID 117 * @return the matching expando tables 118 */ 119 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 120 long companyId, long classNameId) { 121 return getPersistence().findByC_C(companyId, classNameId); 122 } 123 124 /** 125 * Returns a range of all the expando tables where companyId = ? and classNameId = ?. 126 * 127 * <p> 128 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoTableModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 129 * </p> 130 * 131 * @param companyId the company ID 132 * @param classNameId the class name ID 133 * @param start the lower bound of the range of expando tables 134 * @param end the upper bound of the range of expando tables (not inclusive) 135 * @return the range of matching expando tables 136 */ 137 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 138 long companyId, long classNameId, int start, int end) { 139 return getPersistence().findByC_C(companyId, classNameId, start, end); 140 } 141 142 /** 143 * Returns an ordered range of all the expando tables where companyId = ? and classNameId = ?. 144 * 145 * <p> 146 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoTableModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 147 * </p> 148 * 149 * @param companyId the company ID 150 * @param classNameId the class name ID 151 * @param start the lower bound of the range of expando tables 152 * @param end the upper bound of the range of expando tables (not inclusive) 153 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 154 * @return the ordered range of matching expando tables 155 */ 156 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findByC_C( 157 long companyId, long classNameId, int start, int end, 158 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.expando.model.ExpandoTable> orderByComparator) { 159 return getPersistence() 160 .findByC_C(companyId, classNameId, start, end, 161 orderByComparator); 162 } 163 164 /** 165 * Returns the first expando table in the ordered set where companyId = ? and classNameId = ?. 166 * 167 * @param companyId the company ID 168 * @param classNameId the class name ID 169 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 170 * @return the first matching expando table 171 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 172 */ 173 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_First( 174 long companyId, long classNameId, 175 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.expando.model.ExpandoTable> orderByComparator) 176 throws com.liferay.portlet.expando.NoSuchTableException { 177 return getPersistence() 178 .findByC_C_First(companyId, classNameId, orderByComparator); 179 } 180 181 /** 182 * Returns the first expando table in the ordered set where companyId = ? and classNameId = ?. 183 * 184 * @param companyId the company ID 185 * @param classNameId the class name ID 186 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 187 * @return the first matching expando table, or <code>null</code> if a matching expando table could not be found 188 */ 189 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_First( 190 long companyId, long classNameId, 191 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.expando.model.ExpandoTable> orderByComparator) { 192 return getPersistence() 193 .fetchByC_C_First(companyId, classNameId, orderByComparator); 194 } 195 196 /** 197 * Returns the last expando table in the ordered set where companyId = ? and classNameId = ?. 198 * 199 * @param companyId the company ID 200 * @param classNameId the class name ID 201 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 202 * @return the last matching expando table 203 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 204 */ 205 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_Last( 206 long companyId, long classNameId, 207 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.expando.model.ExpandoTable> orderByComparator) 208 throws com.liferay.portlet.expando.NoSuchTableException { 209 return getPersistence() 210 .findByC_C_Last(companyId, classNameId, orderByComparator); 211 } 212 213 /** 214 * Returns the last expando table in the ordered set where companyId = ? and classNameId = ?. 215 * 216 * @param companyId the company ID 217 * @param classNameId the class name ID 218 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 219 * @return the last matching expando table, or <code>null</code> if a matching expando table could not be found 220 */ 221 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_Last( 222 long companyId, long classNameId, 223 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.expando.model.ExpandoTable> orderByComparator) { 224 return getPersistence() 225 .fetchByC_C_Last(companyId, classNameId, orderByComparator); 226 } 227 228 /** 229 * Returns the expando tables before and after the current expando table in the ordered set where companyId = ? and classNameId = ?. 230 * 231 * @param tableId the primary key of the current expando table 232 * @param companyId the company ID 233 * @param classNameId the class name ID 234 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 235 * @return the previous, current, and next expando table 236 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 237 */ 238 public static com.liferay.portlet.expando.model.ExpandoTable[] findByC_C_PrevAndNext( 239 long tableId, long companyId, long classNameId, 240 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.expando.model.ExpandoTable> orderByComparator) 241 throws com.liferay.portlet.expando.NoSuchTableException { 242 return getPersistence() 243 .findByC_C_PrevAndNext(tableId, companyId, classNameId, 244 orderByComparator); 245 } 246 247 /** 248 * Removes all the expando tables where companyId = ? and classNameId = ? from the database. 249 * 250 * @param companyId the company ID 251 * @param classNameId the class name ID 252 */ 253 public static void removeByC_C(long companyId, long classNameId) { 254 getPersistence().removeByC_C(companyId, classNameId); 255 } 256 257 /** 258 * Returns the number of expando tables where companyId = ? and classNameId = ?. 259 * 260 * @param companyId the company ID 261 * @param classNameId the class name ID 262 * @return the number of matching expando tables 263 */ 264 public static int countByC_C(long companyId, long classNameId) { 265 return getPersistence().countByC_C(companyId, classNameId); 266 } 267 268 /** 269 * Returns the expando table where companyId = ? and classNameId = ? and name = ? or throws a {@link com.liferay.portlet.expando.NoSuchTableException} if it could not be found. 270 * 271 * @param companyId the company ID 272 * @param classNameId the class name ID 273 * @param name the name 274 * @return the matching expando table 275 * @throws com.liferay.portlet.expando.NoSuchTableException if a matching expando table could not be found 276 */ 277 public static com.liferay.portlet.expando.model.ExpandoTable findByC_C_N( 278 long companyId, long classNameId, java.lang.String name) 279 throws com.liferay.portlet.expando.NoSuchTableException { 280 return getPersistence().findByC_C_N(companyId, classNameId, name); 281 } 282 283 /** 284 * Returns the expando table where companyId = ? and classNameId = ? and name = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 285 * 286 * @param companyId the company ID 287 * @param classNameId the class name ID 288 * @param name the name 289 * @return the matching expando table, or <code>null</code> if a matching expando table could not be found 290 */ 291 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N( 292 long companyId, long classNameId, java.lang.String name) { 293 return getPersistence().fetchByC_C_N(companyId, classNameId, name); 294 } 295 296 /** 297 * Returns the expando table where companyId = ? and classNameId = ? and name = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 298 * 299 * @param companyId the company ID 300 * @param classNameId the class name ID 301 * @param name the name 302 * @param retrieveFromCache whether to use the finder cache 303 * @return the matching expando table, or <code>null</code> if a matching expando table could not be found 304 */ 305 public static com.liferay.portlet.expando.model.ExpandoTable fetchByC_C_N( 306 long companyId, long classNameId, java.lang.String name, 307 boolean retrieveFromCache) { 308 return getPersistence() 309 .fetchByC_C_N(companyId, classNameId, name, retrieveFromCache); 310 } 311 312 /** 313 * Removes the expando table where companyId = ? and classNameId = ? and name = ? from the database. 314 * 315 * @param companyId the company ID 316 * @param classNameId the class name ID 317 * @param name the name 318 * @return the expando table that was removed 319 */ 320 public static com.liferay.portlet.expando.model.ExpandoTable removeByC_C_N( 321 long companyId, long classNameId, java.lang.String name) 322 throws com.liferay.portlet.expando.NoSuchTableException { 323 return getPersistence().removeByC_C_N(companyId, classNameId, name); 324 } 325 326 /** 327 * Returns the number of expando tables where companyId = ? and classNameId = ? and name = ?. 328 * 329 * @param companyId the company ID 330 * @param classNameId the class name ID 331 * @param name the name 332 * @return the number of matching expando tables 333 */ 334 public static int countByC_C_N(long companyId, long classNameId, 335 java.lang.String name) { 336 return getPersistence().countByC_C_N(companyId, classNameId, name); 337 } 338 339 /** 340 * Caches the expando table in the entity cache if it is enabled. 341 * 342 * @param expandoTable the expando table 343 */ 344 public static void cacheResult( 345 com.liferay.portlet.expando.model.ExpandoTable expandoTable) { 346 getPersistence().cacheResult(expandoTable); 347 } 348 349 /** 350 * Caches the expando tables in the entity cache if it is enabled. 351 * 352 * @param expandoTables the expando tables 353 */ 354 public static void cacheResult( 355 java.util.List<com.liferay.portlet.expando.model.ExpandoTable> expandoTables) { 356 getPersistence().cacheResult(expandoTables); 357 } 358 359 /** 360 * Creates a new expando table with the primary key. Does not add the expando table to the database. 361 * 362 * @param tableId the primary key for the new expando table 363 * @return the new expando table 364 */ 365 public static com.liferay.portlet.expando.model.ExpandoTable create( 366 long tableId) { 367 return getPersistence().create(tableId); 368 } 369 370 /** 371 * Removes the expando table with the primary key from the database. Also notifies the appropriate model listeners. 372 * 373 * @param tableId the primary key of the expando table 374 * @return the expando table that was removed 375 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 376 */ 377 public static com.liferay.portlet.expando.model.ExpandoTable remove( 378 long tableId) throws com.liferay.portlet.expando.NoSuchTableException { 379 return getPersistence().remove(tableId); 380 } 381 382 public static com.liferay.portlet.expando.model.ExpandoTable updateImpl( 383 com.liferay.portlet.expando.model.ExpandoTable expandoTable) { 384 return getPersistence().updateImpl(expandoTable); 385 } 386 387 /** 388 * Returns the expando table with the primary key or throws a {@link com.liferay.portlet.expando.NoSuchTableException} if it could not be found. 389 * 390 * @param tableId the primary key of the expando table 391 * @return the expando table 392 * @throws com.liferay.portlet.expando.NoSuchTableException if a expando table with the primary key could not be found 393 */ 394 public static com.liferay.portlet.expando.model.ExpandoTable findByPrimaryKey( 395 long tableId) throws com.liferay.portlet.expando.NoSuchTableException { 396 return getPersistence().findByPrimaryKey(tableId); 397 } 398 399 /** 400 * Returns the expando table with the primary key or returns <code>null</code> if it could not be found. 401 * 402 * @param tableId the primary key of the expando table 403 * @return the expando table, or <code>null</code> if a expando table with the primary key could not be found 404 */ 405 public static com.liferay.portlet.expando.model.ExpandoTable fetchByPrimaryKey( 406 long tableId) { 407 return getPersistence().fetchByPrimaryKey(tableId); 408 } 409 410 public static java.util.Map<java.io.Serializable, com.liferay.portlet.expando.model.ExpandoTable> fetchByPrimaryKeys( 411 java.util.Set<java.io.Serializable> primaryKeys) { 412 return getPersistence().fetchByPrimaryKeys(primaryKeys); 413 } 414 415 /** 416 * Returns all the expando tables. 417 * 418 * @return the expando tables 419 */ 420 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll() { 421 return getPersistence().findAll(); 422 } 423 424 /** 425 * Returns a range of all the expando tables. 426 * 427 * <p> 428 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoTableModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 429 * </p> 430 * 431 * @param start the lower bound of the range of expando tables 432 * @param end the upper bound of the range of expando tables (not inclusive) 433 * @return the range of expando tables 434 */ 435 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll( 436 int start, int end) { 437 return getPersistence().findAll(start, end); 438 } 439 440 /** 441 * Returns an ordered range of all the expando tables. 442 * 443 * <p> 444 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoTableModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 445 * </p> 446 * 447 * @param start the lower bound of the range of expando tables 448 * @param end the upper bound of the range of expando tables (not inclusive) 449 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 450 * @return the ordered range of expando tables 451 */ 452 public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> findAll( 453 int start, int end, 454 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.expando.model.ExpandoTable> orderByComparator) { 455 return getPersistence().findAll(start, end, orderByComparator); 456 } 457 458 /** 459 * Removes all the expando tables from the database. 460 */ 461 public static void removeAll() { 462 getPersistence().removeAll(); 463 } 464 465 /** 466 * Returns the number of expando tables. 467 * 468 * @return the number of expando tables 469 */ 470 public static int countAll() { 471 return getPersistence().countAll(); 472 } 473 474 public static ExpandoTablePersistence getPersistence() { 475 if (_persistence == null) { 476 _persistence = (ExpandoTablePersistence)PortalBeanLocatorUtil.locate(ExpandoTablePersistence.class.getName()); 477 478 ReferenceRegistry.registerReference(ExpandoTableUtil.class, 479 "_persistence"); 480 } 481 482 return _persistence; 483 } 484 485 /** 486 * @deprecated As of 6.2.0 487 */ 488 @Deprecated 489 public void setPersistence(ExpandoTablePersistence persistence) { 490 } 491 492 private static ExpandoTablePersistence _persistence; 493 }