001 /** 002 * Copyright (c) 2000-2013 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.exception.SystemException; 022 import com.liferay.portal.kernel.util.OrderByComparator; 023 import com.liferay.portal.kernel.util.ReferenceRegistry; 024 import com.liferay.portal.model.ListType; 025 import com.liferay.portal.service.ServiceContext; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the list type service. This utility wraps {@link 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. 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 ListTypePersistence 038 * @see ListTypePersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class ListTypeUtil { 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(ListType listType) { 060 getPersistence().clearCache(listType); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) 067 throws SystemException { 068 return getPersistence().countWithDynamicQuery(dynamicQuery); 069 } 070 071 /** 072 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 073 */ 074 public static List<ListType> findWithDynamicQuery(DynamicQuery dynamicQuery) 075 throws SystemException { 076 return getPersistence().findWithDynamicQuery(dynamicQuery); 077 } 078 079 /** 080 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 081 */ 082 public static List<ListType> findWithDynamicQuery( 083 DynamicQuery dynamicQuery, int start, int end) 084 throws SystemException { 085 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 086 } 087 088 /** 089 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 090 */ 091 public static List<ListType> findWithDynamicQuery( 092 DynamicQuery dynamicQuery, int start, int end, 093 OrderByComparator orderByComparator) throws SystemException { 094 return getPersistence() 095 .findWithDynamicQuery(dynamicQuery, start, end, 096 orderByComparator); 097 } 098 099 /** 100 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 101 */ 102 public static ListType update(ListType listType) throws SystemException { 103 return getPersistence().update(listType); 104 } 105 106 /** 107 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 108 */ 109 public static ListType update(ListType listType, 110 ServiceContext serviceContext) throws SystemException { 111 return getPersistence().update(listType, serviceContext); 112 } 113 114 /** 115 * Returns all the list types where type = ?. 116 * 117 * @param type the type 118 * @return the matching list types 119 * @throws SystemException if a system exception occurred 120 */ 121 public static java.util.List<com.liferay.portal.model.ListType> findByType( 122 java.lang.String type) 123 throws com.liferay.portal.kernel.exception.SystemException { 124 return getPersistence().findByType(type); 125 } 126 127 /** 128 * Returns a range of all the list types where type = ?. 129 * 130 * <p> 131 * 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.portal.model.impl.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. 132 * </p> 133 * 134 * @param type the type 135 * @param start the lower bound of the range of list types 136 * @param end the upper bound of the range of list types (not inclusive) 137 * @return the range of matching list types 138 * @throws SystemException if a system exception occurred 139 */ 140 public static java.util.List<com.liferay.portal.model.ListType> findByType( 141 java.lang.String type, int start, int end) 142 throws com.liferay.portal.kernel.exception.SystemException { 143 return getPersistence().findByType(type, start, end); 144 } 145 146 /** 147 * Returns an ordered range of all the list types where type = ?. 148 * 149 * <p> 150 * 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.portal.model.impl.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. 151 * </p> 152 * 153 * @param type the type 154 * @param start the lower bound of the range of list types 155 * @param end the upper bound of the range of list types (not inclusive) 156 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 157 * @return the ordered range of matching list types 158 * @throws SystemException if a system exception occurred 159 */ 160 public static java.util.List<com.liferay.portal.model.ListType> findByType( 161 java.lang.String type, int start, int end, 162 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 163 throws com.liferay.portal.kernel.exception.SystemException { 164 return getPersistence().findByType(type, start, end, orderByComparator); 165 } 166 167 /** 168 * Returns the first list type in the ordered set where type = ?. 169 * 170 * @param type the type 171 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 172 * @return the first matching list type 173 * @throws com.liferay.portal.NoSuchListTypeException if a matching list type could not be found 174 * @throws SystemException if a system exception occurred 175 */ 176 public static com.liferay.portal.model.ListType findByType_First( 177 java.lang.String type, 178 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 179 throws com.liferay.portal.NoSuchListTypeException, 180 com.liferay.portal.kernel.exception.SystemException { 181 return getPersistence().findByType_First(type, orderByComparator); 182 } 183 184 /** 185 * Returns the first list type in the ordered set where type = ?. 186 * 187 * @param type the type 188 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 189 * @return the first matching list type, or <code>null</code> if a matching list type could not be found 190 * @throws SystemException if a system exception occurred 191 */ 192 public static com.liferay.portal.model.ListType fetchByType_First( 193 java.lang.String type, 194 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 195 throws com.liferay.portal.kernel.exception.SystemException { 196 return getPersistence().fetchByType_First(type, orderByComparator); 197 } 198 199 /** 200 * Returns the last list type in the ordered set where type = ?. 201 * 202 * @param type the type 203 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 204 * @return the last matching list type 205 * @throws com.liferay.portal.NoSuchListTypeException if a matching list type could not be found 206 * @throws SystemException if a system exception occurred 207 */ 208 public static com.liferay.portal.model.ListType findByType_Last( 209 java.lang.String type, 210 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 211 throws com.liferay.portal.NoSuchListTypeException, 212 com.liferay.portal.kernel.exception.SystemException { 213 return getPersistence().findByType_Last(type, orderByComparator); 214 } 215 216 /** 217 * Returns the last list type in the ordered set where type = ?. 218 * 219 * @param type the type 220 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 221 * @return the last matching list type, or <code>null</code> if a matching list type could not be found 222 * @throws SystemException if a system exception occurred 223 */ 224 public static com.liferay.portal.model.ListType fetchByType_Last( 225 java.lang.String type, 226 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 227 throws com.liferay.portal.kernel.exception.SystemException { 228 return getPersistence().fetchByType_Last(type, orderByComparator); 229 } 230 231 /** 232 * Returns the list types before and after the current list type in the ordered set where type = ?. 233 * 234 * @param listTypeId the primary key of the current list type 235 * @param type the type 236 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 237 * @return the previous, current, and next list type 238 * @throws com.liferay.portal.NoSuchListTypeException if a list type with the primary key could not be found 239 * @throws SystemException if a system exception occurred 240 */ 241 public static com.liferay.portal.model.ListType[] findByType_PrevAndNext( 242 int listTypeId, java.lang.String type, 243 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 244 throws com.liferay.portal.NoSuchListTypeException, 245 com.liferay.portal.kernel.exception.SystemException { 246 return getPersistence() 247 .findByType_PrevAndNext(listTypeId, type, orderByComparator); 248 } 249 250 /** 251 * Removes all the list types where type = ? from the database. 252 * 253 * @param type the type 254 * @throws SystemException if a system exception occurred 255 */ 256 public static void removeByType(java.lang.String type) 257 throws com.liferay.portal.kernel.exception.SystemException { 258 getPersistence().removeByType(type); 259 } 260 261 /** 262 * Returns the number of list types where type = ?. 263 * 264 * @param type the type 265 * @return the number of matching list types 266 * @throws SystemException if a system exception occurred 267 */ 268 public static int countByType(java.lang.String type) 269 throws com.liferay.portal.kernel.exception.SystemException { 270 return getPersistence().countByType(type); 271 } 272 273 /** 274 * Caches the list type in the entity cache if it is enabled. 275 * 276 * @param listType the list type 277 */ 278 public static void cacheResult(com.liferay.portal.model.ListType listType) { 279 getPersistence().cacheResult(listType); 280 } 281 282 /** 283 * Caches the list types in the entity cache if it is enabled. 284 * 285 * @param listTypes the list types 286 */ 287 public static void cacheResult( 288 java.util.List<com.liferay.portal.model.ListType> listTypes) { 289 getPersistence().cacheResult(listTypes); 290 } 291 292 /** 293 * Creates a new list type with the primary key. Does not add the list type to the database. 294 * 295 * @param listTypeId the primary key for the new list type 296 * @return the new list type 297 */ 298 public static com.liferay.portal.model.ListType create(int listTypeId) { 299 return getPersistence().create(listTypeId); 300 } 301 302 /** 303 * Removes the list type with the primary key from the database. Also notifies the appropriate model listeners. 304 * 305 * @param listTypeId the primary key of the list type 306 * @return the list type that was removed 307 * @throws com.liferay.portal.NoSuchListTypeException if a list type with the primary key could not be found 308 * @throws SystemException if a system exception occurred 309 */ 310 public static com.liferay.portal.model.ListType remove(int listTypeId) 311 throws com.liferay.portal.NoSuchListTypeException, 312 com.liferay.portal.kernel.exception.SystemException { 313 return getPersistence().remove(listTypeId); 314 } 315 316 public static com.liferay.portal.model.ListType updateImpl( 317 com.liferay.portal.model.ListType listType) 318 throws com.liferay.portal.kernel.exception.SystemException { 319 return getPersistence().updateImpl(listType); 320 } 321 322 /** 323 * Returns the list type with the primary key or throws a {@link com.liferay.portal.NoSuchListTypeException} if it could not be found. 324 * 325 * @param listTypeId the primary key of the list type 326 * @return the list type 327 * @throws com.liferay.portal.NoSuchListTypeException if a list type with the primary key could not be found 328 * @throws SystemException if a system exception occurred 329 */ 330 public static com.liferay.portal.model.ListType findByPrimaryKey( 331 int listTypeId) 332 throws com.liferay.portal.NoSuchListTypeException, 333 com.liferay.portal.kernel.exception.SystemException { 334 return getPersistence().findByPrimaryKey(listTypeId); 335 } 336 337 /** 338 * Returns the list type with the primary key or returns <code>null</code> if it could not be found. 339 * 340 * @param listTypeId the primary key of the list type 341 * @return the list type, or <code>null</code> if a list type with the primary key could not be found 342 * @throws SystemException if a system exception occurred 343 */ 344 public static com.liferay.portal.model.ListType fetchByPrimaryKey( 345 int listTypeId) 346 throws com.liferay.portal.kernel.exception.SystemException { 347 return getPersistence().fetchByPrimaryKey(listTypeId); 348 } 349 350 /** 351 * Returns all the list types. 352 * 353 * @return the list types 354 * @throws SystemException if a system exception occurred 355 */ 356 public static java.util.List<com.liferay.portal.model.ListType> findAll() 357 throws com.liferay.portal.kernel.exception.SystemException { 358 return getPersistence().findAll(); 359 } 360 361 /** 362 * Returns a range of all the list types. 363 * 364 * <p> 365 * 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.portal.model.impl.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. 366 * </p> 367 * 368 * @param start the lower bound of the range of list types 369 * @param end the upper bound of the range of list types (not inclusive) 370 * @return the range of list types 371 * @throws SystemException if a system exception occurred 372 */ 373 public static java.util.List<com.liferay.portal.model.ListType> findAll( 374 int start, int end) 375 throws com.liferay.portal.kernel.exception.SystemException { 376 return getPersistence().findAll(start, end); 377 } 378 379 /** 380 * Returns an ordered range of all the list types. 381 * 382 * <p> 383 * 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.portal.model.impl.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. 384 * </p> 385 * 386 * @param start the lower bound of the range of list types 387 * @param end the upper bound of the range of list types (not inclusive) 388 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 389 * @return the ordered range of list types 390 * @throws SystemException if a system exception occurred 391 */ 392 public static java.util.List<com.liferay.portal.model.ListType> findAll( 393 int start, int end, 394 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 395 throws com.liferay.portal.kernel.exception.SystemException { 396 return getPersistence().findAll(start, end, orderByComparator); 397 } 398 399 /** 400 * Removes all the list types from the database. 401 * 402 * @throws SystemException if a system exception occurred 403 */ 404 public static void removeAll() 405 throws com.liferay.portal.kernel.exception.SystemException { 406 getPersistence().removeAll(); 407 } 408 409 /** 410 * Returns the number of list types. 411 * 412 * @return the number of list types 413 * @throws SystemException if a system exception occurred 414 */ 415 public static int countAll() 416 throws com.liferay.portal.kernel.exception.SystemException { 417 return getPersistence().countAll(); 418 } 419 420 public static ListTypePersistence getPersistence() { 421 if (_persistence == null) { 422 _persistence = (ListTypePersistence)PortalBeanLocatorUtil.locate(ListTypePersistence.class.getName()); 423 424 ReferenceRegistry.registerReference(ListTypeUtil.class, 425 "_persistence"); 426 } 427 428 return _persistence; 429 } 430 431 /** 432 * @deprecated As of 6.2.0 433 */ 434 public void setPersistence(ListTypePersistence persistence) { 435 } 436 437 private static ListTypePersistence _persistence; 438 }