1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.Account;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="AccountUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       AccountPersistence
35   * @see       AccountPersistenceImpl
36   * @generated
37   */
38  public class AccountUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(Account)
48       */
49      public static void clearCache(Account account) {
50          getPersistence().clearCache(account);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static Account remove(Account account) throws SystemException {
81          return getPersistence().remove(account);
82      }
83  
84      /**
85       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
86       */
87      public static Account update(Account account, boolean merge)
88          throws SystemException {
89          return getPersistence().update(account, merge);
90      }
91  
92      public static void cacheResult(com.liferay.portal.model.Account account) {
93          getPersistence().cacheResult(account);
94      }
95  
96      public static void cacheResult(
97          java.util.List<com.liferay.portal.model.Account> accounts) {
98          getPersistence().cacheResult(accounts);
99      }
100 
101     public static com.liferay.portal.model.Account create(long accountId) {
102         return getPersistence().create(accountId);
103     }
104 
105     public static com.liferay.portal.model.Account remove(long accountId)
106         throws com.liferay.portal.NoSuchAccountException,
107             com.liferay.portal.SystemException {
108         return getPersistence().remove(accountId);
109     }
110 
111     /**
112      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
113      */
114     public static com.liferay.portal.model.Account update(
115         com.liferay.portal.model.Account account)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().update(account);
118     }
119 
120     public static com.liferay.portal.model.Account updateImpl(
121         com.liferay.portal.model.Account account, boolean merge)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().updateImpl(account, merge);
124     }
125 
126     public static com.liferay.portal.model.Account findByPrimaryKey(
127         long accountId)
128         throws com.liferay.portal.NoSuchAccountException,
129             com.liferay.portal.SystemException {
130         return getPersistence().findByPrimaryKey(accountId);
131     }
132 
133     public static com.liferay.portal.model.Account fetchByPrimaryKey(
134         long accountId) throws com.liferay.portal.SystemException {
135         return getPersistence().fetchByPrimaryKey(accountId);
136     }
137 
138     public static java.util.List<com.liferay.portal.model.Account> findAll()
139         throws com.liferay.portal.SystemException {
140         return getPersistence().findAll();
141     }
142 
143     public static java.util.List<com.liferay.portal.model.Account> findAll(
144         int start, int end) throws com.liferay.portal.SystemException {
145         return getPersistence().findAll(start, end);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.Account> findAll(
149         int start, int end,
150         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
151         throws com.liferay.portal.SystemException {
152         return getPersistence().findAll(start, end, orderByComparator);
153     }
154 
155     public static void removeAll() throws com.liferay.portal.SystemException {
156         getPersistence().removeAll();
157     }
158 
159     public static int countAll() throws com.liferay.portal.SystemException {
160         return getPersistence().countAll();
161     }
162 
163     public static AccountPersistence getPersistence() {
164         if (_persistence == null) {
165             _persistence = (AccountPersistence)PortalBeanLocatorUtil.locate(AccountPersistence.class.getName());
166 
167             ReferenceRegistry.registerReference(AccountUtil.class,
168                 "_persistence");
169         }
170 
171         return _persistence;
172     }
173 
174     public void setPersistence(AccountPersistence persistence) {
175         _persistence = persistence;
176 
177         ReferenceRegistry.registerReference(AccountUtil.class, "_persistence");
178     }
179 
180     private static AccountPersistence _persistence;
181 }