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