001 /** 002 * Copyright (c) 2000-2011 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.portal.service.persistence; 016 017 import com.liferay.portal.kernel.exception.SystemException; 018 import com.liferay.portal.model.Account; 019 020 /** 021 * The persistence interface for the account service. 022 * 023 * <p> 024 * Caching information and settings can be found in <code>portal.properties</code> 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see AccountPersistenceImpl 029 * @see AccountUtil 030 * @generated 031 */ 032 public interface AccountPersistence extends BasePersistence<Account> { 033 /* 034 * NOTE FOR DEVELOPERS: 035 * 036 * Never modify or reference this interface directly. Always use {@link AccountUtil} to access the account persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 037 */ 038 039 /** 040 * Caches the account in the entity cache if it is enabled. 041 * 042 * @param account the account 043 */ 044 public void cacheResult(com.liferay.portal.model.Account account); 045 046 /** 047 * Caches the accounts in the entity cache if it is enabled. 048 * 049 * @param accounts the accounts 050 */ 051 public void cacheResult( 052 java.util.List<com.liferay.portal.model.Account> accounts); 053 054 /** 055 * Creates a new account with the primary key. Does not add the account to the database. 056 * 057 * @param accountId the primary key for the new account 058 * @return the new account 059 */ 060 public com.liferay.portal.model.Account create(long accountId); 061 062 /** 063 * Removes the account with the primary key from the database. Also notifies the appropriate model listeners. 064 * 065 * @param accountId the primary key of the account 066 * @return the account that was removed 067 * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found 068 * @throws SystemException if a system exception occurred 069 */ 070 public com.liferay.portal.model.Account remove(long accountId) 071 throws com.liferay.portal.NoSuchAccountException, 072 com.liferay.portal.kernel.exception.SystemException; 073 074 public com.liferay.portal.model.Account updateImpl( 075 com.liferay.portal.model.Account account, boolean merge) 076 throws com.liferay.portal.kernel.exception.SystemException; 077 078 /** 079 * Returns the account with the primary key or throws a {@link com.liferay.portal.NoSuchAccountException} if it could not be found. 080 * 081 * @param accountId the primary key of the account 082 * @return the account 083 * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found 084 * @throws SystemException if a system exception occurred 085 */ 086 public com.liferay.portal.model.Account findByPrimaryKey(long accountId) 087 throws com.liferay.portal.NoSuchAccountException, 088 com.liferay.portal.kernel.exception.SystemException; 089 090 /** 091 * Returns the account with the primary key or returns <code>null</code> if it could not be found. 092 * 093 * @param accountId the primary key of the account 094 * @return the account, or <code>null</code> if a account with the primary key could not be found 095 * @throws SystemException if a system exception occurred 096 */ 097 public com.liferay.portal.model.Account fetchByPrimaryKey(long accountId) 098 throws com.liferay.portal.kernel.exception.SystemException; 099 100 /** 101 * Returns all the accounts. 102 * 103 * @return the accounts 104 * @throws SystemException if a system exception occurred 105 */ 106 public java.util.List<com.liferay.portal.model.Account> findAll() 107 throws com.liferay.portal.kernel.exception.SystemException; 108 109 /** 110 * Returns a range of all the accounts. 111 * 112 * <p> 113 * 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. 114 * </p> 115 * 116 * @param start the lower bound of the range of accounts 117 * @param end the upper bound of the range of accounts (not inclusive) 118 * @return the range of accounts 119 * @throws SystemException if a system exception occurred 120 */ 121 public java.util.List<com.liferay.portal.model.Account> findAll(int start, 122 int end) throws com.liferay.portal.kernel.exception.SystemException; 123 124 /** 125 * Returns an ordered range of all the accounts. 126 * 127 * <p> 128 * 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. 129 * </p> 130 * 131 * @param start the lower bound of the range of accounts 132 * @param end the upper bound of the range of accounts (not inclusive) 133 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 134 * @return the ordered range of accounts 135 * @throws SystemException if a system exception occurred 136 */ 137 public java.util.List<com.liferay.portal.model.Account> findAll(int start, 138 int end, 139 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 140 throws com.liferay.portal.kernel.exception.SystemException; 141 142 /** 143 * Removes all the accounts from the database. 144 * 145 * @throws SystemException if a system exception occurred 146 */ 147 public void removeAll() 148 throws com.liferay.portal.kernel.exception.SystemException; 149 150 /** 151 * Returns the number of accounts. 152 * 153 * @return the number of accounts 154 * @throws SystemException if a system exception occurred 155 */ 156 public int countAll() 157 throws com.liferay.portal.kernel.exception.SystemException; 158 159 public Account remove(Account account) throws SystemException; 160 }