1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  import com.liferay.portal.SystemException;
26  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
27  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
28  import com.liferay.portal.model.Shard;
29  
30  import java.util.List;
31  
32  /**
33   * <a href="ShardUtil.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * @author    Brian Wing Shun Chan
41   * @see       ShardPersistence
42   * @see       ShardPersistenceImpl
43   * @generated
44   */
45  public class ShardUtil {
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
48       */
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
55       */
56      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().findWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
65          int start, int end) throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
71       */
72      public static Shard remove(Shard shard) throws SystemException {
73          return getPersistence().remove(shard);
74      }
75  
76      /**
77       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
78       */
79      public static Shard update(Shard shard, boolean merge)
80          throws SystemException {
81          return getPersistence().update(shard, merge);
82      }
83  
84      public static void cacheResult(com.liferay.portal.model.Shard shard) {
85          getPersistence().cacheResult(shard);
86      }
87  
88      public static void cacheResult(
89          java.util.List<com.liferay.portal.model.Shard> shards) {
90          getPersistence().cacheResult(shards);
91      }
92  
93      public static com.liferay.portal.model.Shard create(long shardId) {
94          return getPersistence().create(shardId);
95      }
96  
97      public static com.liferay.portal.model.Shard remove(long shardId)
98          throws com.liferay.portal.NoSuchShardException,
99              com.liferay.portal.SystemException {
100         return getPersistence().remove(shardId);
101     }
102 
103     /**
104      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
105      */
106     public static com.liferay.portal.model.Shard update(
107         com.liferay.portal.model.Shard shard)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().update(shard);
110     }
111 
112     public static com.liferay.portal.model.Shard updateImpl(
113         com.liferay.portal.model.Shard shard, boolean merge)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().updateImpl(shard, merge);
116     }
117 
118     public static com.liferay.portal.model.Shard findByPrimaryKey(long shardId)
119         throws com.liferay.portal.NoSuchShardException,
120             com.liferay.portal.SystemException {
121         return getPersistence().findByPrimaryKey(shardId);
122     }
123 
124     public static com.liferay.portal.model.Shard fetchByPrimaryKey(long shardId)
125         throws com.liferay.portal.SystemException {
126         return getPersistence().fetchByPrimaryKey(shardId);
127     }
128 
129     public static com.liferay.portal.model.Shard findByName(
130         java.lang.String name)
131         throws com.liferay.portal.NoSuchShardException,
132             com.liferay.portal.SystemException {
133         return getPersistence().findByName(name);
134     }
135 
136     public static com.liferay.portal.model.Shard fetchByName(
137         java.lang.String name) throws com.liferay.portal.SystemException {
138         return getPersistence().fetchByName(name);
139     }
140 
141     public static com.liferay.portal.model.Shard fetchByName(
142         java.lang.String name, boolean retrieveFromCache)
143         throws com.liferay.portal.SystemException {
144         return getPersistence().fetchByName(name, retrieveFromCache);
145     }
146 
147     public static com.liferay.portal.model.Shard findByC_C(long classNameId,
148         long classPK)
149         throws com.liferay.portal.NoSuchShardException,
150             com.liferay.portal.SystemException {
151         return getPersistence().findByC_C(classNameId, classPK);
152     }
153 
154     public static com.liferay.portal.model.Shard fetchByC_C(long classNameId,
155         long classPK) throws com.liferay.portal.SystemException {
156         return getPersistence().fetchByC_C(classNameId, classPK);
157     }
158 
159     public static com.liferay.portal.model.Shard fetchByC_C(long classNameId,
160         long classPK, boolean retrieveFromCache)
161         throws com.liferay.portal.SystemException {
162         return getPersistence()
163                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
164     }
165 
166     public static java.util.List<com.liferay.portal.model.Shard> findAll()
167         throws com.liferay.portal.SystemException {
168         return getPersistence().findAll();
169     }
170 
171     public static java.util.List<com.liferay.portal.model.Shard> findAll(
172         int start, int end) throws com.liferay.portal.SystemException {
173         return getPersistence().findAll(start, end);
174     }
175 
176     public static java.util.List<com.liferay.portal.model.Shard> findAll(
177         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
178         throws com.liferay.portal.SystemException {
179         return getPersistence().findAll(start, end, obc);
180     }
181 
182     public static void removeByName(java.lang.String name)
183         throws com.liferay.portal.NoSuchShardException,
184             com.liferay.portal.SystemException {
185         getPersistence().removeByName(name);
186     }
187 
188     public static void removeByC_C(long classNameId, long classPK)
189         throws com.liferay.portal.NoSuchShardException,
190             com.liferay.portal.SystemException {
191         getPersistence().removeByC_C(classNameId, classPK);
192     }
193 
194     public static void removeAll() throws com.liferay.portal.SystemException {
195         getPersistence().removeAll();
196     }
197 
198     public static int countByName(java.lang.String name)
199         throws com.liferay.portal.SystemException {
200         return getPersistence().countByName(name);
201     }
202 
203     public static int countByC_C(long classNameId, long classPK)
204         throws com.liferay.portal.SystemException {
205         return getPersistence().countByC_C(classNameId, classPK);
206     }
207 
208     public static int countAll() throws com.liferay.portal.SystemException {
209         return getPersistence().countAll();
210     }
211 
212     public static ShardPersistence getPersistence() {
213         if (_persistence == null) {
214             _persistence = (ShardPersistence)PortalBeanLocatorUtil.locate(ShardPersistence.class.getName());
215         }
216 
217         return _persistence;
218     }
219 
220     public void setPersistence(ShardPersistence persistence) {
221         _persistence = persistence;
222     }
223 
224     private static ShardPersistence _persistence;
225 }