1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="ListTypeUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class ListTypeUtil {
32      public static com.liferay.portal.model.ListType create(int listTypeId) {
33          return getPersistence().create(listTypeId);
34      }
35  
36      public static com.liferay.portal.model.ListType remove(int listTypeId)
37          throws com.liferay.portal.NoSuchListTypeException,
38              com.liferay.portal.SystemException {
39          return getPersistence().remove(listTypeId);
40      }
41  
42      public static com.liferay.portal.model.ListType remove(
43          com.liferay.portal.model.ListType listType)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(listType);
46      }
47  
48      /**
49       * @deprecated Use <code>update(ListType listType, boolean merge)</code>.
50       */
51      public static com.liferay.portal.model.ListType update(
52          com.liferay.portal.model.ListType listType)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(listType);
55      }
56  
57      /**
58       * Add, update, or merge, the entity. This method also calls the model
59       * listeners to trigger the proper events associated with adding, deleting,
60       * or updating an entity.
61       *
62       * @param        listType the entity to add, update, or merge
63       * @param        merge boolean value for whether to merge the entity. The
64       *                default value is false. Setting merge to true is more
65       *                expensive and should only be true when listType is
66       *                transient. See LEP-5473 for a detailed discussion of this
67       *                method.
68       * @return        true if the portlet can be displayed via Ajax
69       */
70      public static com.liferay.portal.model.ListType update(
71          com.liferay.portal.model.ListType listType, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(listType, merge);
74      }
75  
76      public static com.liferay.portal.model.ListType updateImpl(
77          com.liferay.portal.model.ListType listType, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(listType, merge);
80      }
81  
82      public static com.liferay.portal.model.ListType findByPrimaryKey(
83          int listTypeId)
84          throws com.liferay.portal.NoSuchListTypeException,
85              com.liferay.portal.SystemException {
86          return getPersistence().findByPrimaryKey(listTypeId);
87      }
88  
89      public static com.liferay.portal.model.ListType fetchByPrimaryKey(
90          int listTypeId) throws com.liferay.portal.SystemException {
91          return getPersistence().fetchByPrimaryKey(listTypeId);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.ListType> findByType(
95          java.lang.String type) throws com.liferay.portal.SystemException {
96          return getPersistence().findByType(type);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.ListType> findByType(
100         java.lang.String type, int start, int end)
101         throws com.liferay.portal.SystemException {
102         return getPersistence().findByType(type, start, end);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.ListType> findByType(
106         java.lang.String type, int start, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findByType(type, start, end, obc);
110     }
111 
112     public static com.liferay.portal.model.ListType findByType_First(
113         java.lang.String type,
114         com.liferay.portal.kernel.util.OrderByComparator obc)
115         throws com.liferay.portal.NoSuchListTypeException,
116             com.liferay.portal.SystemException {
117         return getPersistence().findByType_First(type, obc);
118     }
119 
120     public static com.liferay.portal.model.ListType findByType_Last(
121         java.lang.String type,
122         com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.NoSuchListTypeException,
124             com.liferay.portal.SystemException {
125         return getPersistence().findByType_Last(type, obc);
126     }
127 
128     public static com.liferay.portal.model.ListType[] findByType_PrevAndNext(
129         int listTypeId, java.lang.String type,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.NoSuchListTypeException,
132             com.liferay.portal.SystemException {
133         return getPersistence().findByType_PrevAndNext(listTypeId, type, obc);
134     }
135 
136     public static java.util.List<Object> findWithDynamicQuery(
137         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
138         throws com.liferay.portal.SystemException {
139         return getPersistence().findWithDynamicQuery(dynamicQuery);
140     }
141 
142     public static java.util.List<Object> findWithDynamicQuery(
143         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
144         int end) throws com.liferay.portal.SystemException {
145         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.ListType> findAll()
149         throws com.liferay.portal.SystemException {
150         return getPersistence().findAll();
151     }
152 
153     public static java.util.List<com.liferay.portal.model.ListType> findAll(
154         int start, int end) throws com.liferay.portal.SystemException {
155         return getPersistence().findAll(start, end);
156     }
157 
158     public static java.util.List<com.liferay.portal.model.ListType> findAll(
159         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
160         throws com.liferay.portal.SystemException {
161         return getPersistence().findAll(start, end, obc);
162     }
163 
164     public static void removeByType(java.lang.String type)
165         throws com.liferay.portal.SystemException {
166         getPersistence().removeByType(type);
167     }
168 
169     public static void removeAll() throws com.liferay.portal.SystemException {
170         getPersistence().removeAll();
171     }
172 
173     public static int countByType(java.lang.String type)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().countByType(type);
176     }
177 
178     public static int countAll() throws com.liferay.portal.SystemException {
179         return getPersistence().countAll();
180     }
181 
182     public static ListTypePersistence getPersistence() {
183         return _persistence;
184     }
185 
186     public void setPersistence(ListTypePersistence persistence) {
187         _persistence = persistence;
188     }
189 
190     private static ListTypePersistence _persistence;
191 }