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.portal.service.persistence;
016    
017    import com.liferay.portal.model.Shard;
018    
019    /**
020     * The persistence interface for the shard service.
021     *
022     * <p>
023     * Never modify or reference this interface directly. Always use {@link ShardUtil} to access the shard persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
024     * </p>
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 ShardPersistenceImpl
032     * @see ShardUtil
033     * @generated
034     */
035    public interface ShardPersistence extends BasePersistence<Shard> {
036            /**
037            * Caches the shard in the entity cache if it is enabled.
038            *
039            * @param shard the shard to cache
040            */
041            public void cacheResult(com.liferay.portal.model.Shard shard);
042    
043            /**
044            * Caches the shards in the entity cache if it is enabled.
045            *
046            * @param shards the shards to cache
047            */
048            public void cacheResult(
049                    java.util.List<com.liferay.portal.model.Shard> shards);
050    
051            /**
052            * Creates a new shard with the primary key. Does not add the shard to the database.
053            *
054            * @param shardId the primary key for the new shard
055            * @return the new shard
056            */
057            public com.liferay.portal.model.Shard create(long shardId);
058    
059            /**
060            * Removes the shard with the primary key from the database. Also notifies the appropriate model listeners.
061            *
062            * @param shardId the primary key of the shard to remove
063            * @return the shard that was removed
064            * @throws com.liferay.portal.NoSuchShardException if a shard with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public com.liferay.portal.model.Shard remove(long shardId)
068                    throws com.liferay.portal.NoSuchShardException,
069                            com.liferay.portal.kernel.exception.SystemException;
070    
071            public com.liferay.portal.model.Shard updateImpl(
072                    com.liferay.portal.model.Shard shard, boolean merge)
073                    throws com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Finds the shard with the primary key or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found.
077            *
078            * @param shardId the primary key of the shard to find
079            * @return the shard
080            * @throws com.liferay.portal.NoSuchShardException if a shard with the primary key could not be found
081            * @throws SystemException if a system exception occurred
082            */
083            public com.liferay.portal.model.Shard findByPrimaryKey(long shardId)
084                    throws com.liferay.portal.NoSuchShardException,
085                            com.liferay.portal.kernel.exception.SystemException;
086    
087            /**
088            * Finds the shard with the primary key or returns <code>null</code> if it could not be found.
089            *
090            * @param shardId the primary key of the shard to find
091            * @return the shard, or <code>null</code> if a shard with the primary key could not be found
092            * @throws SystemException if a system exception occurred
093            */
094            public com.liferay.portal.model.Shard fetchByPrimaryKey(long shardId)
095                    throws com.liferay.portal.kernel.exception.SystemException;
096    
097            /**
098            * Finds the shard where name = &#63; or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found.
099            *
100            * @param name the name to search with
101            * @return the matching shard
102            * @throws com.liferay.portal.NoSuchShardException if a matching shard could not be found
103            * @throws SystemException if a system exception occurred
104            */
105            public com.liferay.portal.model.Shard findByName(java.lang.String name)
106                    throws com.liferay.portal.NoSuchShardException,
107                            com.liferay.portal.kernel.exception.SystemException;
108    
109            /**
110            * Finds the shard where name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
111            *
112            * @param name the name to search with
113            * @return the matching shard, or <code>null</code> if a matching shard could not be found
114            * @throws SystemException if a system exception occurred
115            */
116            public com.liferay.portal.model.Shard fetchByName(java.lang.String name)
117                    throws com.liferay.portal.kernel.exception.SystemException;
118    
119            /**
120            * Finds the shard where name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
121            *
122            * @param name the name to search with
123            * @return the matching shard, or <code>null</code> if a matching shard could not be found
124            * @throws SystemException if a system exception occurred
125            */
126            public com.liferay.portal.model.Shard fetchByName(java.lang.String name,
127                    boolean retrieveFromCache)
128                    throws com.liferay.portal.kernel.exception.SystemException;
129    
130            /**
131            * Finds the shard where classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portal.NoSuchShardException} if it could not be found.
132            *
133            * @param classNameId the class name id to search with
134            * @param classPK the class p k to search with
135            * @return the matching shard
136            * @throws com.liferay.portal.NoSuchShardException if a matching shard could not be found
137            * @throws SystemException if a system exception occurred
138            */
139            public com.liferay.portal.model.Shard findByC_C(long classNameId,
140                    long classPK)
141                    throws com.liferay.portal.NoSuchShardException,
142                            com.liferay.portal.kernel.exception.SystemException;
143    
144            /**
145            * Finds the shard where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
146            *
147            * @param classNameId the class name id to search with
148            * @param classPK the class p k to search with
149            * @return the matching shard, or <code>null</code> if a matching shard could not be found
150            * @throws SystemException if a system exception occurred
151            */
152            public com.liferay.portal.model.Shard fetchByC_C(long classNameId,
153                    long classPK)
154                    throws com.liferay.portal.kernel.exception.SystemException;
155    
156            /**
157            * Finds the shard where classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
158            *
159            * @param classNameId the class name id to search with
160            * @param classPK the class p k to search with
161            * @return the matching shard, or <code>null</code> if a matching shard could not be found
162            * @throws SystemException if a system exception occurred
163            */
164            public com.liferay.portal.model.Shard fetchByC_C(long classNameId,
165                    long classPK, boolean retrieveFromCache)
166                    throws com.liferay.portal.kernel.exception.SystemException;
167    
168            /**
169            * Finds all the shards.
170            *
171            * @return the shards
172            * @throws SystemException if a system exception occurred
173            */
174            public java.util.List<com.liferay.portal.model.Shard> findAll()
175                    throws com.liferay.portal.kernel.exception.SystemException;
176    
177            /**
178            * Finds a range of all the shards.
179            *
180            * <p>
181            * 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.
182            * </p>
183            *
184            * @param start the lower bound of the range of shards to return
185            * @param end the upper bound of the range of shards to return (not inclusive)
186            * @return the range of shards
187            * @throws SystemException if a system exception occurred
188            */
189            public java.util.List<com.liferay.portal.model.Shard> findAll(int start,
190                    int end) throws com.liferay.portal.kernel.exception.SystemException;
191    
192            /**
193            * Finds an ordered range of all the shards.
194            *
195            * <p>
196            * 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.
197            * </p>
198            *
199            * @param start the lower bound of the range of shards to return
200            * @param end the upper bound of the range of shards to return (not inclusive)
201            * @param orderByComparator the comparator to order the results by
202            * @return the ordered range of shards
203            * @throws SystemException if a system exception occurred
204            */
205            public java.util.List<com.liferay.portal.model.Shard> findAll(int start,
206                    int end,
207                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
208                    throws com.liferay.portal.kernel.exception.SystemException;
209    
210            /**
211            * Removes the shard where name = &#63; from the database.
212            *
213            * @param name the name to search with
214            * @throws SystemException if a system exception occurred
215            */
216            public void removeByName(java.lang.String name)
217                    throws com.liferay.portal.NoSuchShardException,
218                            com.liferay.portal.kernel.exception.SystemException;
219    
220            /**
221            * Removes the shard where classNameId = &#63; and classPK = &#63; from the database.
222            *
223            * @param classNameId the class name id to search with
224            * @param classPK the class p k to search with
225            * @throws SystemException if a system exception occurred
226            */
227            public void removeByC_C(long classNameId, long classPK)
228                    throws com.liferay.portal.NoSuchShardException,
229                            com.liferay.portal.kernel.exception.SystemException;
230    
231            /**
232            * Removes all the shards from the database.
233            *
234            * @throws SystemException if a system exception occurred
235            */
236            public void removeAll()
237                    throws com.liferay.portal.kernel.exception.SystemException;
238    
239            /**
240            * Counts all the shards where name = &#63;.
241            *
242            * @param name the name to search with
243            * @return the number of matching shards
244            * @throws SystemException if a system exception occurred
245            */
246            public int countByName(java.lang.String name)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Counts all the shards where classNameId = &#63; and classPK = &#63;.
251            *
252            * @param classNameId the class name id to search with
253            * @param classPK the class p k to search with
254            * @return the number of matching shards
255            * @throws SystemException if a system exception occurred
256            */
257            public int countByC_C(long classNameId, long classPK)
258                    throws com.liferay.portal.kernel.exception.SystemException;
259    
260            /**
261            * Counts all the shards.
262            *
263            * @return the number of shards
264            * @throws SystemException if a system exception occurred
265            */
266            public int countAll()
267                    throws com.liferay.portal.kernel.exception.SystemException;
268    }