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