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 com.liferay.portlet.expando.service.persistence.impl.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 com.liferay.portlet.expando.service.persistence.impl.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 List<ExpandoTable> findByC_C(long companyId, long classNameId) { 120 return getPersistence().findByC_C(companyId, classNameId); 121 } 122 123 /** 124 * Returns a range of all the expando tables where companyId = ? and classNameId = ?. 125 * 126 * <p> 127 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 128 * </p> 129 * 130 * @param companyId the company ID 131 * @param classNameId the class name ID 132 * @param start the lower bound of the range of expando tables 133 * @param end the upper bound of the range of expando tables (not inclusive) 134 * @return the range of matching expando tables 135 */ 136 public static List<ExpandoTable> findByC_C(long companyId, 137 long classNameId, int start, int end) { 138 return getPersistence().findByC_C(companyId, classNameId, start, end); 139 } 140 141 /** 142 * Returns an ordered range of all the expando tables where companyId = ? and classNameId = ?. 143 * 144 * <p> 145 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 146 * </p> 147 * 148 * @param companyId the company ID 149 * @param classNameId the class name ID 150 * @param start the lower bound of the range of expando tables 151 * @param end the upper bound of the range of expando tables (not inclusive) 152 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 153 * @return the ordered range of matching expando tables 154 */ 155 public static List<ExpandoTable> findByC_C(long companyId, 156 long classNameId, int start, int end, 157 OrderByComparator<ExpandoTable> orderByComparator) { 158 return getPersistence() 159 .findByC_C(companyId, classNameId, start, end, 160 orderByComparator); 161 } 162 163 /** 164 * Returns the first expando table in the ordered set where companyId = ? and classNameId = ?. 165 * 166 * @param companyId the company ID 167 * @param classNameId the class name ID 168 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 169 * @return the first matching expando table 170 * @throws NoSuchTableException if a matching expando table could not be found 171 */ 172 public static ExpandoTable findByC_C_First(long companyId, 173 long classNameId, OrderByComparator<ExpandoTable> orderByComparator) 174 throws com.liferay.portlet.expando.NoSuchTableException { 175 return getPersistence() 176 .findByC_C_First(companyId, classNameId, orderByComparator); 177 } 178 179 /** 180 * Returns the first expando table in the ordered set where companyId = ? and classNameId = ?. 181 * 182 * @param companyId the company ID 183 * @param classNameId the class name ID 184 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 185 * @return the first matching expando table, or <code>null</code> if a matching expando table could not be found 186 */ 187 public static ExpandoTable fetchByC_C_First(long companyId, 188 long classNameId, OrderByComparator<ExpandoTable> orderByComparator) { 189 return getPersistence() 190 .fetchByC_C_First(companyId, classNameId, orderByComparator); 191 } 192 193 /** 194 * Returns the last expando table in the ordered set where companyId = ? and classNameId = ?. 195 * 196 * @param companyId the company ID 197 * @param classNameId the class name ID 198 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 199 * @return the last matching expando table 200 * @throws NoSuchTableException if a matching expando table could not be found 201 */ 202 public static ExpandoTable findByC_C_Last(long companyId, long classNameId, 203 OrderByComparator<ExpandoTable> orderByComparator) 204 throws com.liferay.portlet.expando.NoSuchTableException { 205 return getPersistence() 206 .findByC_C_Last(companyId, classNameId, orderByComparator); 207 } 208 209 /** 210 * Returns the last expando table in the ordered set where companyId = ? and classNameId = ?. 211 * 212 * @param companyId the company ID 213 * @param classNameId the class name ID 214 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 215 * @return the last matching expando table, or <code>null</code> if a matching expando table could not be found 216 */ 217 public static ExpandoTable fetchByC_C_Last(long companyId, 218 long classNameId, OrderByComparator<ExpandoTable> orderByComparator) { 219 return getPersistence() 220 .fetchByC_C_Last(companyId, classNameId, orderByComparator); 221 } 222 223 /** 224 * Returns the expando tables before and after the current expando table in the ordered set where companyId = ? and classNameId = ?. 225 * 226 * @param tableId the primary key of the current expando table 227 * @param companyId the company ID 228 * @param classNameId the class name ID 229 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 230 * @return the previous, current, and next expando table 231 * @throws NoSuchTableException if a expando table with the primary key could not be found 232 */ 233 public static ExpandoTable[] findByC_C_PrevAndNext(long tableId, 234 long companyId, long classNameId, 235 OrderByComparator<ExpandoTable> orderByComparator) 236 throws com.liferay.portlet.expando.NoSuchTableException { 237 return getPersistence() 238 .findByC_C_PrevAndNext(tableId, companyId, classNameId, 239 orderByComparator); 240 } 241 242 /** 243 * Removes all the expando tables where companyId = ? and classNameId = ? from the database. 244 * 245 * @param companyId the company ID 246 * @param classNameId the class name ID 247 */ 248 public static void removeByC_C(long companyId, long classNameId) { 249 getPersistence().removeByC_C(companyId, classNameId); 250 } 251 252 /** 253 * Returns the number of expando tables where companyId = ? and classNameId = ?. 254 * 255 * @param companyId the company ID 256 * @param classNameId the class name ID 257 * @return the number of matching expando tables 258 */ 259 public static int countByC_C(long companyId, long classNameId) { 260 return getPersistence().countByC_C(companyId, classNameId); 261 } 262 263 /** 264 * Returns the expando table where companyId = ? and classNameId = ? and name = ? or throws a {@link NoSuchTableException} if it could not be found. 265 * 266 * @param companyId the company ID 267 * @param classNameId the class name ID 268 * @param name the name 269 * @return the matching expando table 270 * @throws NoSuchTableException if a matching expando table could not be found 271 */ 272 public static ExpandoTable findByC_C_N(long companyId, long classNameId, 273 java.lang.String name) 274 throws com.liferay.portlet.expando.NoSuchTableException { 275 return getPersistence().findByC_C_N(companyId, classNameId, name); 276 } 277 278 /** 279 * 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. 280 * 281 * @param companyId the company ID 282 * @param classNameId the class name ID 283 * @param name the name 284 * @return the matching expando table, or <code>null</code> if a matching expando table could not be found 285 */ 286 public static ExpandoTable fetchByC_C_N(long companyId, long classNameId, 287 java.lang.String name) { 288 return getPersistence().fetchByC_C_N(companyId, classNameId, name); 289 } 290 291 /** 292 * 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. 293 * 294 * @param companyId the company ID 295 * @param classNameId the class name ID 296 * @param name the name 297 * @param retrieveFromCache whether to use the finder cache 298 * @return the matching expando table, or <code>null</code> if a matching expando table could not be found 299 */ 300 public static ExpandoTable fetchByC_C_N(long companyId, long classNameId, 301 java.lang.String name, boolean retrieveFromCache) { 302 return getPersistence() 303 .fetchByC_C_N(companyId, classNameId, name, retrieveFromCache); 304 } 305 306 /** 307 * Removes the expando table where companyId = ? and classNameId = ? and name = ? from the database. 308 * 309 * @param companyId the company ID 310 * @param classNameId the class name ID 311 * @param name the name 312 * @return the expando table that was removed 313 */ 314 public static ExpandoTable removeByC_C_N(long companyId, long classNameId, 315 java.lang.String name) 316 throws com.liferay.portlet.expando.NoSuchTableException { 317 return getPersistence().removeByC_C_N(companyId, classNameId, name); 318 } 319 320 /** 321 * Returns the number of expando tables where companyId = ? and classNameId = ? and name = ?. 322 * 323 * @param companyId the company ID 324 * @param classNameId the class name ID 325 * @param name the name 326 * @return the number of matching expando tables 327 */ 328 public static int countByC_C_N(long companyId, long classNameId, 329 java.lang.String name) { 330 return getPersistence().countByC_C_N(companyId, classNameId, name); 331 } 332 333 /** 334 * Caches the expando table in the entity cache if it is enabled. 335 * 336 * @param expandoTable the expando table 337 */ 338 public static void cacheResult(ExpandoTable expandoTable) { 339 getPersistence().cacheResult(expandoTable); 340 } 341 342 /** 343 * Caches the expando tables in the entity cache if it is enabled. 344 * 345 * @param expandoTables the expando tables 346 */ 347 public static void cacheResult(List<ExpandoTable> expandoTables) { 348 getPersistence().cacheResult(expandoTables); 349 } 350 351 /** 352 * Creates a new expando table with the primary key. Does not add the expando table to the database. 353 * 354 * @param tableId the primary key for the new expando table 355 * @return the new expando table 356 */ 357 public static ExpandoTable create(long tableId) { 358 return getPersistence().create(tableId); 359 } 360 361 /** 362 * Removes the expando table with the primary key from the database. Also notifies the appropriate model listeners. 363 * 364 * @param tableId the primary key of the expando table 365 * @return the expando table that was removed 366 * @throws NoSuchTableException if a expando table with the primary key could not be found 367 */ 368 public static ExpandoTable remove(long tableId) 369 throws com.liferay.portlet.expando.NoSuchTableException { 370 return getPersistence().remove(tableId); 371 } 372 373 public static ExpandoTable updateImpl(ExpandoTable expandoTable) { 374 return getPersistence().updateImpl(expandoTable); 375 } 376 377 /** 378 * Returns the expando table with the primary key or throws a {@link NoSuchTableException} if it could not be found. 379 * 380 * @param tableId the primary key of the expando table 381 * @return the expando table 382 * @throws NoSuchTableException if a expando table with the primary key could not be found 383 */ 384 public static ExpandoTable findByPrimaryKey(long tableId) 385 throws com.liferay.portlet.expando.NoSuchTableException { 386 return getPersistence().findByPrimaryKey(tableId); 387 } 388 389 /** 390 * Returns the expando table with the primary key or returns <code>null</code> if it could not be found. 391 * 392 * @param tableId the primary key of the expando table 393 * @return the expando table, or <code>null</code> if a expando table with the primary key could not be found 394 */ 395 public static ExpandoTable fetchByPrimaryKey(long tableId) { 396 return getPersistence().fetchByPrimaryKey(tableId); 397 } 398 399 public static java.util.Map<java.io.Serializable, ExpandoTable> fetchByPrimaryKeys( 400 java.util.Set<java.io.Serializable> primaryKeys) { 401 return getPersistence().fetchByPrimaryKeys(primaryKeys); 402 } 403 404 /** 405 * Returns all the expando tables. 406 * 407 * @return the expando tables 408 */ 409 public static List<ExpandoTable> findAll() { 410 return getPersistence().findAll(); 411 } 412 413 /** 414 * Returns a range of all the expando tables. 415 * 416 * <p> 417 * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 418 * </p> 419 * 420 * @param start the lower bound of the range of expando tables 421 * @param end the upper bound of the range of expando tables (not inclusive) 422 * @return the range of expando tables 423 */ 424 public static List<ExpandoTable> findAll(int start, int end) { 425 return getPersistence().findAll(start, end); 426 } 427 428 /** 429 * Returns an ordered range of all the expando tables. 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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. 433 * </p> 434 * 435 * @param start the lower bound of the range of expando tables 436 * @param end the upper bound of the range of expando tables (not inclusive) 437 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 438 * @return the ordered range of expando tables 439 */ 440 public static List<ExpandoTable> findAll(int start, int end, 441 OrderByComparator<ExpandoTable> orderByComparator) { 442 return getPersistence().findAll(start, end, orderByComparator); 443 } 444 445 /** 446 * Removes all the expando tables from the database. 447 */ 448 public static void removeAll() { 449 getPersistence().removeAll(); 450 } 451 452 /** 453 * Returns the number of expando tables. 454 * 455 * @return the number of expando tables 456 */ 457 public static int countAll() { 458 return getPersistence().countAll(); 459 } 460 461 public static ExpandoTablePersistence getPersistence() { 462 if (_persistence == null) { 463 _persistence = (ExpandoTablePersistence)PortalBeanLocatorUtil.locate(ExpandoTablePersistence.class.getName()); 464 465 ReferenceRegistry.registerReference(ExpandoTableUtil.class, 466 "_persistence"); 467 } 468 469 return _persistence; 470 } 471 472 /** 473 * @deprecated As of 6.2.0 474 */ 475 @Deprecated 476 public void setPersistence(ExpandoTablePersistence persistence) { 477 } 478 479 private static ExpandoTablePersistence _persistence; 480 }