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