001 /** 002 * Copyright (c) 2000-2010 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.model.ListType; 022 import com.liferay.portal.service.ServiceContext; 023 024 import java.util.List; 025 026 /** 027 * The persistence utility for the list type service. 028 * 029 * <p> 030 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class. 031 * </p> 032 * 033 * @author Brian Wing Shun Chan 034 * @see ListTypePersistence 035 * @see ListTypePersistenceImpl 036 * @generated 037 */ 038 public class ListTypeUtil { 039 /** 040 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 041 */ 042 public static void clearCache() { 043 getPersistence().clearCache(); 044 } 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 048 */ 049 public static void clearCache(ListType listType) { 050 getPersistence().clearCache(listType); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 055 */ 056 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 057 throws SystemException { 058 return getPersistence().countWithDynamicQuery(dynamicQuery); 059 } 060 061 /** 062 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 063 */ 064 public static List<ListType> findWithDynamicQuery(DynamicQuery dynamicQuery) 065 throws SystemException { 066 return getPersistence().findWithDynamicQuery(dynamicQuery); 067 } 068 069 /** 070 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 071 */ 072 public static List<ListType> findWithDynamicQuery( 073 DynamicQuery dynamicQuery, int start, int end) 074 throws SystemException { 075 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 080 */ 081 public static List<ListType> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end, 083 OrderByComparator orderByComparator) throws SystemException { 084 return getPersistence() 085 .findWithDynamicQuery(dynamicQuery, start, end, 086 orderByComparator); 087 } 088 089 /** 090 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 091 */ 092 public static ListType remove(ListType listType) throws SystemException { 093 return getPersistence().remove(listType); 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 to cache 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 to cache 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. 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 to remove 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 * Finds 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 to find 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 * Finds 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 to find 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 * Finds all the list types where type = ?. 191 * 192 * @param type the type to search with 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 * Finds 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 to search with 210 * @param start the lower bound of the range of list types to return 211 * @param end the upper bound of the range of list types to return (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 * Finds 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 to search with 229 * @param start the lower bound of the range of list types to return 230 * @param end the upper bound of the range of list types to return (not inclusive) 231 * @param orderByComparator the comparator to order the results by 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 * Finds 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 to search with 250 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 271 * @param orderByComparator the comparator to order the set by 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 * Finds 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 to search with 293 * @param orderByComparator the comparator to order the set by 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 * Finds 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 * Finds 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 to return 326 * @param end the upper bound of the range of list types to return (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 * Finds 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 to return 344 * @param end the upper bound of the range of list types to return (not inclusive) 345 * @param orderByComparator the comparator to order the results by 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 to search with 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 * Counts all the list types where type = ?. 379 * 380 * @param type the type to search with 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 * Counts all the 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 405 return _persistence; 406 } 407 408 public void setPersistence(ListTypePersistence persistence) { 409 _persistence = persistence; 410 } 411 412 private static ListTypePersistence _persistence; 413 }