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.portlet.wiki.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.service.ServiceContext; 024 025 import com.liferay.portlet.wiki.model.WikiPageResource; 026 027 import java.util.List; 028 029 /** 030 * The persistence utility for the wiki page resource service. This utility wraps {@link WikiPageResourcePersistenceImpl} 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. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see WikiPageResourcePersistence 038 * @see WikiPageResourcePersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class WikiPageResourceUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(WikiPageResource wikiPageResource) { 060 getPersistence().clearCache(wikiPageResource); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) { 067 return getPersistence().countWithDynamicQuery(dynamicQuery); 068 } 069 070 /** 071 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 072 */ 073 public static List<WikiPageResource> findWithDynamicQuery( 074 DynamicQuery dynamicQuery) { 075 return getPersistence().findWithDynamicQuery(dynamicQuery); 076 } 077 078 /** 079 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 080 */ 081 public static List<WikiPageResource> findWithDynamicQuery( 082 DynamicQuery dynamicQuery, int start, int end) { 083 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 084 } 085 086 /** 087 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 088 */ 089 public static List<WikiPageResource> findWithDynamicQuery( 090 DynamicQuery dynamicQuery, int start, int end, 091 OrderByComparator<WikiPageResource> orderByComparator) { 092 return getPersistence() 093 .findWithDynamicQuery(dynamicQuery, start, end, 094 orderByComparator); 095 } 096 097 /** 098 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 099 */ 100 public static WikiPageResource update(WikiPageResource wikiPageResource) { 101 return getPersistence().update(wikiPageResource); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 106 */ 107 public static WikiPageResource update(WikiPageResource wikiPageResource, 108 ServiceContext serviceContext) { 109 return getPersistence().update(wikiPageResource, serviceContext); 110 } 111 112 /** 113 * Returns all the wiki page resources where uuid = ?. 114 * 115 * @param uuid the uuid 116 * @return the matching wiki page resources 117 */ 118 public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findByUuid( 119 java.lang.String uuid) { 120 return getPersistence().findByUuid(uuid); 121 } 122 123 /** 124 * Returns a range of all the wiki page resources where uuid = ?. 125 * 126 * <p> 127 * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.wiki.model.impl.WikiPageResourceModelImpl}. 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. 128 * </p> 129 * 130 * @param uuid the uuid 131 * @param start the lower bound of the range of wiki page resources 132 * @param end the upper bound of the range of wiki page resources (not inclusive) 133 * @return the range of matching wiki page resources 134 */ 135 public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findByUuid( 136 java.lang.String uuid, int start, int end) { 137 return getPersistence().findByUuid(uuid, start, end); 138 } 139 140 /** 141 * Returns an ordered range of all the wiki page resources where uuid = ?. 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.wiki.model.impl.WikiPageResourceModelImpl}. 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 uuid the uuid 148 * @param start the lower bound of the range of wiki page resources 149 * @param end the upper bound of the range of wiki page resources (not inclusive) 150 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 151 * @return the ordered range of matching wiki page resources 152 */ 153 public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findByUuid( 154 java.lang.String uuid, int start, int end, 155 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.wiki.model.WikiPageResource> orderByComparator) { 156 return getPersistence().findByUuid(uuid, start, end, orderByComparator); 157 } 158 159 /** 160 * Returns the first wiki page resource in the ordered set where uuid = ?. 161 * 162 * @param uuid the uuid 163 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 164 * @return the first matching wiki page resource 165 * @throws com.liferay.portlet.wiki.NoSuchPageResourceException if a matching wiki page resource could not be found 166 */ 167 public static com.liferay.portlet.wiki.model.WikiPageResource findByUuid_First( 168 java.lang.String uuid, 169 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.wiki.model.WikiPageResource> orderByComparator) 170 throws com.liferay.portlet.wiki.NoSuchPageResourceException { 171 return getPersistence().findByUuid_First(uuid, orderByComparator); 172 } 173 174 /** 175 * Returns the first wiki page resource in the ordered set where uuid = ?. 176 * 177 * @param uuid the uuid 178 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 179 * @return the first matching wiki page resource, or <code>null</code> if a matching wiki page resource could not be found 180 */ 181 public static com.liferay.portlet.wiki.model.WikiPageResource fetchByUuid_First( 182 java.lang.String uuid, 183 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.wiki.model.WikiPageResource> orderByComparator) { 184 return getPersistence().fetchByUuid_First(uuid, orderByComparator); 185 } 186 187 /** 188 * Returns the last wiki page resource in the ordered set where uuid = ?. 189 * 190 * @param uuid the uuid 191 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 192 * @return the last matching wiki page resource 193 * @throws com.liferay.portlet.wiki.NoSuchPageResourceException if a matching wiki page resource could not be found 194 */ 195 public static com.liferay.portlet.wiki.model.WikiPageResource findByUuid_Last( 196 java.lang.String uuid, 197 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.wiki.model.WikiPageResource> orderByComparator) 198 throws com.liferay.portlet.wiki.NoSuchPageResourceException { 199 return getPersistence().findByUuid_Last(uuid, orderByComparator); 200 } 201 202 /** 203 * Returns the last wiki page resource in the ordered set where uuid = ?. 204 * 205 * @param uuid the uuid 206 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 207 * @return the last matching wiki page resource, or <code>null</code> if a matching wiki page resource could not be found 208 */ 209 public static com.liferay.portlet.wiki.model.WikiPageResource fetchByUuid_Last( 210 java.lang.String uuid, 211 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.wiki.model.WikiPageResource> orderByComparator) { 212 return getPersistence().fetchByUuid_Last(uuid, orderByComparator); 213 } 214 215 /** 216 * Returns the wiki page resources before and after the current wiki page resource in the ordered set where uuid = ?. 217 * 218 * @param resourcePrimKey the primary key of the current wiki page resource 219 * @param uuid the uuid 220 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 221 * @return the previous, current, and next wiki page resource 222 * @throws com.liferay.portlet.wiki.NoSuchPageResourceException if a wiki page resource with the primary key could not be found 223 */ 224 public static com.liferay.portlet.wiki.model.WikiPageResource[] findByUuid_PrevAndNext( 225 long resourcePrimKey, java.lang.String uuid, 226 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.wiki.model.WikiPageResource> orderByComparator) 227 throws com.liferay.portlet.wiki.NoSuchPageResourceException { 228 return getPersistence() 229 .findByUuid_PrevAndNext(resourcePrimKey, uuid, 230 orderByComparator); 231 } 232 233 /** 234 * Removes all the wiki page resources where uuid = ? from the database. 235 * 236 * @param uuid the uuid 237 */ 238 public static void removeByUuid(java.lang.String uuid) { 239 getPersistence().removeByUuid(uuid); 240 } 241 242 /** 243 * Returns the number of wiki page resources where uuid = ?. 244 * 245 * @param uuid the uuid 246 * @return the number of matching wiki page resources 247 */ 248 public static int countByUuid(java.lang.String uuid) { 249 return getPersistence().countByUuid(uuid); 250 } 251 252 /** 253 * Returns the wiki page resource where nodeId = ? and title = ? or throws a {@link com.liferay.portlet.wiki.NoSuchPageResourceException} if it could not be found. 254 * 255 * @param nodeId the node ID 256 * @param title the title 257 * @return the matching wiki page resource 258 * @throws com.liferay.portlet.wiki.NoSuchPageResourceException if a matching wiki page resource could not be found 259 */ 260 public static com.liferay.portlet.wiki.model.WikiPageResource findByN_T( 261 long nodeId, java.lang.String title) 262 throws com.liferay.portlet.wiki.NoSuchPageResourceException { 263 return getPersistence().findByN_T(nodeId, title); 264 } 265 266 /** 267 * Returns the wiki page resource where nodeId = ? and title = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 268 * 269 * @param nodeId the node ID 270 * @param title the title 271 * @return the matching wiki page resource, or <code>null</code> if a matching wiki page resource could not be found 272 */ 273 public static com.liferay.portlet.wiki.model.WikiPageResource fetchByN_T( 274 long nodeId, java.lang.String title) { 275 return getPersistence().fetchByN_T(nodeId, title); 276 } 277 278 /** 279 * Returns the wiki page resource where nodeId = ? and title = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 280 * 281 * @param nodeId the node ID 282 * @param title the title 283 * @param retrieveFromCache whether to use the finder cache 284 * @return the matching wiki page resource, or <code>null</code> if a matching wiki page resource could not be found 285 */ 286 public static com.liferay.portlet.wiki.model.WikiPageResource fetchByN_T( 287 long nodeId, java.lang.String title, boolean retrieveFromCache) { 288 return getPersistence().fetchByN_T(nodeId, title, retrieveFromCache); 289 } 290 291 /** 292 * Removes the wiki page resource where nodeId = ? and title = ? from the database. 293 * 294 * @param nodeId the node ID 295 * @param title the title 296 * @return the wiki page resource that was removed 297 */ 298 public static com.liferay.portlet.wiki.model.WikiPageResource removeByN_T( 299 long nodeId, java.lang.String title) 300 throws com.liferay.portlet.wiki.NoSuchPageResourceException { 301 return getPersistence().removeByN_T(nodeId, title); 302 } 303 304 /** 305 * Returns the number of wiki page resources where nodeId = ? and title = ?. 306 * 307 * @param nodeId the node ID 308 * @param title the title 309 * @return the number of matching wiki page resources 310 */ 311 public static int countByN_T(long nodeId, java.lang.String title) { 312 return getPersistence().countByN_T(nodeId, title); 313 } 314 315 /** 316 * Caches the wiki page resource in the entity cache if it is enabled. 317 * 318 * @param wikiPageResource the wiki page resource 319 */ 320 public static void cacheResult( 321 com.liferay.portlet.wiki.model.WikiPageResource wikiPageResource) { 322 getPersistence().cacheResult(wikiPageResource); 323 } 324 325 /** 326 * Caches the wiki page resources in the entity cache if it is enabled. 327 * 328 * @param wikiPageResources the wiki page resources 329 */ 330 public static void cacheResult( 331 java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> wikiPageResources) { 332 getPersistence().cacheResult(wikiPageResources); 333 } 334 335 /** 336 * Creates a new wiki page resource with the primary key. Does not add the wiki page resource to the database. 337 * 338 * @param resourcePrimKey the primary key for the new wiki page resource 339 * @return the new wiki page resource 340 */ 341 public static com.liferay.portlet.wiki.model.WikiPageResource create( 342 long resourcePrimKey) { 343 return getPersistence().create(resourcePrimKey); 344 } 345 346 /** 347 * Removes the wiki page resource with the primary key from the database. Also notifies the appropriate model listeners. 348 * 349 * @param resourcePrimKey the primary key of the wiki page resource 350 * @return the wiki page resource that was removed 351 * @throws com.liferay.portlet.wiki.NoSuchPageResourceException if a wiki page resource with the primary key could not be found 352 */ 353 public static com.liferay.portlet.wiki.model.WikiPageResource remove( 354 long resourcePrimKey) 355 throws com.liferay.portlet.wiki.NoSuchPageResourceException { 356 return getPersistence().remove(resourcePrimKey); 357 } 358 359 public static com.liferay.portlet.wiki.model.WikiPageResource updateImpl( 360 com.liferay.portlet.wiki.model.WikiPageResource wikiPageResource) { 361 return getPersistence().updateImpl(wikiPageResource); 362 } 363 364 /** 365 * Returns the wiki page resource with the primary key or throws a {@link com.liferay.portlet.wiki.NoSuchPageResourceException} if it could not be found. 366 * 367 * @param resourcePrimKey the primary key of the wiki page resource 368 * @return the wiki page resource 369 * @throws com.liferay.portlet.wiki.NoSuchPageResourceException if a wiki page resource with the primary key could not be found 370 */ 371 public static com.liferay.portlet.wiki.model.WikiPageResource findByPrimaryKey( 372 long resourcePrimKey) 373 throws com.liferay.portlet.wiki.NoSuchPageResourceException { 374 return getPersistence().findByPrimaryKey(resourcePrimKey); 375 } 376 377 /** 378 * Returns the wiki page resource with the primary key or returns <code>null</code> if it could not be found. 379 * 380 * @param resourcePrimKey the primary key of the wiki page resource 381 * @return the wiki page resource, or <code>null</code> if a wiki page resource with the primary key could not be found 382 */ 383 public static com.liferay.portlet.wiki.model.WikiPageResource fetchByPrimaryKey( 384 long resourcePrimKey) { 385 return getPersistence().fetchByPrimaryKey(resourcePrimKey); 386 } 387 388 public static java.util.Map<java.io.Serializable, com.liferay.portlet.wiki.model.WikiPageResource> fetchByPrimaryKeys( 389 java.util.Set<java.io.Serializable> primaryKeys) { 390 return getPersistence().fetchByPrimaryKeys(primaryKeys); 391 } 392 393 /** 394 * Returns all the wiki page resources. 395 * 396 * @return the wiki page resources 397 */ 398 public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findAll() { 399 return getPersistence().findAll(); 400 } 401 402 /** 403 * Returns a range of all the wiki page resources. 404 * 405 * <p> 406 * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.wiki.model.impl.WikiPageResourceModelImpl}. 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. 407 * </p> 408 * 409 * @param start the lower bound of the range of wiki page resources 410 * @param end the upper bound of the range of wiki page resources (not inclusive) 411 * @return the range of wiki page resources 412 */ 413 public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findAll( 414 int start, int end) { 415 return getPersistence().findAll(start, end); 416 } 417 418 /** 419 * Returns an ordered range of all the wiki page resources. 420 * 421 * <p> 422 * 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 com.liferay.portal.kernel.dao.orm.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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.wiki.model.impl.WikiPageResourceModelImpl}. 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. 423 * </p> 424 * 425 * @param start the lower bound of the range of wiki page resources 426 * @param end the upper bound of the range of wiki page resources (not inclusive) 427 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 428 * @return the ordered range of wiki page resources 429 */ 430 public static java.util.List<com.liferay.portlet.wiki.model.WikiPageResource> findAll( 431 int start, int end, 432 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.wiki.model.WikiPageResource> orderByComparator) { 433 return getPersistence().findAll(start, end, orderByComparator); 434 } 435 436 /** 437 * Removes all the wiki page resources from the database. 438 */ 439 public static void removeAll() { 440 getPersistence().removeAll(); 441 } 442 443 /** 444 * Returns the number of wiki page resources. 445 * 446 * @return the number of wiki page resources 447 */ 448 public static int countAll() { 449 return getPersistence().countAll(); 450 } 451 452 public static WikiPageResourcePersistence getPersistence() { 453 if (_persistence == null) { 454 _persistence = (WikiPageResourcePersistence)PortalBeanLocatorUtil.locate(WikiPageResourcePersistence.class.getName()); 455 456 ReferenceRegistry.registerReference(WikiPageResourceUtil.class, 457 "_persistence"); 458 } 459 460 return _persistence; 461 } 462 463 /** 464 * @deprecated As of 6.2.0 465 */ 466 @Deprecated 467 public void setPersistence(WikiPageResourcePersistence persistence) { 468 } 469 470 private static WikiPageResourcePersistence _persistence; 471 }