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