001    /**
002     * Copyright (c) 2000-2012 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     * Caching information and settings can be found in <code>portal.properties</code>
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             * NOTE FOR DEVELOPERS:
034             *
035             * 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.
036             */
037    
038            /**
039            * Caches the account in the entity cache if it is enabled.
040            *
041            * @param account the account
042            */
043            public void cacheResult(com.liferay.portal.model.Account account);
044    
045            /**
046            * Caches the accounts in the entity cache if it is enabled.
047            *
048            * @param accounts the accounts
049            */
050            public void cacheResult(
051                    java.util.List<com.liferay.portal.model.Account> accounts);
052    
053            /**
054            * Creates a new account with the primary key. Does not add the account to the database.
055            *
056            * @param accountId the primary key for the new account
057            * @return the new account
058            */
059            public com.liferay.portal.model.Account create(long accountId);
060    
061            /**
062            * Removes the account with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param accountId the primary key of the account
065            * @return the account that was removed
066            * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public com.liferay.portal.model.Account remove(long accountId)
070                    throws com.liferay.portal.NoSuchAccountException,
071                            com.liferay.portal.kernel.exception.SystemException;
072    
073            public com.liferay.portal.model.Account updateImpl(
074                    com.liferay.portal.model.Account account)
075                    throws com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Returns the account with the primary key or throws a {@link com.liferay.portal.NoSuchAccountException} if it could not be found.
079            *
080            * @param accountId the primary key of the account
081            * @return the account
082            * @throws com.liferay.portal.NoSuchAccountException if a account with the primary key could not be found
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.Account findByPrimaryKey(long accountId)
086                    throws com.liferay.portal.NoSuchAccountException,
087                            com.liferay.portal.kernel.exception.SystemException;
088    
089            /**
090            * Returns the account with the primary key or returns <code>null</code> if it could not be found.
091            *
092            * @param accountId the primary key of the account
093            * @return the account, or <code>null</code> if a account with the primary key could not be found
094            * @throws SystemException if a system exception occurred
095            */
096            public com.liferay.portal.model.Account fetchByPrimaryKey(long accountId)
097                    throws com.liferay.portal.kernel.exception.SystemException;
098    
099            /**
100            * Returns all the accounts.
101            *
102            * @return the accounts
103            * @throws SystemException if a system exception occurred
104            */
105            public java.util.List<com.liferay.portal.model.Account> findAll()
106                    throws com.liferay.portal.kernel.exception.SystemException;
107    
108            /**
109            * Returns a range of all the accounts.
110            *
111            * <p>
112            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.AccountModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
113            * </p>
114            *
115            * @param start the lower bound of the range of accounts
116            * @param end the upper bound of the range of accounts (not inclusive)
117            * @return the range of accounts
118            * @throws SystemException if a system exception occurred
119            */
120            public java.util.List<com.liferay.portal.model.Account> findAll(int start,
121                    int end) throws com.liferay.portal.kernel.exception.SystemException;
122    
123            /**
124            * Returns an ordered range of all the accounts.
125            *
126            * <p>
127            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.AccountModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
128            * </p>
129            *
130            * @param start the lower bound of the range of accounts
131            * @param end the upper bound of the range of accounts (not inclusive)
132            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133            * @return the ordered range of accounts
134            * @throws SystemException if a system exception occurred
135            */
136            public java.util.List<com.liferay.portal.model.Account> findAll(int start,
137                    int end,
138                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
139                    throws com.liferay.portal.kernel.exception.SystemException;
140    
141            /**
142            * Removes all the accounts from the database.
143            *
144            * @throws SystemException if a system exception occurred
145            */
146            public void removeAll()
147                    throws com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Returns the number of accounts.
151            *
152            * @return the number of accounts
153            * @throws SystemException if a system exception occurred
154            */
155            public int countAll()
156                    throws com.liferay.portal.kernel.exception.SystemException;
157    }