1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  /**
27   * <a href="AccountUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       AccountPersistence
36   * @see       AccountPersistenceImpl
37   * @generated
38   */
39  public class AccountUtil {
40      public static void cacheResult(com.liferay.portal.model.Account account) {
41          getPersistence().cacheResult(account);
42      }
43  
44      public static void cacheResult(
45          java.util.List<com.liferay.portal.model.Account> accounts) {
46          getPersistence().cacheResult(accounts);
47      }
48  
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      public static com.liferay.portal.model.Account create(long accountId) {
54          return getPersistence().create(accountId);
55      }
56  
57      public static com.liferay.portal.model.Account remove(long accountId)
58          throws com.liferay.portal.NoSuchAccountException,
59              com.liferay.portal.SystemException {
60          return getPersistence().remove(accountId);
61      }
62  
63      public static com.liferay.portal.model.Account remove(
64          com.liferay.portal.model.Account account)
65          throws com.liferay.portal.SystemException {
66          return getPersistence().remove(account);
67      }
68  
69      /**
70       * @deprecated Use {@link #update(Account, boolean merge)}.
71       */
72      public static com.liferay.portal.model.Account update(
73          com.liferay.portal.model.Account account)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(account);
76      }
77  
78      /**
79       * Add, update, or merge, the entity. This method also calls the model
80       * listeners to trigger the proper events associated with adding, deleting,
81       * or updating an entity.
82       *
83       * @param  account the entity to add, update, or merge
84       * @param  merge boolean value for whether to merge the entity. The default
85       *         value is false. Setting merge to true is more expensive and
86       *         should only be true when account is transient. See
87       *         LEP-5473 for a detailed discussion of this method.
88       * @return the entity that was added, updated, or merged
89       */
90      public static com.liferay.portal.model.Account update(
91          com.liferay.portal.model.Account account, boolean merge)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().update(account, merge);
94      }
95  
96      public static com.liferay.portal.model.Account updateImpl(
97          com.liferay.portal.model.Account account, boolean merge)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().updateImpl(account, merge);
100     }
101 
102     public static com.liferay.portal.model.Account findByPrimaryKey(
103         long accountId)
104         throws com.liferay.portal.NoSuchAccountException,
105             com.liferay.portal.SystemException {
106         return getPersistence().findByPrimaryKey(accountId);
107     }
108 
109     public static com.liferay.portal.model.Account fetchByPrimaryKey(
110         long accountId) throws com.liferay.portal.SystemException {
111         return getPersistence().fetchByPrimaryKey(accountId);
112     }
113 
114     public static java.util.List<Object> findWithDynamicQuery(
115         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().findWithDynamicQuery(dynamicQuery);
118     }
119 
120     public static java.util.List<Object> findWithDynamicQuery(
121         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122         int end) throws com.liferay.portal.SystemException {
123         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
124     }
125 
126     public static java.util.List<com.liferay.portal.model.Account> findAll()
127         throws com.liferay.portal.SystemException {
128         return getPersistence().findAll();
129     }
130 
131     public static java.util.List<com.liferay.portal.model.Account> findAll(
132         int start, int end) throws com.liferay.portal.SystemException {
133         return getPersistence().findAll(start, end);
134     }
135 
136     public static java.util.List<com.liferay.portal.model.Account> findAll(
137         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
138         throws com.liferay.portal.SystemException {
139         return getPersistence().findAll(start, end, obc);
140     }
141 
142     public static void removeAll() throws com.liferay.portal.SystemException {
143         getPersistence().removeAll();
144     }
145 
146     public static int countAll() throws com.liferay.portal.SystemException {
147         return getPersistence().countAll();
148     }
149 
150     public static AccountPersistence getPersistence() {
151         return _persistence;
152     }
153 
154     public void setPersistence(AccountPersistence persistence) {
155         _persistence = persistence;
156     }
157 
158     private static AccountPersistence _persistence;
159 }