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