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="AccountUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class AccountUtil {
32      public static void cacheResult(com.liferay.portal.model.Account account) {
33          getPersistence().cacheResult(account);
34      }
35  
36      public static void cacheResult(
37          java.util.List<com.liferay.portal.model.Account> accounts) {
38          getPersistence().cacheResult(accounts);
39      }
40  
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      public static com.liferay.portal.model.Account create(long accountId) {
46          return getPersistence().create(accountId);
47      }
48  
49      public static com.liferay.portal.model.Account remove(long accountId)
50          throws com.liferay.portal.NoSuchAccountException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(accountId);
53      }
54  
55      public static com.liferay.portal.model.Account remove(
56          com.liferay.portal.model.Account account)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(account);
59      }
60  
61      /**
62       * @deprecated Use <code>update(Account account, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.Account update(
65          com.liferay.portal.model.Account account)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(account);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        account the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when account is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.Account update(
84          com.liferay.portal.model.Account account, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(account, merge);
87      }
88  
89      public static com.liferay.portal.model.Account updateImpl(
90          com.liferay.portal.model.Account account, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(account, merge);
93      }
94  
95      public static com.liferay.portal.model.Account findByPrimaryKey(
96          long accountId)
97          throws com.liferay.portal.NoSuchAccountException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(accountId);
100     }
101 
102     public static com.liferay.portal.model.Account fetchByPrimaryKey(
103         long accountId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(accountId);
105     }
106 
107     public static java.util.List<Object> findWithDynamicQuery(
108         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().findWithDynamicQuery(dynamicQuery);
111     }
112 
113     public static java.util.List<Object> findWithDynamicQuery(
114         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
115         int end) throws com.liferay.portal.SystemException {
116         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.Account> findAll()
120         throws com.liferay.portal.SystemException {
121         return getPersistence().findAll();
122     }
123 
124     public static java.util.List<com.liferay.portal.model.Account> findAll(
125         int start, int end) throws com.liferay.portal.SystemException {
126         return getPersistence().findAll(start, end);
127     }
128 
129     public static java.util.List<com.liferay.portal.model.Account> findAll(
130         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException {
132         return getPersistence().findAll(start, end, obc);
133     }
134 
135     public static void removeAll() throws com.liferay.portal.SystemException {
136         getPersistence().removeAll();
137     }
138 
139     public static int countAll() throws com.liferay.portal.SystemException {
140         return getPersistence().countAll();
141     }
142 
143     public static AccountPersistence getPersistence() {
144         return _persistence;
145     }
146 
147     public void setPersistence(AccountPersistence persistence) {
148         _persistence = persistence;
149     }
150 
151     private static AccountPersistence _persistence;
152 }