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