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  
26  /**
27   * <a href="ShardUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       ShardPersistence
36   * @see       ShardPersistenceImpl
37   * @generated
38   */
39  public class ShardUtil {
40      public static void cacheResult(com.liferay.portal.model.Shard shard) {
41          getPersistence().cacheResult(shard);
42      }
43  
44      public static void cacheResult(
45          java.util.List<com.liferay.portal.model.Shard> shards) {
46          getPersistence().cacheResult(shards);
47      }
48  
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      public static com.liferay.portal.model.Shard create(long shardId) {
54          return getPersistence().create(shardId);
55      }
56  
57      public static com.liferay.portal.model.Shard remove(long shardId)
58          throws com.liferay.portal.NoSuchShardException,
59              com.liferay.portal.SystemException {
60          return getPersistence().remove(shardId);
61      }
62  
63      public static com.liferay.portal.model.Shard remove(
64          com.liferay.portal.model.Shard shard)
65          throws com.liferay.portal.SystemException {
66          return getPersistence().remove(shard);
67      }
68  
69      /**
70       * @deprecated Use {@link #update(Shard, boolean merge)}.
71       */
72      public static com.liferay.portal.model.Shard update(
73          com.liferay.portal.model.Shard shard)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(shard);
76      }
77  
78      /**
79       * Add, update, or merge, the entity. This method also calls the model
80       * listeners to trigger the proper events associated with adding, deleting,
81       * or updating an entity.
82       *
83       * @param  shard the entity to add, update, or merge
84       * @param  merge boolean value for whether to merge the entity. The default
85       *         value is false. Setting merge to true is more expensive and
86       *         should only be true when shard is transient. See
87       *         LEP-5473 for a detailed discussion of this method.
88       * @return the entity that was added, updated, or merged
89       */
90      public static com.liferay.portal.model.Shard update(
91          com.liferay.portal.model.Shard shard, boolean merge)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().update(shard, merge);
94      }
95  
96      public static com.liferay.portal.model.Shard updateImpl(
97          com.liferay.portal.model.Shard shard, boolean merge)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().updateImpl(shard, merge);
100     }
101 
102     public static com.liferay.portal.model.Shard findByPrimaryKey(long shardId)
103         throws com.liferay.portal.NoSuchShardException,
104             com.liferay.portal.SystemException {
105         return getPersistence().findByPrimaryKey(shardId);
106     }
107 
108     public static com.liferay.portal.model.Shard fetchByPrimaryKey(long shardId)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().fetchByPrimaryKey(shardId);
111     }
112 
113     public static com.liferay.portal.model.Shard findByName(
114         java.lang.String name)
115         throws com.liferay.portal.NoSuchShardException,
116             com.liferay.portal.SystemException {
117         return getPersistence().findByName(name);
118     }
119 
120     public static com.liferay.portal.model.Shard fetchByName(
121         java.lang.String name) throws com.liferay.portal.SystemException {
122         return getPersistence().fetchByName(name);
123     }
124 
125     public static com.liferay.portal.model.Shard fetchByName(
126         java.lang.String name, boolean retrieveFromCache)
127         throws com.liferay.portal.SystemException {
128         return getPersistence().fetchByName(name, retrieveFromCache);
129     }
130 
131     public static com.liferay.portal.model.Shard findByC_C(long classNameId,
132         long classPK)
133         throws com.liferay.portal.NoSuchShardException,
134             com.liferay.portal.SystemException {
135         return getPersistence().findByC_C(classNameId, classPK);
136     }
137 
138     public static com.liferay.portal.model.Shard fetchByC_C(long classNameId,
139         long classPK) throws com.liferay.portal.SystemException {
140         return getPersistence().fetchByC_C(classNameId, classPK);
141     }
142 
143     public static com.liferay.portal.model.Shard fetchByC_C(long classNameId,
144         long classPK, boolean retrieveFromCache)
145         throws com.liferay.portal.SystemException {
146         return getPersistence()
147                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
148     }
149 
150     public static java.util.List<Object> findWithDynamicQuery(
151         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findWithDynamicQuery(dynamicQuery);
154     }
155 
156     public static java.util.List<Object> findWithDynamicQuery(
157         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
158         int end) throws com.liferay.portal.SystemException {
159         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
160     }
161 
162     public static java.util.List<com.liferay.portal.model.Shard> findAll()
163         throws com.liferay.portal.SystemException {
164         return getPersistence().findAll();
165     }
166 
167     public static java.util.List<com.liferay.portal.model.Shard> findAll(
168         int start, int end) throws com.liferay.portal.SystemException {
169         return getPersistence().findAll(start, end);
170     }
171 
172     public static java.util.List<com.liferay.portal.model.Shard> findAll(
173         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findAll(start, end, obc);
176     }
177 
178     public static void removeByName(java.lang.String name)
179         throws com.liferay.portal.NoSuchShardException,
180             com.liferay.portal.SystemException {
181         getPersistence().removeByName(name);
182     }
183 
184     public static void removeByC_C(long classNameId, long classPK)
185         throws com.liferay.portal.NoSuchShardException,
186             com.liferay.portal.SystemException {
187         getPersistence().removeByC_C(classNameId, classPK);
188     }
189 
190     public static void removeAll() throws com.liferay.portal.SystemException {
191         getPersistence().removeAll();
192     }
193 
194     public static int countByName(java.lang.String name)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().countByName(name);
197     }
198 
199     public static int countByC_C(long classNameId, long classPK)
200         throws com.liferay.portal.SystemException {
201         return getPersistence().countByC_C(classNameId, classPK);
202     }
203 
204     public static int countAll() throws com.liferay.portal.SystemException {
205         return getPersistence().countAll();
206     }
207 
208     public static ShardPersistence getPersistence() {
209         return _persistence;
210     }
211 
212     public void setPersistence(ShardPersistence persistence) {
213         _persistence = persistence;
214     }
215 
216     private static ShardPersistence _persistence;
217 }