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