001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.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.model.ResourceAction; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the resource action service. This utility wraps {@link ResourceActionPersistenceImpl} 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. 029 * 030 * <p> 031 * Caching information and settings can be found in <code>portal.properties</code> 032 * </p> 033 * 034 * @author Brian Wing Shun Chan 035 * @see ResourceActionPersistence 036 * @see ResourceActionPersistenceImpl 037 * @generated 038 */ 039 public class ResourceActionUtil { 040 /* 041 * NOTE FOR DEVELOPERS: 042 * 043 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 044 */ 045 046 /** 047 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 048 */ 049 public static void clearCache() { 050 getPersistence().clearCache(); 051 } 052 053 /** 054 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 055 */ 056 public static void clearCache(ResourceAction resourceAction) { 057 getPersistence().clearCache(resourceAction); 058 } 059 060 /** 061 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 062 */ 063 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 064 throws SystemException { 065 return getPersistence().countWithDynamicQuery(dynamicQuery); 066 } 067 068 /** 069 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 070 */ 071 public static List<ResourceAction> findWithDynamicQuery( 072 DynamicQuery dynamicQuery) throws SystemException { 073 return getPersistence().findWithDynamicQuery(dynamicQuery); 074 } 075 076 /** 077 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 078 */ 079 public static List<ResourceAction> findWithDynamicQuery( 080 DynamicQuery dynamicQuery, int start, int end) 081 throws SystemException { 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<ResourceAction> findWithDynamicQuery( 089 DynamicQuery dynamicQuery, int start, int end, 090 OrderByComparator orderByComparator) throws SystemException { 091 return getPersistence() 092 .findWithDynamicQuery(dynamicQuery, start, end, 093 orderByComparator); 094 } 095 096 /** 097 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 098 */ 099 public static ResourceAction remove(ResourceAction resourceAction) 100 throws SystemException { 101 return getPersistence().remove(resourceAction); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 106 */ 107 public static ResourceAction update(ResourceAction resourceAction, 108 boolean merge) throws SystemException { 109 return getPersistence().update(resourceAction, merge); 110 } 111 112 /** 113 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 114 */ 115 public static ResourceAction update(ResourceAction resourceAction, 116 boolean merge, ServiceContext serviceContext) throws SystemException { 117 return getPersistence().update(resourceAction, merge, serviceContext); 118 } 119 120 /** 121 * Caches the resource action in the entity cache if it is enabled. 122 * 123 * @param resourceAction the resource action to cache 124 */ 125 public static void cacheResult( 126 com.liferay.portal.model.ResourceAction resourceAction) { 127 getPersistence().cacheResult(resourceAction); 128 } 129 130 /** 131 * Caches the resource actions in the entity cache if it is enabled. 132 * 133 * @param resourceActions the resource actions to cache 134 */ 135 public static void cacheResult( 136 java.util.List<com.liferay.portal.model.ResourceAction> resourceActions) { 137 getPersistence().cacheResult(resourceActions); 138 } 139 140 /** 141 * Creates a new resource action with the primary key. Does not add the resource action to the database. 142 * 143 * @param resourceActionId the primary key for the new resource action 144 * @return the new resource action 145 */ 146 public static com.liferay.portal.model.ResourceAction create( 147 long resourceActionId) { 148 return getPersistence().create(resourceActionId); 149 } 150 151 /** 152 * Removes the resource action with the primary key from the database. Also notifies the appropriate model listeners. 153 * 154 * @param resourceActionId the primary key of the resource action to remove 155 * @return the resource action that was removed 156 * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 public static com.liferay.portal.model.ResourceAction remove( 160 long resourceActionId) 161 throws com.liferay.portal.NoSuchResourceActionException, 162 com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().remove(resourceActionId); 164 } 165 166 public static com.liferay.portal.model.ResourceAction updateImpl( 167 com.liferay.portal.model.ResourceAction resourceAction, boolean merge) 168 throws com.liferay.portal.kernel.exception.SystemException { 169 return getPersistence().updateImpl(resourceAction, merge); 170 } 171 172 /** 173 * Finds the resource action with the primary key or throws a {@link com.liferay.portal.NoSuchResourceActionException} if it could not be found. 174 * 175 * @param resourceActionId the primary key of the resource action to find 176 * @return the resource action 177 * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found 178 * @throws SystemException if a system exception occurred 179 */ 180 public static com.liferay.portal.model.ResourceAction findByPrimaryKey( 181 long resourceActionId) 182 throws com.liferay.portal.NoSuchResourceActionException, 183 com.liferay.portal.kernel.exception.SystemException { 184 return getPersistence().findByPrimaryKey(resourceActionId); 185 } 186 187 /** 188 * Finds the resource action with the primary key or returns <code>null</code> if it could not be found. 189 * 190 * @param resourceActionId the primary key of the resource action to find 191 * @return the resource action, or <code>null</code> if a resource action with the primary key could not be found 192 * @throws SystemException if a system exception occurred 193 */ 194 public static com.liferay.portal.model.ResourceAction fetchByPrimaryKey( 195 long resourceActionId) 196 throws com.liferay.portal.kernel.exception.SystemException { 197 return getPersistence().fetchByPrimaryKey(resourceActionId); 198 } 199 200 /** 201 * Finds all the resource actions where name = ?. 202 * 203 * @param name the name to search with 204 * @return the matching resource actions 205 * @throws SystemException if a system exception occurred 206 */ 207 public static java.util.List<com.liferay.portal.model.ResourceAction> findByName( 208 java.lang.String name) 209 throws com.liferay.portal.kernel.exception.SystemException { 210 return getPersistence().findByName(name); 211 } 212 213 /** 214 * Finds a range of all the resource actions where name = ?. 215 * 216 * <p> 217 * 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. 218 * </p> 219 * 220 * @param name the name to search with 221 * @param start the lower bound of the range of resource actions to return 222 * @param end the upper bound of the range of resource actions to return (not inclusive) 223 * @return the range of matching resource actions 224 * @throws SystemException if a system exception occurred 225 */ 226 public static java.util.List<com.liferay.portal.model.ResourceAction> findByName( 227 java.lang.String name, int start, int end) 228 throws com.liferay.portal.kernel.exception.SystemException { 229 return getPersistence().findByName(name, start, end); 230 } 231 232 /** 233 * Finds an ordered range of all the resource actions where name = ?. 234 * 235 * <p> 236 * 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. 237 * </p> 238 * 239 * @param name the name to search with 240 * @param start the lower bound of the range of resource actions to return 241 * @param end the upper bound of the range of resource actions to return (not inclusive) 242 * @param orderByComparator the comparator to order the results by 243 * @return the ordered range of matching resource actions 244 * @throws SystemException if a system exception occurred 245 */ 246 public static java.util.List<com.liferay.portal.model.ResourceAction> findByName( 247 java.lang.String name, int start, int end, 248 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 249 throws com.liferay.portal.kernel.exception.SystemException { 250 return getPersistence().findByName(name, start, end, orderByComparator); 251 } 252 253 /** 254 * Finds the first resource action in the ordered set where name = ?. 255 * 256 * <p> 257 * 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. 258 * </p> 259 * 260 * @param name the name to search with 261 * @param orderByComparator the comparator to order the set by 262 * @return the first matching resource action 263 * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found 264 * @throws SystemException if a system exception occurred 265 */ 266 public static com.liferay.portal.model.ResourceAction findByName_First( 267 java.lang.String name, 268 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 269 throws com.liferay.portal.NoSuchResourceActionException, 270 com.liferay.portal.kernel.exception.SystemException { 271 return getPersistence().findByName_First(name, orderByComparator); 272 } 273 274 /** 275 * Finds the last resource action in the ordered set where name = ?. 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 com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 279 * </p> 280 * 281 * @param name the name to search with 282 * @param orderByComparator the comparator to order the set by 283 * @return the last matching resource action 284 * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found 285 * @throws SystemException if a system exception occurred 286 */ 287 public static com.liferay.portal.model.ResourceAction findByName_Last( 288 java.lang.String name, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.NoSuchResourceActionException, 291 com.liferay.portal.kernel.exception.SystemException { 292 return getPersistence().findByName_Last(name, orderByComparator); 293 } 294 295 /** 296 * Finds the resource actions before and after the current resource action in the ordered set where name = ?. 297 * 298 * <p> 299 * 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. 300 * </p> 301 * 302 * @param resourceActionId the primary key of the current resource action 303 * @param name the name to search with 304 * @param orderByComparator the comparator to order the set by 305 * @return the previous, current, and next resource action 306 * @throws com.liferay.portal.NoSuchResourceActionException if a resource action with the primary key could not be found 307 * @throws SystemException if a system exception occurred 308 */ 309 public static com.liferay.portal.model.ResourceAction[] findByName_PrevAndNext( 310 long resourceActionId, java.lang.String name, 311 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 312 throws com.liferay.portal.NoSuchResourceActionException, 313 com.liferay.portal.kernel.exception.SystemException { 314 return getPersistence() 315 .findByName_PrevAndNext(resourceActionId, name, 316 orderByComparator); 317 } 318 319 /** 320 * Finds the resource action where name = ? and actionId = ? or throws a {@link com.liferay.portal.NoSuchResourceActionException} if it could not be found. 321 * 322 * @param name the name to search with 323 * @param actionId the action ID to search with 324 * @return the matching resource action 325 * @throws com.liferay.portal.NoSuchResourceActionException if a matching resource action could not be found 326 * @throws SystemException if a system exception occurred 327 */ 328 public static com.liferay.portal.model.ResourceAction findByN_A( 329 java.lang.String name, java.lang.String actionId) 330 throws com.liferay.portal.NoSuchResourceActionException, 331 com.liferay.portal.kernel.exception.SystemException { 332 return getPersistence().findByN_A(name, actionId); 333 } 334 335 /** 336 * Finds the resource action where name = ? and actionId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 337 * 338 * @param name the name to search with 339 * @param actionId the action ID to search with 340 * @return the matching resource action, or <code>null</code> if a matching resource action could not be found 341 * @throws SystemException if a system exception occurred 342 */ 343 public static com.liferay.portal.model.ResourceAction fetchByN_A( 344 java.lang.String name, java.lang.String actionId) 345 throws com.liferay.portal.kernel.exception.SystemException { 346 return getPersistence().fetchByN_A(name, actionId); 347 } 348 349 /** 350 * Finds the resource action where name = ? and actionId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 351 * 352 * @param name the name to search with 353 * @param actionId the action ID to search with 354 * @return the matching resource action, or <code>null</code> if a matching resource action could not be found 355 * @throws SystemException if a system exception occurred 356 */ 357 public static com.liferay.portal.model.ResourceAction fetchByN_A( 358 java.lang.String name, java.lang.String actionId, 359 boolean retrieveFromCache) 360 throws com.liferay.portal.kernel.exception.SystemException { 361 return getPersistence().fetchByN_A(name, actionId, retrieveFromCache); 362 } 363 364 /** 365 * Finds all the resource actions. 366 * 367 * @return the resource actions 368 * @throws SystemException if a system exception occurred 369 */ 370 public static java.util.List<com.liferay.portal.model.ResourceAction> findAll() 371 throws com.liferay.portal.kernel.exception.SystemException { 372 return getPersistence().findAll(); 373 } 374 375 /** 376 * Finds a range of all the resource actions. 377 * 378 * <p> 379 * 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. 380 * </p> 381 * 382 * @param start the lower bound of the range of resource actions to return 383 * @param end the upper bound of the range of resource actions to return (not inclusive) 384 * @return the range of resource actions 385 * @throws SystemException if a system exception occurred 386 */ 387 public static java.util.List<com.liferay.portal.model.ResourceAction> findAll( 388 int start, int end) 389 throws com.liferay.portal.kernel.exception.SystemException { 390 return getPersistence().findAll(start, end); 391 } 392 393 /** 394 * Finds an ordered range of all the resource actions. 395 * 396 * <p> 397 * 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. 398 * </p> 399 * 400 * @param start the lower bound of the range of resource actions to return 401 * @param end the upper bound of the range of resource actions to return (not inclusive) 402 * @param orderByComparator the comparator to order the results by 403 * @return the ordered range of resource actions 404 * @throws SystemException if a system exception occurred 405 */ 406 public static java.util.List<com.liferay.portal.model.ResourceAction> findAll( 407 int start, int end, 408 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 409 throws com.liferay.portal.kernel.exception.SystemException { 410 return getPersistence().findAll(start, end, orderByComparator); 411 } 412 413 /** 414 * Removes all the resource actions where name = ? from the database. 415 * 416 * @param name the name to search with 417 * @throws SystemException if a system exception occurred 418 */ 419 public static void removeByName(java.lang.String name) 420 throws com.liferay.portal.kernel.exception.SystemException { 421 getPersistence().removeByName(name); 422 } 423 424 /** 425 * Removes the resource action where name = ? and actionId = ? from the database. 426 * 427 * @param name the name to search with 428 * @param actionId the action ID to search with 429 * @throws SystemException if a system exception occurred 430 */ 431 public static void removeByN_A(java.lang.String name, 432 java.lang.String actionId) 433 throws com.liferay.portal.NoSuchResourceActionException, 434 com.liferay.portal.kernel.exception.SystemException { 435 getPersistence().removeByN_A(name, actionId); 436 } 437 438 /** 439 * Removes all the resource actions from the database. 440 * 441 * @throws SystemException if a system exception occurred 442 */ 443 public static void removeAll() 444 throws com.liferay.portal.kernel.exception.SystemException { 445 getPersistence().removeAll(); 446 } 447 448 /** 449 * Counts all the resource actions where name = ?. 450 * 451 * @param name the name to search with 452 * @return the number of matching resource actions 453 * @throws SystemException if a system exception occurred 454 */ 455 public static int countByName(java.lang.String name) 456 throws com.liferay.portal.kernel.exception.SystemException { 457 return getPersistence().countByName(name); 458 } 459 460 /** 461 * Counts all the resource actions where name = ? and actionId = ?. 462 * 463 * @param name the name to search with 464 * @param actionId the action ID to search with 465 * @return the number of matching resource actions 466 * @throws SystemException if a system exception occurred 467 */ 468 public static int countByN_A(java.lang.String name, 469 java.lang.String actionId) 470 throws com.liferay.portal.kernel.exception.SystemException { 471 return getPersistence().countByN_A(name, actionId); 472 } 473 474 /** 475 * Counts all the resource actions. 476 * 477 * @return the number of resource actions 478 * @throws SystemException if a system exception occurred 479 */ 480 public static int countAll() 481 throws com.liferay.portal.kernel.exception.SystemException { 482 return getPersistence().countAll(); 483 } 484 485 public static ResourceActionPersistence getPersistence() { 486 if (_persistence == null) { 487 _persistence = (ResourceActionPersistence)PortalBeanLocatorUtil.locate(ResourceActionPersistence.class.getName()); 488 489 ReferenceRegistry.registerReference(ResourceActionUtil.class, 490 "_persistence"); 491 } 492 493 return _persistence; 494 } 495 496 public void setPersistence(ResourceActionPersistence persistence) { 497 _persistence = persistence; 498 499 ReferenceRegistry.registerReference(ResourceActionUtil.class, 500 "_persistence"); 501 } 502 503 private static ResourceActionPersistence _persistence; 504 }