1
14
15 package com.liferay.portal.service.persistence;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19 import com.liferay.portal.kernel.exception.SystemException;
20 import com.liferay.portal.model.Portlet;
21
22 import java.util.List;
23
24
37 public class PortletUtil {
38
41 public static void clearCache() {
42 getPersistence().clearCache();
43 }
44
45
48 public static void clearCache(Portlet portlet) {
49 getPersistence().clearCache(portlet);
50 }
51
52
55 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
56 throws SystemException {
57 return getPersistence().countWithDynamicQuery(dynamicQuery);
58 }
59
60
63 public static List<Portlet> findWithDynamicQuery(DynamicQuery dynamicQuery)
64 throws SystemException {
65 return getPersistence().findWithDynamicQuery(dynamicQuery);
66 }
67
68
71 public static List<Portlet> findWithDynamicQuery(
72 DynamicQuery dynamicQuery, int start, int end)
73 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.kernel.exception.SystemException {
108 return getPersistence().remove(id);
109 }
110
111 public static com.liferay.portal.model.Portlet updateImpl(
112 com.liferay.portal.model.Portlet portlet, boolean merge)
113 throws com.liferay.portal.kernel.exception.SystemException {
114 return getPersistence().updateImpl(portlet, merge);
115 }
116
117 public static com.liferay.portal.model.Portlet findByPrimaryKey(long id)
118 throws com.liferay.portal.NoSuchPortletException,
119 com.liferay.portal.kernel.exception.SystemException {
120 return getPersistence().findByPrimaryKey(id);
121 }
122
123 public static com.liferay.portal.model.Portlet fetchByPrimaryKey(long id)
124 throws com.liferay.portal.kernel.exception.SystemException {
125 return getPersistence().fetchByPrimaryKey(id);
126 }
127
128 public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
129 long companyId)
130 throws com.liferay.portal.kernel.exception.SystemException {
131 return getPersistence().findByCompanyId(companyId);
132 }
133
134 public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
135 long companyId, int start, int end)
136 throws com.liferay.portal.kernel.exception.SystemException {
137 return getPersistence().findByCompanyId(companyId, start, end);
138 }
139
140 public static java.util.List<com.liferay.portal.model.Portlet> findByCompanyId(
141 long companyId, int start, int end,
142 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143 throws com.liferay.portal.kernel.exception.SystemException {
144 return getPersistence()
145 .findByCompanyId(companyId, start, end, orderByComparator);
146 }
147
148 public static com.liferay.portal.model.Portlet findByCompanyId_First(
149 long companyId,
150 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
151 throws com.liferay.portal.NoSuchPortletException,
152 com.liferay.portal.kernel.exception.SystemException {
153 return getPersistence()
154 .findByCompanyId_First(companyId, orderByComparator);
155 }
156
157 public static com.liferay.portal.model.Portlet findByCompanyId_Last(
158 long companyId,
159 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160 throws com.liferay.portal.NoSuchPortletException,
161 com.liferay.portal.kernel.exception.SystemException {
162 return getPersistence()
163 .findByCompanyId_Last(companyId, orderByComparator);
164 }
165
166 public static com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
167 long id, long companyId,
168 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
169 throws com.liferay.portal.NoSuchPortletException,
170 com.liferay.portal.kernel.exception.SystemException {
171 return getPersistence()
172 .findByCompanyId_PrevAndNext(id, companyId, orderByComparator);
173 }
174
175 public static com.liferay.portal.model.Portlet findByC_P(long companyId,
176 java.lang.String portletId)
177 throws com.liferay.portal.NoSuchPortletException,
178 com.liferay.portal.kernel.exception.SystemException {
179 return getPersistence().findByC_P(companyId, portletId);
180 }
181
182 public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
183 java.lang.String portletId)
184 throws com.liferay.portal.kernel.exception.SystemException {
185 return getPersistence().fetchByC_P(companyId, portletId);
186 }
187
188 public static com.liferay.portal.model.Portlet fetchByC_P(long companyId,
189 java.lang.String portletId, boolean retrieveFromCache)
190 throws com.liferay.portal.kernel.exception.SystemException {
191 return getPersistence()
192 .fetchByC_P(companyId, portletId, retrieveFromCache);
193 }
194
195 public static java.util.List<com.liferay.portal.model.Portlet> findAll()
196 throws com.liferay.portal.kernel.exception.SystemException {
197 return getPersistence().findAll();
198 }
199
200 public static java.util.List<com.liferay.portal.model.Portlet> findAll(
201 int start, int end)
202 throws com.liferay.portal.kernel.exception.SystemException {
203 return getPersistence().findAll(start, end);
204 }
205
206 public static java.util.List<com.liferay.portal.model.Portlet> findAll(
207 int start, int end,
208 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
209 throws com.liferay.portal.kernel.exception.SystemException {
210 return getPersistence().findAll(start, end, orderByComparator);
211 }
212
213 public static void removeByCompanyId(long companyId)
214 throws com.liferay.portal.kernel.exception.SystemException {
215 getPersistence().removeByCompanyId(companyId);
216 }
217
218 public static void removeByC_P(long companyId, java.lang.String portletId)
219 throws com.liferay.portal.NoSuchPortletException,
220 com.liferay.portal.kernel.exception.SystemException {
221 getPersistence().removeByC_P(companyId, portletId);
222 }
223
224 public static void removeAll()
225 throws com.liferay.portal.kernel.exception.SystemException {
226 getPersistence().removeAll();
227 }
228
229 public static int countByCompanyId(long companyId)
230 throws com.liferay.portal.kernel.exception.SystemException {
231 return getPersistence().countByCompanyId(companyId);
232 }
233
234 public static int countByC_P(long companyId, java.lang.String portletId)
235 throws com.liferay.portal.kernel.exception.SystemException {
236 return getPersistence().countByC_P(companyId, portletId);
237 }
238
239 public static int countAll()
240 throws com.liferay.portal.kernel.exception.SystemException {
241 return getPersistence().countAll();
242 }
243
244 public static PortletPersistence getPersistence() {
245 if (_persistence == null) {
246 _persistence = (PortletPersistence)PortalBeanLocatorUtil.locate(PortletPersistence.class.getName());
247 }
248
249 return _persistence;
250 }
251
252 public void setPersistence(PortletPersistence persistence) {
253 _persistence = persistence;
254 }
255
256 private static PortletPersistence _persistence;
257 }