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