1   /**
2    * Copyright (c) 2000-2008 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="UserTrackerUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class UserTrackerUtil {
32      public static com.liferay.portal.model.UserTracker create(
33          long userTrackerId) {
34          return getPersistence().create(userTrackerId);
35      }
36  
37      public static com.liferay.portal.model.UserTracker remove(
38          long userTrackerId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portal.NoSuchUserTrackerException {
41          return getPersistence().remove(userTrackerId);
42      }
43  
44      public static com.liferay.portal.model.UserTracker remove(
45          com.liferay.portal.model.UserTracker userTracker)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(userTracker);
48      }
49  
50      /**
51       * @deprecated Use <code>update(UserTracker userTracker, boolean merge)</code>.
52       */
53      public static com.liferay.portal.model.UserTracker update(
54          com.liferay.portal.model.UserTracker userTracker)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(userTracker);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        userTracker the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when userTracker is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portal.model.UserTracker update(
73          com.liferay.portal.model.UserTracker userTracker, boolean merge)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(userTracker, merge);
76      }
77  
78      public static com.liferay.portal.model.UserTracker updateImpl(
79          com.liferay.portal.model.UserTracker userTracker, boolean merge)
80          throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(userTracker, merge);
82      }
83  
84      public static com.liferay.portal.model.UserTracker findByPrimaryKey(
85          long userTrackerId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portal.NoSuchUserTrackerException {
88          return getPersistence().findByPrimaryKey(userTrackerId);
89      }
90  
91      public static com.liferay.portal.model.UserTracker fetchByPrimaryKey(
92          long userTrackerId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(userTrackerId);
94      }
95  
96      public static java.util.List<com.liferay.portal.model.UserTracker> findByCompanyId(
97          long companyId) throws com.liferay.portal.SystemException {
98          return getPersistence().findByCompanyId(companyId);
99      }
100 
101     public static java.util.List<com.liferay.portal.model.UserTracker> findByCompanyId(
102         long companyId, int begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByCompanyId(companyId, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.UserTracker> findByCompanyId(
108         long companyId, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByCompanyId(companyId, begin, end, obc);
112     }
113 
114     public static com.liferay.portal.model.UserTracker findByCompanyId_First(
115         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException,
117             com.liferay.portal.NoSuchUserTrackerException {
118         return getPersistence().findByCompanyId_First(companyId, obc);
119     }
120 
121     public static com.liferay.portal.model.UserTracker findByCompanyId_Last(
122         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portal.NoSuchUserTrackerException {
125         return getPersistence().findByCompanyId_Last(companyId, obc);
126     }
127 
128     public static com.liferay.portal.model.UserTracker[] findByCompanyId_PrevAndNext(
129         long userTrackerId, long companyId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portal.NoSuchUserTrackerException {
133         return getPersistence()
134                    .findByCompanyId_PrevAndNext(userTrackerId, companyId, obc);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.UserTracker> findByUserId(
138         long userId) throws com.liferay.portal.SystemException {
139         return getPersistence().findByUserId(userId);
140     }
141 
142     public static java.util.List<com.liferay.portal.model.UserTracker> findByUserId(
143         long userId, int begin, int end)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findByUserId(userId, begin, end);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.UserTracker> findByUserId(
149         long userId, int begin, int end,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.SystemException {
152         return getPersistence().findByUserId(userId, begin, end, obc);
153     }
154 
155     public static com.liferay.portal.model.UserTracker findByUserId_First(
156         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
157         throws com.liferay.portal.SystemException,
158             com.liferay.portal.NoSuchUserTrackerException {
159         return getPersistence().findByUserId_First(userId, obc);
160     }
161 
162     public static com.liferay.portal.model.UserTracker findByUserId_Last(
163         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.SystemException,
165             com.liferay.portal.NoSuchUserTrackerException {
166         return getPersistence().findByUserId_Last(userId, obc);
167     }
168 
169     public static com.liferay.portal.model.UserTracker[] findByUserId_PrevAndNext(
170         long userTrackerId, long userId,
171         com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portal.NoSuchUserTrackerException {
174         return getPersistence()
175                    .findByUserId_PrevAndNext(userTrackerId, userId, obc);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.UserTracker> findBySessionId(
179         java.lang.String sessionId) throws com.liferay.portal.SystemException {
180         return getPersistence().findBySessionId(sessionId);
181     }
182 
183     public static java.util.List<com.liferay.portal.model.UserTracker> findBySessionId(
184         java.lang.String sessionId, int begin, int end)
185         throws com.liferay.portal.SystemException {
186         return getPersistence().findBySessionId(sessionId, begin, end);
187     }
188 
189     public static java.util.List<com.liferay.portal.model.UserTracker> findBySessionId(
190         java.lang.String sessionId, int begin, int end,
191         com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.SystemException {
193         return getPersistence().findBySessionId(sessionId, begin, end, obc);
194     }
195 
196     public static com.liferay.portal.model.UserTracker findBySessionId_First(
197         java.lang.String sessionId,
198         com.liferay.portal.kernel.util.OrderByComparator obc)
199         throws com.liferay.portal.SystemException,
200             com.liferay.portal.NoSuchUserTrackerException {
201         return getPersistence().findBySessionId_First(sessionId, obc);
202     }
203 
204     public static com.liferay.portal.model.UserTracker findBySessionId_Last(
205         java.lang.String sessionId,
206         com.liferay.portal.kernel.util.OrderByComparator obc)
207         throws com.liferay.portal.SystemException,
208             com.liferay.portal.NoSuchUserTrackerException {
209         return getPersistence().findBySessionId_Last(sessionId, obc);
210     }
211 
212     public static com.liferay.portal.model.UserTracker[] findBySessionId_PrevAndNext(
213         long userTrackerId, java.lang.String sessionId,
214         com.liferay.portal.kernel.util.OrderByComparator obc)
215         throws com.liferay.portal.SystemException,
216             com.liferay.portal.NoSuchUserTrackerException {
217         return getPersistence()
218                    .findBySessionId_PrevAndNext(userTrackerId, sessionId, obc);
219     }
220 
221     public static java.util.List<com.liferay.portal.model.UserTracker> findWithDynamicQuery(
222         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
223         throws com.liferay.portal.SystemException {
224         return getPersistence().findWithDynamicQuery(queryInitializer);
225     }
226 
227     public static java.util.List<com.liferay.portal.model.UserTracker> findWithDynamicQuery(
228         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
229         int begin, int end) throws com.liferay.portal.SystemException {
230         return getPersistence()
231                    .findWithDynamicQuery(queryInitializer, begin, end);
232     }
233 
234     public static java.util.List<com.liferay.portal.model.UserTracker> findAll()
235         throws com.liferay.portal.SystemException {
236         return getPersistence().findAll();
237     }
238 
239     public static java.util.List<com.liferay.portal.model.UserTracker> findAll(
240         int begin, int end) throws com.liferay.portal.SystemException {
241         return getPersistence().findAll(begin, end);
242     }
243 
244     public static java.util.List<com.liferay.portal.model.UserTracker> findAll(
245         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
246         throws com.liferay.portal.SystemException {
247         return getPersistence().findAll(begin, end, obc);
248     }
249 
250     public static void removeByCompanyId(long companyId)
251         throws com.liferay.portal.SystemException {
252         getPersistence().removeByCompanyId(companyId);
253     }
254 
255     public static void removeByUserId(long userId)
256         throws com.liferay.portal.SystemException {
257         getPersistence().removeByUserId(userId);
258     }
259 
260     public static void removeBySessionId(java.lang.String sessionId)
261         throws com.liferay.portal.SystemException {
262         getPersistence().removeBySessionId(sessionId);
263     }
264 
265     public static void removeAll() throws com.liferay.portal.SystemException {
266         getPersistence().removeAll();
267     }
268 
269     public static int countByCompanyId(long companyId)
270         throws com.liferay.portal.SystemException {
271         return getPersistence().countByCompanyId(companyId);
272     }
273 
274     public static int countByUserId(long userId)
275         throws com.liferay.portal.SystemException {
276         return getPersistence().countByUserId(userId);
277     }
278 
279     public static int countBySessionId(java.lang.String sessionId)
280         throws com.liferay.portal.SystemException {
281         return getPersistence().countBySessionId(sessionId);
282     }
283 
284     public static int countAll() throws com.liferay.portal.SystemException {
285         return getPersistence().countAll();
286     }
287 
288     public static UserTrackerPersistence getPersistence() {
289         return _getUtil()._persistence;
290     }
291 
292     public void setPersistence(UserTrackerPersistence persistence) {
293         _persistence = persistence;
294     }
295 
296     private static UserTrackerUtil _getUtil() {
297         if (_util == null) {
298             _util = (UserTrackerUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
299         }
300 
301         return _util;
302     }
303 
304     private static final String _UTIL = UserTrackerUtil.class.getName();
305     private static UserTrackerUtil _util;
306     private UserTrackerPersistence _persistence;
307 }