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