001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019 import com.liferay.portal.kernel.exception.SystemException;
020 import com.liferay.portal.kernel.util.OrderByComparator;
021 import com.liferay.portal.model.Account;
022 import com.liferay.portal.service.ServiceContext;
023
024 import java.util.List;
025
026
032 public class AccountUtil {
033
036 public static void clearCache() {
037 getPersistence().clearCache();
038 }
039
040
043 public static void clearCache(Account account) {
044 getPersistence().clearCache(account);
045 }
046
047
050 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
051 throws SystemException {
052 return getPersistence().countWithDynamicQuery(dynamicQuery);
053 }
054
055
058 public static List<Account> findWithDynamicQuery(DynamicQuery dynamicQuery)
059 throws SystemException {
060 return getPersistence().findWithDynamicQuery(dynamicQuery);
061 }
062
063
066 public static List<Account> findWithDynamicQuery(
067 DynamicQuery dynamicQuery, int start, int end)
068 throws SystemException {
069 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
070 }
071
072
075 public static List<Account> findWithDynamicQuery(
076 DynamicQuery dynamicQuery, int start, int end,
077 OrderByComparator orderByComparator) throws SystemException {
078 return getPersistence()
079 .findWithDynamicQuery(dynamicQuery, start, end,
080 orderByComparator);
081 }
082
083
086 public static Account remove(Account account) throws SystemException {
087 return getPersistence().remove(account);
088 }
089
090
093 public static Account update(Account account, boolean merge)
094 throws SystemException {
095 return getPersistence().update(account, merge);
096 }
097
098
101 public static Account update(Account account, boolean merge,
102 ServiceContext serviceContext) throws SystemException {
103 return getPersistence().update(account, merge, serviceContext);
104 }
105
106 public static void cacheResult(com.liferay.portal.model.Account account) {
107 getPersistence().cacheResult(account);
108 }
109
110 public static void cacheResult(
111 java.util.List<com.liferay.portal.model.Account> accounts) {
112 getPersistence().cacheResult(accounts);
113 }
114
115 public static com.liferay.portal.model.Account create(long accountId) {
116 return getPersistence().create(accountId);
117 }
118
119 public static com.liferay.portal.model.Account remove(long accountId)
120 throws com.liferay.portal.NoSuchAccountException,
121 com.liferay.portal.kernel.exception.SystemException {
122 return getPersistence().remove(accountId);
123 }
124
125 public static com.liferay.portal.model.Account updateImpl(
126 com.liferay.portal.model.Account account, boolean merge)
127 throws com.liferay.portal.kernel.exception.SystemException {
128 return getPersistence().updateImpl(account, merge);
129 }
130
131 public static com.liferay.portal.model.Account findByPrimaryKey(
132 long accountId)
133 throws com.liferay.portal.NoSuchAccountException,
134 com.liferay.portal.kernel.exception.SystemException {
135 return getPersistence().findByPrimaryKey(accountId);
136 }
137
138 public static com.liferay.portal.model.Account fetchByPrimaryKey(
139 long accountId)
140 throws com.liferay.portal.kernel.exception.SystemException {
141 return getPersistence().fetchByPrimaryKey(accountId);
142 }
143
144 public static java.util.List<com.liferay.portal.model.Account> findAll()
145 throws com.liferay.portal.kernel.exception.SystemException {
146 return getPersistence().findAll();
147 }
148
149 public static java.util.List<com.liferay.portal.model.Account> findAll(
150 int start, int end)
151 throws com.liferay.portal.kernel.exception.SystemException {
152 return getPersistence().findAll(start, end);
153 }
154
155 public static java.util.List<com.liferay.portal.model.Account> findAll(
156 int start, int end,
157 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
158 throws com.liferay.portal.kernel.exception.SystemException {
159 return getPersistence().findAll(start, end, orderByComparator);
160 }
161
162 public static void removeAll()
163 throws com.liferay.portal.kernel.exception.SystemException {
164 getPersistence().removeAll();
165 }
166
167 public static int countAll()
168 throws com.liferay.portal.kernel.exception.SystemException {
169 return getPersistence().countAll();
170 }
171
172 public static AccountPersistence getPersistence() {
173 if (_persistence == null) {
174 _persistence = (AccountPersistence)PortalBeanLocatorUtil.locate(AccountPersistence.class.getName());
175 }
176
177 return _persistence;
178 }
179
180 public void setPersistence(AccountPersistence persistence) {
181 _persistence = persistence;
182 }
183
184 private static AccountPersistence _persistence;
185 }