1
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.Portlet;
22
23 import java.util.List;
24
25
38 public class PortletUtil {
39
42 public static void clearCache() {
43 getPersistence().clearCache();
44 }
45
46
49 public static void clearCache(Portlet portlet) {
50 getPersistence().clearCache(portlet);
51 }
52
53
56 public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57 throws SystemException {
58 return getPersistence().countWithDynamicQuery(dynamicQuery);
59 }
60
61
64 public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65 throws SystemException {
66 return getPersistence().findWithDynamicQuery(dynamicQuery);
67 }
68
69
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
80 public static Portlet remove(Portlet portlet) throws SystemException {
81 return getPersistence().remove(portlet);
82 }
83
84
87 public static Portlet update(Portlet portlet, boolean merge)
88 throws SystemException {
89 return getPersistence().update(portlet, merge);
90 }
91
92 public static void cacheResult(com.liferay.portal.model.Portlet portlet) {
93 getPersistence().cacheResult(portlet);
94 }
95
96 public static void cacheResult(
97 java.util.List<com.liferay.portal.model.Portlet> portlets) {
98 getPersistence().cacheResult(portlets);
99 }
100
101 public static com.liferay.portal.model.Portlet create(long id) {
102 return getPersistence().create(id);
103 }
104
105 public static com.liferay.portal.model.Portlet remove(long id)
106 throws com.liferay.portal.NoSuchPortletException,
107 com.liferay.portal.SystemException {
108 return getPersistence().remove(id);
109 }
110
111
114 public static com.liferay.portal.model.Portlet update(
115 com.liferay.portal.model.Portlet portlet)
116 throws com.liferay.portal.SystemException {
117 return getPersistence().update(portlet);
118 }
119
120 public static com.liferay.portal.model.Portlet updateImpl(
121 com.liferay.portal.model.Portlet portlet, boolean merge)
122 throws com.liferay.portal.SystemException {
123 return getPersistence().updateImpl(portlet, merge);
124 }
125
126 public static com.liferay.portal.model.Portlet findByPrimaryKey(long id)
127 throws com.liferay.portal.NoSuchPortletException,
128 com.liferay.portal.SystemException {
129 return getPersistence().findByPrimaryKey(id);
130 }
131
132 public static com.liferay.portal.model.Portlet fetchByPrimaryKey(long id)
133 throws com.liferay.portal.SystemException {
134 return getPersistence().fetchByPrimaryKey(id);
135 }
136
137 public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
138 long companyId) throws com.liferay.portal.SystemException {
139 return getPersistence().findByCompanyId(companyId);
140 }
141
142 public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
143 long companyId, int start, int end)
144 throws com.liferay.portal.SystemException {
145 return getPersistence().findByCompanyId(companyId, start, end);
146 }
147
148 public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
149 long companyId, int start, int end,
150 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
151 throws com.liferay.portal.SystemException {
152 return getPersistence()
153 .findByCompanyId(companyId, start, end, orderByComparator);
154 }
155
156 public static com.liferay.portal.model.Portlet findByCompanyId_First(
157 long companyId,
158 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
159 throws com.liferay.portal.NoSuchPortletException,
160 com.liferay.portal.SystemException {
161 return getPersistence()
162 .findByCompanyId_First(companyId, orderByComparator);
163 }
164
165 public static com.liferay.portal.model.Portlet findByCompanyId_Last(
166 long companyId,
167 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
168 throws com.liferay.portal.NoSuchPortletException,
169 com.liferay.portal.SystemException {
170 return getPersistence()
171 .findByCompanyId_Last(companyId, orderByComparator);
172 }
173
174 public static com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
175 long id, long companyId,
176 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177 throws com.liferay.portal.NoSuchPortletException,
178 com.liferay.portal.SystemException {
179 return getPersistence()
180 .findByCompanyId_PrevAndNext(id, companyId, orderByComparator);
181 }
182
183 public static com.liferay.portal.model.Portlet findByC_P(long companyId,
184 java.lang.String portletId)
185 throws com.liferay.portal.NoSuchPortletException,
186 com.liferay.portal.SystemException {
187 return getPersistence().findByC_P(companyId, portletId);
188 }
189
190 public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
191 java.lang.String portletId) throws com.liferay.portal.SystemException {
192 return getPersistence().fetchByC_P(companyId, portletId);
193 }
194
195 public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
196 java.lang.String portletId, boolean retrieveFromCache)
197 throws com.liferay.portal.SystemException {
198 return getPersistence()
199 .fetchByC_P(companyId, portletId, retrieveFromCache);
200 }
201
202 public static java.util.List<com.liferay.portal.model.Portlet> findAll()
203 throws com.liferay.portal.SystemException {
204 return getPersistence().findAll();
205 }
206
207 public static java.util.List<com.liferay.portal.model.Portlet> findAll(
208 int start, int end) throws com.liferay.portal.SystemException {
209 return getPersistence().findAll(start, end);
210 }
211
212 public static java.util.List<com.liferay.portal.model.Portlet> findAll(
213 int start, int end,
214 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
215 throws com.liferay.portal.SystemException {
216 return getPersistence().findAll(start, end, orderByComparator);
217 }
218
219 public static void removeByCompanyId(long companyId)
220 throws com.liferay.portal.SystemException {
221 getPersistence().removeByCompanyId(companyId);
222 }
223
224 public static void removeByC_P(long companyId, java.lang.String portletId)
225 throws com.liferay.portal.NoSuchPortletException,
226 com.liferay.portal.SystemException {
227 getPersistence().removeByC_P(companyId, portletId);
228 }
229
230 public static void removeAll() throws com.liferay.portal.SystemException {
231 getPersistence().removeAll();
232 }
233
234 public static int countByCompanyId(long companyId)
235 throws com.liferay.portal.SystemException {
236 return getPersistence().countByCompanyId(companyId);
237 }
238
239 public static int countByC_P(long companyId, java.lang.String portletId)
240 throws com.liferay.portal.SystemException {
241 return getPersistence().countByC_P(companyId, portletId);
242 }
243
244 public static int countAll() throws com.liferay.portal.SystemException {
245 return getPersistence().countAll();
246 }
247
248 public static PortletPersistence getPersistence() {
249 if (_persistence == null) {
250 _persistence = (PortletPersistence)PortalBeanLocatorUtil.locate(PortletPersistence.class.getName());
251
252 ReferenceRegistry.registerReference(PortletUtil.class,
253 "_persistence");
254 }
255
256 return _persistence;
257 }
258
259 public void setPersistence(PortletPersistence persistence) {
260 _persistence = persistence;
261
262 ReferenceRegistry.registerReference(PortletUtil.class, "_persistence");
263 }
264
265 private static PortletPersistence _persistence;
266 }