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