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