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