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 = ? and classNameId = ?. 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 = ? and classNameId = ?. 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 = ? and classNameId = ?. 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 an ordered range of all the portlet items where groupId = ? and classNameId = ?. 163 * 164 * <p> 165 * 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. 166 * </p> 167 * 168 * @param groupId the group ID 169 * @param classNameId the class name ID 170 * @param start the lower bound of the range of portlet items 171 * @param end the upper bound of the range of portlet items (not inclusive) 172 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 173 * @param retrieveFromCache whether to retrieve from the finder cache 174 * @return the ordered range of matching portlet items 175 */ 176 public static List<PortletItem> findByG_C(long groupId, long classNameId, 177 int start, int end, OrderByComparator<PortletItem> orderByComparator, 178 boolean retrieveFromCache) { 179 return getPersistence() 180 .findByG_C(groupId, classNameId, start, end, 181 orderByComparator, retrieveFromCache); 182 } 183 184 /** 185 * Returns the first portlet item in the ordered set where groupId = ? and classNameId = ?. 186 * 187 * @param groupId the group ID 188 * @param classNameId the class name ID 189 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 190 * @return the first matching portlet item 191 * @throws NoSuchPortletItemException if a matching portlet item could not be found 192 */ 193 public static PortletItem findByG_C_First(long groupId, long classNameId, 194 OrderByComparator<PortletItem> orderByComparator) 195 throws com.liferay.portal.exception.NoSuchPortletItemException { 196 return getPersistence() 197 .findByG_C_First(groupId, classNameId, orderByComparator); 198 } 199 200 /** 201 * Returns the first portlet item in the ordered set where groupId = ? and classNameId = ?. 202 * 203 * @param groupId the group ID 204 * @param classNameId the class name ID 205 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 206 * @return the first matching portlet item, or <code>null</code> if a matching portlet item could not be found 207 */ 208 public static PortletItem fetchByG_C_First(long groupId, long classNameId, 209 OrderByComparator<PortletItem> orderByComparator) { 210 return getPersistence() 211 .fetchByG_C_First(groupId, classNameId, orderByComparator); 212 } 213 214 /** 215 * Returns the last portlet item in the ordered set where groupId = ? and classNameId = ?. 216 * 217 * @param groupId the group ID 218 * @param classNameId the class name ID 219 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 220 * @return the last matching portlet item 221 * @throws NoSuchPortletItemException if a matching portlet item could not be found 222 */ 223 public static PortletItem findByG_C_Last(long groupId, long classNameId, 224 OrderByComparator<PortletItem> orderByComparator) 225 throws com.liferay.portal.exception.NoSuchPortletItemException { 226 return getPersistence() 227 .findByG_C_Last(groupId, classNameId, orderByComparator); 228 } 229 230 /** 231 * Returns the last portlet item in the ordered set where groupId = ? and classNameId = ?. 232 * 233 * @param groupId the group ID 234 * @param classNameId the class name ID 235 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 236 * @return the last matching portlet item, or <code>null</code> if a matching portlet item could not be found 237 */ 238 public static PortletItem fetchByG_C_Last(long groupId, long classNameId, 239 OrderByComparator<PortletItem> orderByComparator) { 240 return getPersistence() 241 .fetchByG_C_Last(groupId, classNameId, orderByComparator); 242 } 243 244 /** 245 * Returns the portlet items before and after the current portlet item in the ordered set where groupId = ? and classNameId = ?. 246 * 247 * @param portletItemId the primary key of the current portlet item 248 * @param groupId the group ID 249 * @param classNameId the class name ID 250 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 251 * @return the previous, current, and next portlet item 252 * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found 253 */ 254 public static PortletItem[] findByG_C_PrevAndNext(long portletItemId, 255 long groupId, long classNameId, 256 OrderByComparator<PortletItem> orderByComparator) 257 throws com.liferay.portal.exception.NoSuchPortletItemException { 258 return getPersistence() 259 .findByG_C_PrevAndNext(portletItemId, groupId, classNameId, 260 orderByComparator); 261 } 262 263 /** 264 * Removes all the portlet items where groupId = ? and classNameId = ? from the database. 265 * 266 * @param groupId the group ID 267 * @param classNameId the class name ID 268 */ 269 public static void removeByG_C(long groupId, long classNameId) { 270 getPersistence().removeByG_C(groupId, classNameId); 271 } 272 273 /** 274 * Returns the number of portlet items where groupId = ? and classNameId = ?. 275 * 276 * @param groupId the group ID 277 * @param classNameId the class name ID 278 * @return the number of matching portlet items 279 */ 280 public static int countByG_C(long groupId, long classNameId) { 281 return getPersistence().countByG_C(groupId, classNameId); 282 } 283 284 /** 285 * Returns all the portlet items where groupId = ? and portletId = ? and classNameId = ?. 286 * 287 * @param groupId the group ID 288 * @param portletId the portlet ID 289 * @param classNameId the class name ID 290 * @return the matching portlet items 291 */ 292 public static List<PortletItem> findByG_P_C(long groupId, 293 java.lang.String portletId, long classNameId) { 294 return getPersistence().findByG_P_C(groupId, portletId, classNameId); 295 } 296 297 /** 298 * Returns a range of all the portlet items where groupId = ? and portletId = ? and classNameId = ?. 299 * 300 * <p> 301 * 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. 302 * </p> 303 * 304 * @param groupId the group ID 305 * @param portletId the portlet ID 306 * @param classNameId the class name ID 307 * @param start the lower bound of the range of portlet items 308 * @param end the upper bound of the range of portlet items (not inclusive) 309 * @return the range of matching portlet items 310 */ 311 public static List<PortletItem> findByG_P_C(long groupId, 312 java.lang.String portletId, long classNameId, int start, int end) { 313 return getPersistence() 314 .findByG_P_C(groupId, portletId, classNameId, start, end); 315 } 316 317 /** 318 * Returns an ordered range of all the portlet items where groupId = ? and portletId = ? and classNameId = ?. 319 * 320 * <p> 321 * 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. 322 * </p> 323 * 324 * @param groupId the group ID 325 * @param portletId the portlet ID 326 * @param classNameId the class name ID 327 * @param start the lower bound of the range of portlet items 328 * @param end the upper bound of the range of portlet items (not inclusive) 329 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 330 * @return the ordered range of matching portlet items 331 */ 332 public static List<PortletItem> findByG_P_C(long groupId, 333 java.lang.String portletId, long classNameId, int start, int end, 334 OrderByComparator<PortletItem> orderByComparator) { 335 return getPersistence() 336 .findByG_P_C(groupId, portletId, classNameId, start, end, 337 orderByComparator); 338 } 339 340 /** 341 * Returns an ordered range of all the portlet items where groupId = ? and portletId = ? and classNameId = ?. 342 * 343 * <p> 344 * 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. 345 * </p> 346 * 347 * @param groupId the group ID 348 * @param portletId the portlet ID 349 * @param classNameId the class name ID 350 * @param start the lower bound of the range of portlet items 351 * @param end the upper bound of the range of portlet items (not inclusive) 352 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 353 * @param retrieveFromCache whether to retrieve from the finder cache 354 * @return the ordered range of matching portlet items 355 */ 356 public static List<PortletItem> findByG_P_C(long groupId, 357 java.lang.String portletId, long classNameId, int start, int end, 358 OrderByComparator<PortletItem> orderByComparator, 359 boolean retrieveFromCache) { 360 return getPersistence() 361 .findByG_P_C(groupId, portletId, classNameId, start, end, 362 orderByComparator, retrieveFromCache); 363 } 364 365 /** 366 * Returns the first portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?. 367 * 368 * @param groupId the group ID 369 * @param portletId the portlet ID 370 * @param classNameId the class name ID 371 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 372 * @return the first matching portlet item 373 * @throws NoSuchPortletItemException if a matching portlet item could not be found 374 */ 375 public static PortletItem findByG_P_C_First(long groupId, 376 java.lang.String portletId, long classNameId, 377 OrderByComparator<PortletItem> orderByComparator) 378 throws com.liferay.portal.exception.NoSuchPortletItemException { 379 return getPersistence() 380 .findByG_P_C_First(groupId, portletId, classNameId, 381 orderByComparator); 382 } 383 384 /** 385 * Returns the first portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?. 386 * 387 * @param groupId the group ID 388 * @param portletId the portlet ID 389 * @param classNameId the class name ID 390 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 391 * @return the first matching portlet item, or <code>null</code> if a matching portlet item could not be found 392 */ 393 public static PortletItem fetchByG_P_C_First(long groupId, 394 java.lang.String portletId, long classNameId, 395 OrderByComparator<PortletItem> orderByComparator) { 396 return getPersistence() 397 .fetchByG_P_C_First(groupId, portletId, classNameId, 398 orderByComparator); 399 } 400 401 /** 402 * Returns the last portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?. 403 * 404 * @param groupId the group ID 405 * @param portletId the portlet ID 406 * @param classNameId the class name ID 407 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 408 * @return the last matching portlet item 409 * @throws NoSuchPortletItemException if a matching portlet item could not be found 410 */ 411 public static PortletItem findByG_P_C_Last(long groupId, 412 java.lang.String portletId, long classNameId, 413 OrderByComparator<PortletItem> orderByComparator) 414 throws com.liferay.portal.exception.NoSuchPortletItemException { 415 return getPersistence() 416 .findByG_P_C_Last(groupId, portletId, classNameId, 417 orderByComparator); 418 } 419 420 /** 421 * Returns the last portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?. 422 * 423 * @param groupId the group ID 424 * @param portletId the portlet ID 425 * @param classNameId the class name ID 426 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 427 * @return the last matching portlet item, or <code>null</code> if a matching portlet item could not be found 428 */ 429 public static PortletItem fetchByG_P_C_Last(long groupId, 430 java.lang.String portletId, long classNameId, 431 OrderByComparator<PortletItem> orderByComparator) { 432 return getPersistence() 433 .fetchByG_P_C_Last(groupId, portletId, classNameId, 434 orderByComparator); 435 } 436 437 /** 438 * Returns the portlet items before and after the current portlet item in the ordered set where groupId = ? and portletId = ? and classNameId = ?. 439 * 440 * @param portletItemId the primary key of the current portlet item 441 * @param groupId the group ID 442 * @param portletId the portlet ID 443 * @param classNameId the class name ID 444 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 445 * @return the previous, current, and next portlet item 446 * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found 447 */ 448 public static PortletItem[] findByG_P_C_PrevAndNext(long portletItemId, 449 long groupId, java.lang.String portletId, long classNameId, 450 OrderByComparator<PortletItem> orderByComparator) 451 throws com.liferay.portal.exception.NoSuchPortletItemException { 452 return getPersistence() 453 .findByG_P_C_PrevAndNext(portletItemId, groupId, portletId, 454 classNameId, orderByComparator); 455 } 456 457 /** 458 * Removes all the portlet items where groupId = ? and portletId = ? and classNameId = ? from the database. 459 * 460 * @param groupId the group ID 461 * @param portletId the portlet ID 462 * @param classNameId the class name ID 463 */ 464 public static void removeByG_P_C(long groupId, java.lang.String portletId, 465 long classNameId) { 466 getPersistence().removeByG_P_C(groupId, portletId, classNameId); 467 } 468 469 /** 470 * Returns the number of portlet items where groupId = ? and portletId = ? and classNameId = ?. 471 * 472 * @param groupId the group ID 473 * @param portletId the portlet ID 474 * @param classNameId the class name ID 475 * @return the number of matching portlet items 476 */ 477 public static int countByG_P_C(long groupId, java.lang.String portletId, 478 long classNameId) { 479 return getPersistence().countByG_P_C(groupId, portletId, classNameId); 480 } 481 482 /** 483 * Returns the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? or throws a {@link NoSuchPortletItemException} if it could not be found. 484 * 485 * @param groupId the group ID 486 * @param name the name 487 * @param portletId the portlet ID 488 * @param classNameId the class name ID 489 * @return the matching portlet item 490 * @throws NoSuchPortletItemException if a matching portlet item could not be found 491 */ 492 public static PortletItem findByG_N_P_C(long groupId, 493 java.lang.String name, java.lang.String portletId, long classNameId) 494 throws com.liferay.portal.exception.NoSuchPortletItemException { 495 return getPersistence() 496 .findByG_N_P_C(groupId, name, portletId, classNameId); 497 } 498 499 /** 500 * Returns the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 501 * 502 * @param groupId the group ID 503 * @param name the name 504 * @param portletId the portlet ID 505 * @param classNameId the class name ID 506 * @return the matching portlet item, or <code>null</code> if a matching portlet item could not be found 507 */ 508 public static PortletItem fetchByG_N_P_C(long groupId, 509 java.lang.String name, java.lang.String portletId, long classNameId) { 510 return getPersistence() 511 .fetchByG_N_P_C(groupId, name, portletId, classNameId); 512 } 513 514 /** 515 * Returns the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 516 * 517 * @param groupId the group ID 518 * @param name the name 519 * @param portletId the portlet ID 520 * @param classNameId the class name ID 521 * @param retrieveFromCache whether to retrieve from the finder cache 522 * @return the matching portlet item, or <code>null</code> if a matching portlet item could not be found 523 */ 524 public static PortletItem fetchByG_N_P_C(long groupId, 525 java.lang.String name, java.lang.String portletId, long classNameId, 526 boolean retrieveFromCache) { 527 return getPersistence() 528 .fetchByG_N_P_C(groupId, name, portletId, classNameId, 529 retrieveFromCache); 530 } 531 532 /** 533 * Removes the portlet item where groupId = ? and name = ? and portletId = ? and classNameId = ? from the database. 534 * 535 * @param groupId the group ID 536 * @param name the name 537 * @param portletId the portlet ID 538 * @param classNameId the class name ID 539 * @return the portlet item that was removed 540 */ 541 public static PortletItem removeByG_N_P_C(long groupId, 542 java.lang.String name, java.lang.String portletId, long classNameId) 543 throws com.liferay.portal.exception.NoSuchPortletItemException { 544 return getPersistence() 545 .removeByG_N_P_C(groupId, name, portletId, classNameId); 546 } 547 548 /** 549 * Returns the number of portlet items where groupId = ? and name = ? and portletId = ? and classNameId = ?. 550 * 551 * @param groupId the group ID 552 * @param name the name 553 * @param portletId the portlet ID 554 * @param classNameId the class name ID 555 * @return the number of matching portlet items 556 */ 557 public static int countByG_N_P_C(long groupId, java.lang.String name, 558 java.lang.String portletId, long classNameId) { 559 return getPersistence() 560 .countByG_N_P_C(groupId, name, portletId, classNameId); 561 } 562 563 /** 564 * Caches the portlet item in the entity cache if it is enabled. 565 * 566 * @param portletItem the portlet item 567 */ 568 public static void cacheResult(PortletItem portletItem) { 569 getPersistence().cacheResult(portletItem); 570 } 571 572 /** 573 * Caches the portlet items in the entity cache if it is enabled. 574 * 575 * @param portletItems the portlet items 576 */ 577 public static void cacheResult(List<PortletItem> portletItems) { 578 getPersistence().cacheResult(portletItems); 579 } 580 581 /** 582 * Creates a new portlet item with the primary key. Does not add the portlet item to the database. 583 * 584 * @param portletItemId the primary key for the new portlet item 585 * @return the new portlet item 586 */ 587 public static PortletItem create(long portletItemId) { 588 return getPersistence().create(portletItemId); 589 } 590 591 /** 592 * Removes the portlet item with the primary key from the database. Also notifies the appropriate model listeners. 593 * 594 * @param portletItemId the primary key of the portlet item 595 * @return the portlet item that was removed 596 * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found 597 */ 598 public static PortletItem remove(long portletItemId) 599 throws com.liferay.portal.exception.NoSuchPortletItemException { 600 return getPersistence().remove(portletItemId); 601 } 602 603 public static PortletItem updateImpl(PortletItem portletItem) { 604 return getPersistence().updateImpl(portletItem); 605 } 606 607 /** 608 * Returns the portlet item with the primary key or throws a {@link NoSuchPortletItemException} if it could not be found. 609 * 610 * @param portletItemId the primary key of the portlet item 611 * @return the portlet item 612 * @throws NoSuchPortletItemException if a portlet item with the primary key could not be found 613 */ 614 public static PortletItem findByPrimaryKey(long portletItemId) 615 throws com.liferay.portal.exception.NoSuchPortletItemException { 616 return getPersistence().findByPrimaryKey(portletItemId); 617 } 618 619 /** 620 * Returns the portlet item with the primary key or returns <code>null</code> if it could not be found. 621 * 622 * @param portletItemId the primary key of the portlet item 623 * @return the portlet item, or <code>null</code> if a portlet item with the primary key could not be found 624 */ 625 public static PortletItem fetchByPrimaryKey(long portletItemId) { 626 return getPersistence().fetchByPrimaryKey(portletItemId); 627 } 628 629 public static java.util.Map<java.io.Serializable, PortletItem> fetchByPrimaryKeys( 630 java.util.Set<java.io.Serializable> primaryKeys) { 631 return getPersistence().fetchByPrimaryKeys(primaryKeys); 632 } 633 634 /** 635 * Returns all the portlet items. 636 * 637 * @return the portlet items 638 */ 639 public static List<PortletItem> findAll() { 640 return getPersistence().findAll(); 641 } 642 643 /** 644 * Returns a range of all the portlet items. 645 * 646 * <p> 647 * 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. 648 * </p> 649 * 650 * @param start the lower bound of the range of portlet items 651 * @param end the upper bound of the range of portlet items (not inclusive) 652 * @return the range of portlet items 653 */ 654 public static List<PortletItem> findAll(int start, int end) { 655 return getPersistence().findAll(start, end); 656 } 657 658 /** 659 * Returns an ordered range of all the portlet items. 660 * 661 * <p> 662 * 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. 663 * </p> 664 * 665 * @param start the lower bound of the range of portlet items 666 * @param end the upper bound of the range of portlet items (not inclusive) 667 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 668 * @return the ordered range of portlet items 669 */ 670 public static List<PortletItem> findAll(int start, int end, 671 OrderByComparator<PortletItem> orderByComparator) { 672 return getPersistence().findAll(start, end, orderByComparator); 673 } 674 675 /** 676 * Returns an ordered range of all the portlet items. 677 * 678 * <p> 679 * 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. 680 * </p> 681 * 682 * @param start the lower bound of the range of portlet items 683 * @param end the upper bound of the range of portlet items (not inclusive) 684 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 685 * @param retrieveFromCache whether to retrieve from the finder cache 686 * @return the ordered range of portlet items 687 */ 688 public static List<PortletItem> findAll(int start, int end, 689 OrderByComparator<PortletItem> orderByComparator, 690 boolean retrieveFromCache) { 691 return getPersistence() 692 .findAll(start, end, orderByComparator, retrieveFromCache); 693 } 694 695 /** 696 * Removes all the portlet items from the database. 697 */ 698 public static void removeAll() { 699 getPersistence().removeAll(); 700 } 701 702 /** 703 * Returns the number of portlet items. 704 * 705 * @return the number of portlet items 706 */ 707 public static int countAll() { 708 return getPersistence().countAll(); 709 } 710 711 public static PortletItemPersistence getPersistence() { 712 if (_persistence == null) { 713 _persistence = (PortletItemPersistence)PortalBeanLocatorUtil.locate(PortletItemPersistence.class.getName()); 714 715 ReferenceRegistry.registerReference(PortletItemUtil.class, 716 "_persistence"); 717 } 718 719 return _persistence; 720 } 721 722 private static PortletItemPersistence _persistence; 723 }