001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.util.OrderByComparator;
022    import com.liferay.portal.kernel.util.ReferenceRegistry;
023    import com.liferay.portal.model.PortletItem;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the portlet item service. This utility wraps {@link com.liferay.portal.service.persistence.impl.PortletItemPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see PortletItemPersistence
037     * @see com.liferay.portal.service.persistence.impl.PortletItemPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class PortletItemUtil {
042            /*
043             * NOTE FOR DEVELOPERS:
044             *
045             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
046             */
047    
048            /**
049             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
050             */
051            public static void clearCache() {
052                    getPersistence().clearCache();
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
057             */
058            public static void clearCache(PortletItem portletItem) {
059                    getPersistence().clearCache(portletItem);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
064             */
065            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<PortletItem> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<PortletItem> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end) {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<PortletItem> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator<PortletItem> orderByComparator) {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
098             */
099            public static PortletItem update(PortletItem portletItem) {
100                    return getPersistence().update(portletItem);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static PortletItem update(PortletItem portletItem,
107                    ServiceContext serviceContext) {
108                    return getPersistence().update(portletItem, serviceContext);
109            }
110    
111            /**
112            * Returns all the portlet items where groupId = &#63; and classNameId = &#63;.
113            *
114            * @param groupId the group ID
115            * @param classNameId the class name ID
116            * @return the matching portlet items
117            */
118            public static List<PortletItem> findByG_C(long groupId, long classNameId) {
119                    return getPersistence().findByG_C(groupId, classNameId);
120            }
121    
122            /**
123            * Returns a range of all the portlet items where groupId = &#63; and classNameId = &#63;.
124            *
125            * <p>
126            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PortletItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
127            * </p>
128            *
129            * @param groupId the group ID
130            * @param classNameId the class name ID
131            * @param start the lower bound of the range of portlet items
132            * @param end the upper bound of the range of portlet items (not inclusive)
133            * @return the range of matching portlet items
134            */
135            public static List<PortletItem> findByG_C(long groupId, long classNameId,
136                    int start, int end) {
137                    return getPersistence().findByG_C(groupId, classNameId, start, end);
138            }
139    
140            /**
141            * Returns an ordered range of all the portlet items where groupId = &#63; and classNameId = &#63;.
142            *
143            * <p>
144            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PortletItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
145            * </p>
146            *
147            * @param groupId the group ID
148            * @param classNameId the class name ID
149            * @param start the lower bound of the range of portlet items
150            * @param end the upper bound of the range of portlet items (not inclusive)
151            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
152            * @return the ordered range of matching portlet items
153            */
154            public static List<PortletItem> findByG_C(long groupId, long classNameId,
155                    int start, int end, OrderByComparator<PortletItem> orderByComparator) {
156                    return getPersistence()
157                                       .findByG_C(groupId, classNameId, start, end,
158                            orderByComparator);
159            }
160    
161            /**
162            * Returns the first portlet item in the ordered set where groupId = &#63; and classNameId = &#63;.
163            *
164            * @param groupId the group ID
165            * @param classNameId the class name ID
166            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
167            * @return the first matching portlet item
168            * @throws NoSuchPortletItemException if a matching portlet item could not be found
169            */
170            public static PortletItem findByG_C_First(long groupId, long classNameId,
171                    OrderByComparator<PortletItem> orderByComparator)
172                    throws com.liferay.portal.NoSuchPortletItemException {
173                    return getPersistence()
174                                       .findByG_C_First(groupId, classNameId, orderByComparator);
175            }
176    
177            /**
178            * Returns the first portlet item in the ordered set where groupId = &#63; and classNameId = &#63;.
179            *
180            * @param groupId the group ID
181            * @param classNameId the class name ID
182            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
183            * @return the first matching portlet item, or <code>null</code> if a matching portlet item could not be found
184            */
185            public static PortletItem fetchByG_C_First(long groupId, long classNameId,
186                    OrderByComparator<PortletItem> orderByComparator) {
187                    return getPersistence()
188                                       .fetchByG_C_First(groupId, classNameId, orderByComparator);
189            }
190    
191            /**
192            * Returns the last portlet item in the ordered set where groupId = &#63; and classNameId = &#63;.
193            *
194            * @param groupId the group ID
195            * @param classNameId the class name ID
196            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
197            * @return the last matching portlet item
198            * @throws NoSuchPortletItemException if a matching portlet item could not be found
199            */
200            public static PortletItem findByG_C_Last(long groupId, long classNameId,
201                    OrderByComparator<PortletItem> orderByComparator)
202                    throws com.liferay.portal.NoSuchPortletItemException {
203                    return getPersistence()
204                                       .findByG_C_Last(groupId, classNameId, orderByComparator);
205            }
206    
207            /**
208            * Returns the last portlet item in the ordered set where groupId = &#63; and classNameId = &#63;.
209            *
210            * @param groupId the group ID
211            * @param classNameId the class name ID
212            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
213            * @return the last matching portlet item, or <code>null</code> if a matching portlet item could not be found
214            */
215            public static PortletItem fetchByG_C_Last(long groupId, long classNameId,
216                    OrderByComparator<PortletItem> orderByComparator) {
217                    return getPersistence()
218                                       .fetchByG_C_Last(groupId, classNameId, orderByComparator);
219            }
220    
221            /**
222            * Returns the portlet items before and after the current portlet item in the ordered set where groupId = &#63; and classNameId = &#63;.
223            *
224            * @param portletItemId the primary key of the current portlet item
225            * @param groupId the group ID
226            * @param classNameId the class name ID
227            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
228            * @return the previous, current, and next portlet item
229            * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found
230            */
231            public static PortletItem[] findByG_C_PrevAndNext(long portletItemId,
232                    long groupId, long classNameId,
233                    OrderByComparator<PortletItem> orderByComparator)
234                    throws com.liferay.portal.NoSuchPortletItemException {
235                    return getPersistence()
236                                       .findByG_C_PrevAndNext(portletItemId, groupId, classNameId,
237                            orderByComparator);
238            }
239    
240            /**
241            * Removes all the portlet items where groupId = &#63; and classNameId = &#63; from the database.
242            *
243            * @param groupId the group ID
244            * @param classNameId the class name ID
245            */
246            public static void removeByG_C(long groupId, long classNameId) {
247                    getPersistence().removeByG_C(groupId, classNameId);
248            }
249    
250            /**
251            * Returns the number of portlet items where groupId = &#63; and classNameId = &#63;.
252            *
253            * @param groupId the group ID
254            * @param classNameId the class name ID
255            * @return the number of matching portlet items
256            */
257            public static int countByG_C(long groupId, long classNameId) {
258                    return getPersistence().countByG_C(groupId, classNameId);
259            }
260    
261            /**
262            * Returns all the portlet items where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
263            *
264            * @param groupId the group ID
265            * @param portletId the portlet ID
266            * @param classNameId the class name ID
267            * @return the matching portlet items
268            */
269            public static List<PortletItem> findByG_P_C(long groupId,
270                    java.lang.String portletId, long classNameId) {
271                    return getPersistence().findByG_P_C(groupId, portletId, classNameId);
272            }
273    
274            /**
275            * Returns a range of all the portlet items where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
276            *
277            * <p>
278            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PortletItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
279            * </p>
280            *
281            * @param groupId the group ID
282            * @param portletId the portlet ID
283            * @param classNameId the class name ID
284            * @param start the lower bound of the range of portlet items
285            * @param end the upper bound of the range of portlet items (not inclusive)
286            * @return the range of matching portlet items
287            */
288            public static List<PortletItem> findByG_P_C(long groupId,
289                    java.lang.String portletId, long classNameId, int start, int end) {
290                    return getPersistence()
291                                       .findByG_P_C(groupId, portletId, classNameId, start, end);
292            }
293    
294            /**
295            * Returns an ordered range of all the portlet items where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
296            *
297            * <p>
298            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PortletItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
299            * </p>
300            *
301            * @param groupId the group ID
302            * @param portletId the portlet ID
303            * @param classNameId the class name ID
304            * @param start the lower bound of the range of portlet items
305            * @param end the upper bound of the range of portlet items (not inclusive)
306            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
307            * @return the ordered range of matching portlet items
308            */
309            public static List<PortletItem> findByG_P_C(long groupId,
310                    java.lang.String portletId, long classNameId, int start, int end,
311                    OrderByComparator<PortletItem> orderByComparator) {
312                    return getPersistence()
313                                       .findByG_P_C(groupId, portletId, classNameId, start, end,
314                            orderByComparator);
315            }
316    
317            /**
318            * Returns the first portlet item in the ordered set where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
319            *
320            * @param groupId the group ID
321            * @param portletId the portlet ID
322            * @param classNameId the class name ID
323            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
324            * @return the first matching portlet item
325            * @throws NoSuchPortletItemException if a matching portlet item could not be found
326            */
327            public static PortletItem findByG_P_C_First(long groupId,
328                    java.lang.String portletId, long classNameId,
329                    OrderByComparator<PortletItem> orderByComparator)
330                    throws com.liferay.portal.NoSuchPortletItemException {
331                    return getPersistence()
332                                       .findByG_P_C_First(groupId, portletId, classNameId,
333                            orderByComparator);
334            }
335    
336            /**
337            * Returns the first portlet item in the ordered set where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
338            *
339            * @param groupId the group ID
340            * @param portletId the portlet ID
341            * @param classNameId the class name ID
342            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
343            * @return the first matching portlet item, or <code>null</code> if a matching portlet item could not be found
344            */
345            public static PortletItem fetchByG_P_C_First(long groupId,
346                    java.lang.String portletId, long classNameId,
347                    OrderByComparator<PortletItem> orderByComparator) {
348                    return getPersistence()
349                                       .fetchByG_P_C_First(groupId, portletId, classNameId,
350                            orderByComparator);
351            }
352    
353            /**
354            * Returns the last portlet item in the ordered set where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
355            *
356            * @param groupId the group ID
357            * @param portletId the portlet ID
358            * @param classNameId the class name ID
359            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
360            * @return the last matching portlet item
361            * @throws NoSuchPortletItemException if a matching portlet item could not be found
362            */
363            public static PortletItem findByG_P_C_Last(long groupId,
364                    java.lang.String portletId, long classNameId,
365                    OrderByComparator<PortletItem> orderByComparator)
366                    throws com.liferay.portal.NoSuchPortletItemException {
367                    return getPersistence()
368                                       .findByG_P_C_Last(groupId, portletId, classNameId,
369                            orderByComparator);
370            }
371    
372            /**
373            * Returns the last portlet item in the ordered set where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
374            *
375            * @param groupId the group ID
376            * @param portletId the portlet ID
377            * @param classNameId the class name ID
378            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
379            * @return the last matching portlet item, or <code>null</code> if a matching portlet item could not be found
380            */
381            public static PortletItem fetchByG_P_C_Last(long groupId,
382                    java.lang.String portletId, long classNameId,
383                    OrderByComparator<PortletItem> orderByComparator) {
384                    return getPersistence()
385                                       .fetchByG_P_C_Last(groupId, portletId, classNameId,
386                            orderByComparator);
387            }
388    
389            /**
390            * Returns the portlet items before and after the current portlet item in the ordered set where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
391            *
392            * @param portletItemId the primary key of the current portlet item
393            * @param groupId the group ID
394            * @param portletId the portlet ID
395            * @param classNameId the class name ID
396            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
397            * @return the previous, current, and next portlet item
398            * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found
399            */
400            public static PortletItem[] findByG_P_C_PrevAndNext(long portletItemId,
401                    long groupId, java.lang.String portletId, long classNameId,
402                    OrderByComparator<PortletItem> orderByComparator)
403                    throws com.liferay.portal.NoSuchPortletItemException {
404                    return getPersistence()
405                                       .findByG_P_C_PrevAndNext(portletItemId, groupId, portletId,
406                            classNameId, orderByComparator);
407            }
408    
409            /**
410            * Removes all the portlet items where groupId = &#63; and portletId = &#63; and classNameId = &#63; from the database.
411            *
412            * @param groupId the group ID
413            * @param portletId the portlet ID
414            * @param classNameId the class name ID
415            */
416            public static void removeByG_P_C(long groupId, java.lang.String portletId,
417                    long classNameId) {
418                    getPersistence().removeByG_P_C(groupId, portletId, classNameId);
419            }
420    
421            /**
422            * Returns the number of portlet items where groupId = &#63; and portletId = &#63; and classNameId = &#63;.
423            *
424            * @param groupId the group ID
425            * @param portletId the portlet ID
426            * @param classNameId the class name ID
427            * @return the number of matching portlet items
428            */
429            public static int countByG_P_C(long groupId, java.lang.String portletId,
430                    long classNameId) {
431                    return getPersistence().countByG_P_C(groupId, portletId, classNameId);
432            }
433    
434            /**
435            * Returns the portlet item where groupId = &#63; and name = &#63; and portletId = &#63; and classNameId = &#63; or throws a {@link NoSuchPortletItemException} if it could not be found.
436            *
437            * @param groupId the group ID
438            * @param name the name
439            * @param portletId the portlet ID
440            * @param classNameId the class name ID
441            * @return the matching portlet item
442            * @throws NoSuchPortletItemException if a matching portlet item could not be found
443            */
444            public static PortletItem findByG_N_P_C(long groupId,
445                    java.lang.String name, java.lang.String portletId, long classNameId)
446                    throws com.liferay.portal.NoSuchPortletItemException {
447                    return getPersistence()
448                                       .findByG_N_P_C(groupId, name, portletId, classNameId);
449            }
450    
451            /**
452            * Returns the portlet item where groupId = &#63; and name = &#63; and portletId = &#63; and classNameId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
453            *
454            * @param groupId the group ID
455            * @param name the name
456            * @param portletId the portlet ID
457            * @param classNameId the class name ID
458            * @return the matching portlet item, or <code>null</code> if a matching portlet item could not be found
459            */
460            public static PortletItem fetchByG_N_P_C(long groupId,
461                    java.lang.String name, java.lang.String portletId, long classNameId) {
462                    return getPersistence()
463                                       .fetchByG_N_P_C(groupId, name, portletId, classNameId);
464            }
465    
466            /**
467            * Returns the portlet item where groupId = &#63; and name = &#63; and portletId = &#63; and classNameId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
468            *
469            * @param groupId the group ID
470            * @param name the name
471            * @param portletId the portlet ID
472            * @param classNameId the class name ID
473            * @param retrieveFromCache whether to use the finder cache
474            * @return the matching portlet item, or <code>null</code> if a matching portlet item could not be found
475            */
476            public static PortletItem fetchByG_N_P_C(long groupId,
477                    java.lang.String name, java.lang.String portletId, long classNameId,
478                    boolean retrieveFromCache) {
479                    return getPersistence()
480                                       .fetchByG_N_P_C(groupId, name, portletId, classNameId,
481                            retrieveFromCache);
482            }
483    
484            /**
485            * Removes the portlet item where groupId = &#63; and name = &#63; and portletId = &#63; and classNameId = &#63; from the database.
486            *
487            * @param groupId the group ID
488            * @param name the name
489            * @param portletId the portlet ID
490            * @param classNameId the class name ID
491            * @return the portlet item that was removed
492            */
493            public static PortletItem removeByG_N_P_C(long groupId,
494                    java.lang.String name, java.lang.String portletId, long classNameId)
495                    throws com.liferay.portal.NoSuchPortletItemException {
496                    return getPersistence()
497                                       .removeByG_N_P_C(groupId, name, portletId, classNameId);
498            }
499    
500            /**
501            * Returns the number of portlet items where groupId = &#63; and name = &#63; and portletId = &#63; and classNameId = &#63;.
502            *
503            * @param groupId the group ID
504            * @param name the name
505            * @param portletId the portlet ID
506            * @param classNameId the class name ID
507            * @return the number of matching portlet items
508            */
509            public static int countByG_N_P_C(long groupId, java.lang.String name,
510                    java.lang.String portletId, long classNameId) {
511                    return getPersistence()
512                                       .countByG_N_P_C(groupId, name, portletId, classNameId);
513            }
514    
515            /**
516            * Caches the portlet item in the entity cache if it is enabled.
517            *
518            * @param portletItem the portlet item
519            */
520            public static void cacheResult(PortletItem portletItem) {
521                    getPersistence().cacheResult(portletItem);
522            }
523    
524            /**
525            * Caches the portlet items in the entity cache if it is enabled.
526            *
527            * @param portletItems the portlet items
528            */
529            public static void cacheResult(List<PortletItem> portletItems) {
530                    getPersistence().cacheResult(portletItems);
531            }
532    
533            /**
534            * Creates a new portlet item with the primary key. Does not add the portlet item to the database.
535            *
536            * @param portletItemId the primary key for the new portlet item
537            * @return the new portlet item
538            */
539            public static PortletItem create(long portletItemId) {
540                    return getPersistence().create(portletItemId);
541            }
542    
543            /**
544            * Removes the portlet item with the primary key from the database. Also notifies the appropriate model listeners.
545            *
546            * @param portletItemId the primary key of the portlet item
547            * @return the portlet item that was removed
548            * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found
549            */
550            public static PortletItem remove(long portletItemId)
551                    throws com.liferay.portal.NoSuchPortletItemException {
552                    return getPersistence().remove(portletItemId);
553            }
554    
555            public static PortletItem updateImpl(PortletItem portletItem) {
556                    return getPersistence().updateImpl(portletItem);
557            }
558    
559            /**
560            * Returns the portlet item with the primary key or throws a {@link NoSuchPortletItemException} if it could not be found.
561            *
562            * @param portletItemId the primary key of the portlet item
563            * @return the portlet item
564            * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found
565            */
566            public static PortletItem findByPrimaryKey(long portletItemId)
567                    throws com.liferay.portal.NoSuchPortletItemException {
568                    return getPersistence().findByPrimaryKey(portletItemId);
569            }
570    
571            /**
572            * Returns the portlet item with the primary key or returns <code>null</code> if it could not be found.
573            *
574            * @param portletItemId the primary key of the portlet item
575            * @return the portlet item, or <code>null</code> if a portlet item with the primary key could not be found
576            */
577            public static PortletItem fetchByPrimaryKey(long portletItemId) {
578                    return getPersistence().fetchByPrimaryKey(portletItemId);
579            }
580    
581            public static java.util.Map<java.io.Serializable, PortletItem> fetchByPrimaryKeys(
582                    java.util.Set<java.io.Serializable> primaryKeys) {
583                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
584            }
585    
586            /**
587            * Returns all the portlet items.
588            *
589            * @return the portlet items
590            */
591            public static List<PortletItem> findAll() {
592                    return getPersistence().findAll();
593            }
594    
595            /**
596            * Returns a range of all the portlet items.
597            *
598            * <p>
599            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PortletItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
600            * </p>
601            *
602            * @param start the lower bound of the range of portlet items
603            * @param end the upper bound of the range of portlet items (not inclusive)
604            * @return the range of portlet items
605            */
606            public static List<PortletItem> findAll(int start, int end) {
607                    return getPersistence().findAll(start, end);
608            }
609    
610            /**
611            * Returns an ordered range of all the portlet items.
612            *
613            * <p>
614            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link PortletItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
615            * </p>
616            *
617            * @param start the lower bound of the range of portlet items
618            * @param end the upper bound of the range of portlet items (not inclusive)
619            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
620            * @return the ordered range of portlet items
621            */
622            public static List<PortletItem> findAll(int start, int end,
623                    OrderByComparator<PortletItem> orderByComparator) {
624                    return getPersistence().findAll(start, end, orderByComparator);
625            }
626    
627            /**
628            * Removes all the portlet items from the database.
629            */
630            public static void removeAll() {
631                    getPersistence().removeAll();
632            }
633    
634            /**
635            * Returns the number of portlet items.
636            *
637            * @return the number of portlet items
638            */
639            public static int countAll() {
640                    return getPersistence().countAll();
641            }
642    
643            public static PortletItemPersistence getPersistence() {
644                    if (_persistence == null) {
645                            _persistence = (PortletItemPersistence)PortalBeanLocatorUtil.locate(PortletItemPersistence.class.getName());
646    
647                            ReferenceRegistry.registerReference(PortletItemUtil.class,
648                                    "_persistence");
649                    }
650    
651                    return _persistence;
652            }
653    
654            /**
655             * @deprecated As of 6.2.0
656             */
657            @Deprecated
658            public void setPersistence(PortletItemPersistence persistence) {
659            }
660    
661            private static PortletItemPersistence _persistence;
662    }