001 /** 002 * Copyright (c) 2000-2012 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 * <p> 246 * 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. 247 * </p> 248 * 249 * @param type the type 250 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 251 * @return the first matching list type 252 * @throws com.liferay.portal.NoSuchListTypeException if a matching list type could not be found 253 * @throws SystemException if a system exception occurred 254 */ 255 public static com.liferay.portal.model.ListType findByType_First( 256 java.lang.String type, 257 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 258 throws com.liferay.portal.NoSuchListTypeException, 259 com.liferay.portal.kernel.exception.SystemException { 260 return getPersistence().findByType_First(type, orderByComparator); 261 } 262 263 /** 264 * Returns the last list type in the ordered set where type = ?. 265 * 266 * <p> 267 * 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. 268 * </p> 269 * 270 * @param type the type 271 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 272 * @return the last matching list type 273 * @throws com.liferay.portal.NoSuchListTypeException if a matching list type could not be found 274 * @throws SystemException if a system exception occurred 275 */ 276 public static com.liferay.portal.model.ListType findByType_Last( 277 java.lang.String type, 278 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 279 throws com.liferay.portal.NoSuchListTypeException, 280 com.liferay.portal.kernel.exception.SystemException { 281 return getPersistence().findByType_Last(type, orderByComparator); 282 } 283 284 /** 285 * Returns the list types before and after the current list type in the ordered set where type = ?. 286 * 287 * <p> 288 * 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. 289 * </p> 290 * 291 * @param listTypeId the primary key of the current list type 292 * @param type the type 293 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 294 * @return the previous, current, and next list type 295 * @throws com.liferay.portal.NoSuchListTypeException if a list type with the primary key could not be found 296 * @throws SystemException if a system exception occurred 297 */ 298 public static com.liferay.portal.model.ListType[] findByType_PrevAndNext( 299 int listTypeId, java.lang.String type, 300 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 301 throws com.liferay.portal.NoSuchListTypeException, 302 com.liferay.portal.kernel.exception.SystemException { 303 return getPersistence() 304 .findByType_PrevAndNext(listTypeId, type, orderByComparator); 305 } 306 307 /** 308 * Returns all the list types. 309 * 310 * @return the list types 311 * @throws SystemException if a system exception occurred 312 */ 313 public static java.util.List<com.liferay.portal.model.ListType> findAll() 314 throws com.liferay.portal.kernel.exception.SystemException { 315 return getPersistence().findAll(); 316 } 317 318 /** 319 * Returns a range of all the list types. 320 * 321 * <p> 322 * 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. 323 * </p> 324 * 325 * @param start the lower bound of the range of list types 326 * @param end the upper bound of the range of list types (not inclusive) 327 * @return the range of list types 328 * @throws SystemException if a system exception occurred 329 */ 330 public static java.util.List<com.liferay.portal.model.ListType> findAll( 331 int start, int end) 332 throws com.liferay.portal.kernel.exception.SystemException { 333 return getPersistence().findAll(start, end); 334 } 335 336 /** 337 * Returns an ordered 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 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 346 * @return the ordered range of list types 347 * @throws SystemException if a system exception occurred 348 */ 349 public static java.util.List<com.liferay.portal.model.ListType> findAll( 350 int start, int end, 351 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 352 throws com.liferay.portal.kernel.exception.SystemException { 353 return getPersistence().findAll(start, end, orderByComparator); 354 } 355 356 /** 357 * Removes all the list types where type = ? from the database. 358 * 359 * @param type the type 360 * @throws SystemException if a system exception occurred 361 */ 362 public static void removeByType(java.lang.String type) 363 throws com.liferay.portal.kernel.exception.SystemException { 364 getPersistence().removeByType(type); 365 } 366 367 /** 368 * Removes all the list types from the database. 369 * 370 * @throws SystemException if a system exception occurred 371 */ 372 public static void removeAll() 373 throws com.liferay.portal.kernel.exception.SystemException { 374 getPersistence().removeAll(); 375 } 376 377 /** 378 * Returns the number of list types where type = ?. 379 * 380 * @param type the type 381 * @return the number of matching list types 382 * @throws SystemException if a system exception occurred 383 */ 384 public static int countByType(java.lang.String type) 385 throws com.liferay.portal.kernel.exception.SystemException { 386 return getPersistence().countByType(type); 387 } 388 389 /** 390 * Returns the number of list types. 391 * 392 * @return the number of list types 393 * @throws SystemException if a system exception occurred 394 */ 395 public static int countAll() 396 throws com.liferay.portal.kernel.exception.SystemException { 397 return getPersistence().countAll(); 398 } 399 400 public static ListTypePersistence getPersistence() { 401 if (_persistence == null) { 402 _persistence = (ListTypePersistence)PortalBeanLocatorUtil.locate(ListTypePersistence.class.getName()); 403 404 ReferenceRegistry.registerReference(ListTypeUtil.class, 405 "_persistence"); 406 } 407 408 return _persistence; 409 } 410 411 public void setPersistence(ListTypePersistence persistence) { 412 _persistence = persistence; 413 414 ReferenceRegistry.registerReference(ListTypeUtil.class, "_persistence"); 415 } 416 417 private static ListTypePersistence _persistence; 418 }