001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.persistence;
022:
023: /**
024: * <a href="AccountUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * @author Brian Wing Shun Chan
027: *
028: */
029: public class AccountUtil {
030: public static com.liferay.portal.model.Account create(long accountId) {
031: return getPersistence().create(accountId);
032: }
033:
034: public static com.liferay.portal.model.Account remove(long accountId)
035: throws com.liferay.portal.SystemException,
036: com.liferay.portal.NoSuchAccountException {
037: return getPersistence().remove(accountId);
038: }
039:
040: public static com.liferay.portal.model.Account remove(
041: com.liferay.portal.model.Account account)
042: throws com.liferay.portal.SystemException {
043: return getPersistence().remove(account);
044: }
045:
046: public static com.liferay.portal.model.Account update(
047: com.liferay.portal.model.Account account)
048: throws com.liferay.portal.SystemException {
049: return getPersistence().update(account);
050: }
051:
052: public static com.liferay.portal.model.Account update(
053: com.liferay.portal.model.Account account, boolean merge)
054: throws com.liferay.portal.SystemException {
055: return getPersistence().update(account, merge);
056: }
057:
058: public static com.liferay.portal.model.Account updateImpl(
059: com.liferay.portal.model.Account account, boolean merge)
060: throws com.liferay.portal.SystemException {
061: return getPersistence().updateImpl(account, merge);
062: }
063:
064: public static com.liferay.portal.model.Account findByPrimaryKey(
065: long accountId) throws com.liferay.portal.SystemException,
066: com.liferay.portal.NoSuchAccountException {
067: return getPersistence().findByPrimaryKey(accountId);
068: }
069:
070: public static com.liferay.portal.model.Account fetchByPrimaryKey(
071: long accountId) throws com.liferay.portal.SystemException {
072: return getPersistence().fetchByPrimaryKey(accountId);
073: }
074:
075: public static java.util.List findWithDynamicQuery(
076: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
077: throws com.liferay.portal.SystemException {
078: return getPersistence().findWithDynamicQuery(queryInitializer);
079: }
080:
081: public static java.util.List findWithDynamicQuery(
082: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
083: int begin, int end)
084: throws com.liferay.portal.SystemException {
085: return getPersistence().findWithDynamicQuery(queryInitializer,
086: begin, end);
087: }
088:
089: public static java.util.List findAll()
090: throws com.liferay.portal.SystemException {
091: return getPersistence().findAll();
092: }
093:
094: public static java.util.List findAll(int begin, int end)
095: throws com.liferay.portal.SystemException {
096: return getPersistence().findAll(begin, end);
097: }
098:
099: public static java.util.List findAll(int begin, int end,
100: com.liferay.portal.kernel.util.OrderByComparator obc)
101: throws com.liferay.portal.SystemException {
102: return getPersistence().findAll(begin, end, obc);
103: }
104:
105: public static void removeAll()
106: throws com.liferay.portal.SystemException {
107: getPersistence().removeAll();
108: }
109:
110: public static int countAll()
111: throws com.liferay.portal.SystemException {
112: return getPersistence().countAll();
113: }
114:
115: public static AccountPersistence getPersistence() {
116: return _getUtil()._persistence;
117: }
118:
119: public void setPersistence(AccountPersistence persistence) {
120: _persistence = persistence;
121: }
122:
123: private static AccountUtil _getUtil() {
124: if (_util == null) {
125: _util = (AccountUtil) com.liferay.portal.kernel.bean.BeanLocatorUtil
126: .locate(_UTIL);
127: }
128:
129: return _util;
130: }
131:
132: private static final String _UTIL = AccountUtil.class.getName();
133: private static AccountUtil _util;
134: private AccountPersistence _persistence;
135: }
|