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 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 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 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 * Returns 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 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 * Returns 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 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 * Returns all the resource actions where name = ?. 202 * 203 * @param name the name 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 * Returns 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 221 * @param start the lower bound of the range of resource actions 222 * @param end the upper bound of the range of resource actions (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 * Returns 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 240 * @param start the lower bound of the range of resource actions 241 * @param end the upper bound of the range of resource actions (not inclusive) 242 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 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 * Returns 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 261 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 282 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 304 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 323 * @param actionId the action ID 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 * Returns 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 339 * @param actionId the action ID 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 * Returns 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 353 * @param actionId the action ID 354 * @param retrieveFromCache whether to use the finder cache 355 * @return the matching resource action, or <code>null</code> if a matching resource action could not be found 356 * @throws SystemException if a system exception occurred 357 */ 358 public static com.liferay.portal.model.ResourceAction fetchByN_A( 359 java.lang.String name, java.lang.String actionId, 360 boolean retrieveFromCache) 361 throws com.liferay.portal.kernel.exception.SystemException { 362 return getPersistence().fetchByN_A(name, actionId, retrieveFromCache); 363 } 364 365 /** 366 * Returns all the resource actions. 367 * 368 * @return the resource actions 369 * @throws SystemException if a system exception occurred 370 */ 371 public static java.util.List<com.liferay.portal.model.ResourceAction> findAll() 372 throws com.liferay.portal.kernel.exception.SystemException { 373 return getPersistence().findAll(); 374 } 375 376 /** 377 * Returns a range of all the resource actions. 378 * 379 * <p> 380 * 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. 381 * </p> 382 * 383 * @param start the lower bound of the range of resource actions 384 * @param end the upper bound of the range of resource actions (not inclusive) 385 * @return the range of resource actions 386 * @throws SystemException if a system exception occurred 387 */ 388 public static java.util.List<com.liferay.portal.model.ResourceAction> findAll( 389 int start, int end) 390 throws com.liferay.portal.kernel.exception.SystemException { 391 return getPersistence().findAll(start, end); 392 } 393 394 /** 395 * Returns an ordered range of all the resource actions. 396 * 397 * <p> 398 * 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. 399 * </p> 400 * 401 * @param start the lower bound of the range of resource actions 402 * @param end the upper bound of the range of resource actions (not inclusive) 403 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 404 * @return the ordered range of resource actions 405 * @throws SystemException if a system exception occurred 406 */ 407 public static java.util.List<com.liferay.portal.model.ResourceAction> findAll( 408 int start, int end, 409 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 410 throws com.liferay.portal.kernel.exception.SystemException { 411 return getPersistence().findAll(start, end, orderByComparator); 412 } 413 414 /** 415 * Removes all the resource actions where name = ? from the database. 416 * 417 * @param name the name 418 * @throws SystemException if a system exception occurred 419 */ 420 public static void removeByName(java.lang.String name) 421 throws com.liferay.portal.kernel.exception.SystemException { 422 getPersistence().removeByName(name); 423 } 424 425 /** 426 * Removes the resource action where name = ? and actionId = ? from the database. 427 * 428 * @param name the name 429 * @param actionId the action ID 430 * @throws SystemException if a system exception occurred 431 */ 432 public static void removeByN_A(java.lang.String name, 433 java.lang.String actionId) 434 throws com.liferay.portal.NoSuchResourceActionException, 435 com.liferay.portal.kernel.exception.SystemException { 436 getPersistence().removeByN_A(name, actionId); 437 } 438 439 /** 440 * Removes all the resource actions from the database. 441 * 442 * @throws SystemException if a system exception occurred 443 */ 444 public static void removeAll() 445 throws com.liferay.portal.kernel.exception.SystemException { 446 getPersistence().removeAll(); 447 } 448 449 /** 450 * Returns the number of resource actions where name = ?. 451 * 452 * @param name the name 453 * @return the number of matching resource actions 454 * @throws SystemException if a system exception occurred 455 */ 456 public static int countByName(java.lang.String name) 457 throws com.liferay.portal.kernel.exception.SystemException { 458 return getPersistence().countByName(name); 459 } 460 461 /** 462 * Returns the number of resource actions where name = ? and actionId = ?. 463 * 464 * @param name the name 465 * @param actionId the action ID 466 * @return the number of matching resource actions 467 * @throws SystemException if a system exception occurred 468 */ 469 public static int countByN_A(java.lang.String name, 470 java.lang.String actionId) 471 throws com.liferay.portal.kernel.exception.SystemException { 472 return getPersistence().countByN_A(name, actionId); 473 } 474 475 /** 476 * Returns the number of resource actions. 477 * 478 * @return the number of resource actions 479 * @throws SystemException if a system exception occurred 480 */ 481 public static int countAll() 482 throws com.liferay.portal.kernel.exception.SystemException { 483 return getPersistence().countAll(); 484 } 485 486 public static ResourceActionPersistence getPersistence() { 487 if (_persistence == null) { 488 _persistence = (ResourceActionPersistence)PortalBeanLocatorUtil.locate(ResourceActionPersistence.class.getName()); 489 490 ReferenceRegistry.registerReference(ResourceActionUtil.class, 491 "_persistence"); 492 } 493 494 return _persistence; 495 } 496 497 public void setPersistence(ResourceActionPersistence persistence) { 498 _persistence = persistence; 499 500 ReferenceRegistry.registerReference(ResourceActionUtil.class, 501 "_persistence"); 502 } 503 504 private static ResourceActionPersistence _persistence; 505 }