001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.exception.SystemException;
018    import com.liferay.portal.model.Repository;
019    
020    /**
021     * The persistence interface for the repository service.
022     *
023     * <p>
024     * Caching information and settings can be found in <code>portal.properties</code>
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see RepositoryPersistenceImpl
029     * @see RepositoryUtil
030     * @generated
031     */
032    public interface RepositoryPersistence extends BasePersistence<Repository> {
033            /*
034             * NOTE FOR DEVELOPERS:
035             *
036             * Never modify or reference this interface directly. Always use {@link RepositoryUtil} to access the repository persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
037             */
038    
039            /**
040            * Caches the repository in the entity cache if it is enabled.
041            *
042            * @param repository the repository
043            */
044            public void cacheResult(com.liferay.portal.model.Repository repository);
045    
046            /**
047            * Caches the repositories in the entity cache if it is enabled.
048            *
049            * @param repositories the repositories
050            */
051            public void cacheResult(
052                    java.util.List<com.liferay.portal.model.Repository> repositories);
053    
054            /**
055            * Creates a new repository with the primary key. Does not add the repository to the database.
056            *
057            * @param repositoryId the primary key for the new repository
058            * @return the new repository
059            */
060            public com.liferay.portal.model.Repository create(long repositoryId);
061    
062            /**
063            * Removes the repository with the primary key from the database. Also notifies the appropriate model listeners.
064            *
065            * @param repositoryId the primary key of the repository
066            * @return the repository that was removed
067            * @throws com.liferay.portal.NoSuchRepositoryException if a repository with the primary key could not be found
068            * @throws SystemException if a system exception occurred
069            */
070            public com.liferay.portal.model.Repository remove(long repositoryId)
071                    throws com.liferay.portal.NoSuchRepositoryException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            public com.liferay.portal.model.Repository updateImpl(
075                    com.liferay.portal.model.Repository repository, boolean merge)
076                    throws com.liferay.portal.kernel.exception.SystemException;
077    
078            /**
079            * Returns the repository with the primary key or throws a {@link com.liferay.portal.NoSuchRepositoryException} if it could not be found.
080            *
081            * @param repositoryId the primary key of the repository
082            * @return the repository
083            * @throws com.liferay.portal.NoSuchRepositoryException if a repository with the primary key could not be found
084            * @throws SystemException if a system exception occurred
085            */
086            public com.liferay.portal.model.Repository findByPrimaryKey(
087                    long repositoryId)
088                    throws com.liferay.portal.NoSuchRepositoryException,
089                            com.liferay.portal.kernel.exception.SystemException;
090    
091            /**
092            * Returns the repository with the primary key or returns <code>null</code> if it could not be found.
093            *
094            * @param repositoryId the primary key of the repository
095            * @return the repository, or <code>null</code> if a repository with the primary key could not be found
096            * @throws SystemException if a system exception occurred
097            */
098            public com.liferay.portal.model.Repository fetchByPrimaryKey(
099                    long repositoryId)
100                    throws com.liferay.portal.kernel.exception.SystemException;
101    
102            /**
103            * Returns all the repositories where groupId = &#63;.
104            *
105            * @param groupId the group ID
106            * @return the matching repositories
107            * @throws SystemException if a system exception occurred
108            */
109            public java.util.List<com.liferay.portal.model.Repository> findByGroupId(
110                    long groupId)
111                    throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Returns a range of all the repositories where groupId = &#63;.
115            *
116            * <p>
117            * 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.
118            * </p>
119            *
120            * @param groupId the group ID
121            * @param start the lower bound of the range of repositories
122            * @param end the upper bound of the range of repositories (not inclusive)
123            * @return the range of matching repositories
124            * @throws SystemException if a system exception occurred
125            */
126            public java.util.List<com.liferay.portal.model.Repository> findByGroupId(
127                    long groupId, int start, int end)
128                    throws com.liferay.portal.kernel.exception.SystemException;
129    
130            /**
131            * Returns an ordered range of all the repositories where groupId = &#63;.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param groupId the group ID
138            * @param start the lower bound of the range of repositories
139            * @param end the upper bound of the range of repositories (not inclusive)
140            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141            * @return the ordered range of matching repositories
142            * @throws SystemException if a system exception occurred
143            */
144            public java.util.List<com.liferay.portal.model.Repository> findByGroupId(
145                    long groupId, int start, int end,
146                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
147                    throws com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Returns the first repository in the ordered set where groupId = &#63;.
151            *
152            * <p>
153            * 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.
154            * </p>
155            *
156            * @param groupId the group ID
157            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
158            * @return the first matching repository
159            * @throws com.liferay.portal.NoSuchRepositoryException if a matching repository could not be found
160            * @throws SystemException if a system exception occurred
161            */
162            public com.liferay.portal.model.Repository findByGroupId_First(
163                    long groupId,
164                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165                    throws com.liferay.portal.NoSuchRepositoryException,
166                            com.liferay.portal.kernel.exception.SystemException;
167    
168            /**
169            * Returns the last repository in the ordered set where groupId = &#63;.
170            *
171            * <p>
172            * 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.
173            * </p>
174            *
175            * @param groupId the group ID
176            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
177            * @return the last matching repository
178            * @throws com.liferay.portal.NoSuchRepositoryException if a matching repository could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public com.liferay.portal.model.Repository findByGroupId_Last(
182                    long groupId,
183                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
184                    throws com.liferay.portal.NoSuchRepositoryException,
185                            com.liferay.portal.kernel.exception.SystemException;
186    
187            /**
188            * Returns the repositories before and after the current repository in the ordered set where groupId = &#63;.
189            *
190            * <p>
191            * 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.
192            * </p>
193            *
194            * @param repositoryId the primary key of the current repository
195            * @param groupId the group ID
196            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
197            * @return the previous, current, and next repository
198            * @throws com.liferay.portal.NoSuchRepositoryException if a repository with the primary key could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public com.liferay.portal.model.Repository[] findByGroupId_PrevAndNext(
202                    long repositoryId, long groupId,
203                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204                    throws com.liferay.portal.NoSuchRepositoryException,
205                            com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Returns all the repositories.
209            *
210            * @return the repositories
211            * @throws SystemException if a system exception occurred
212            */
213            public java.util.List<com.liferay.portal.model.Repository> findAll()
214                    throws com.liferay.portal.kernel.exception.SystemException;
215    
216            /**
217            * Returns a range of all the repositories.
218            *
219            * <p>
220            * 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.
221            * </p>
222            *
223            * @param start the lower bound of the range of repositories
224            * @param end the upper bound of the range of repositories (not inclusive)
225            * @return the range of repositories
226            * @throws SystemException if a system exception occurred
227            */
228            public java.util.List<com.liferay.portal.model.Repository> findAll(
229                    int start, int end)
230                    throws com.liferay.portal.kernel.exception.SystemException;
231    
232            /**
233            * Returns an ordered range of all the repositories.
234            *
235            * <p>
236            * 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.
237            * </p>
238            *
239            * @param start the lower bound of the range of repositories
240            * @param end the upper bound of the range of repositories (not inclusive)
241            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
242            * @return the ordered range of repositories
243            * @throws SystemException if a system exception occurred
244            */
245            public java.util.List<com.liferay.portal.model.Repository> findAll(
246                    int start, int end,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.kernel.exception.SystemException;
249    
250            /**
251            * Removes all the repositories where groupId = &#63; from the database.
252            *
253            * @param groupId the group ID
254            * @throws SystemException if a system exception occurred
255            */
256            public void removeByGroupId(long groupId)
257                    throws com.liferay.portal.kernel.exception.SystemException;
258    
259            /**
260            * Removes all the repositories from the database.
261            *
262            * @throws SystemException if a system exception occurred
263            */
264            public void removeAll()
265                    throws com.liferay.portal.kernel.exception.SystemException;
266    
267            /**
268            * Returns the number of repositories where groupId = &#63;.
269            *
270            * @param groupId the group ID
271            * @return the number of matching repositories
272            * @throws SystemException if a system exception occurred
273            */
274            public int countByGroupId(long groupId)
275                    throws com.liferay.portal.kernel.exception.SystemException;
276    
277            /**
278            * Returns the number of repositories.
279            *
280            * @return the number of repositories
281            * @throws SystemException if a system exception occurred
282            */
283            public int countAll()
284                    throws com.liferay.portal.kernel.exception.SystemException;
285    
286            public Repository remove(Repository repository) throws SystemException;
287    }