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