1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19  import com.liferay.portal.kernel.exception.SystemException;
20  import com.liferay.portal.model.Shard;
21  
22  import java.util.List;
23  
24  /**
25   * <a href="ShardUtil.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * @author    Brian Wing Shun Chan
33   * @see       ShardPersistence
34   * @see       ShardPersistenceImpl
35   * @generated
36   */
37  public class ShardUtil {
38      /**
39       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
40       */
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      /**
46       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
47       */
48      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
49          throws SystemException {
50          return getPersistence().findWithDynamicQuery(dynamicQuery);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
55       */
56      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
57          int start, int end) throws SystemException {
58          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
63       */
64      public static Shard remove(Shard shard) throws SystemException {
65          return getPersistence().remove(shard);
66      }
67  
68      /**
69       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
70       */
71      public static Shard update(Shard shard, boolean merge)
72          throws SystemException {
73          return getPersistence().update(shard, merge);
74      }
75  
76      public static void cacheResult(com.liferay.portal.model.Shard shard) {
77          getPersistence().cacheResult(shard);
78      }
79  
80      public static void cacheResult(
81          java.util.List<com.liferay.portal.model.Shard> shards) {
82          getPersistence().cacheResult(shards);
83      }
84  
85      public static com.liferay.portal.model.Shard create(long shardId) {
86          return getPersistence().create(shardId);
87      }
88  
89      public static com.liferay.portal.model.Shard remove(long shardId)
90          throws com.liferay.portal.NoSuchShardException,
91              com.liferay.portal.kernel.exception.SystemException {
92          return getPersistence().remove(shardId);
93      }
94  
95      public static com.liferay.portal.model.Shard updateImpl(
96          com.liferay.portal.model.Shard shard, boolean merge)
97          throws com.liferay.portal.kernel.exception.SystemException {
98          return getPersistence().updateImpl(shard, merge);
99      }
100 
101     public static com.liferay.portal.model.Shard findByPrimaryKey(long shardId)
102         throws com.liferay.portal.NoSuchShardException,
103             com.liferay.portal.kernel.exception.SystemException {
104         return getPersistence().findByPrimaryKey(shardId);
105     }
106 
107     public static com.liferay.portal.model.Shard fetchByPrimaryKey(long shardId)
108         throws com.liferay.portal.kernel.exception.SystemException {
109         return getPersistence().fetchByPrimaryKey(shardId);
110     }
111 
112     public static com.liferay.portal.model.Shard findByName(
113         java.lang.String name)
114         throws com.liferay.portal.NoSuchShardException,
115             com.liferay.portal.kernel.exception.SystemException {
116         return getPersistence().findByName(name);
117     }
118 
119     public static com.liferay.portal.model.Shard fetchByName(
120         java.lang.String name)
121         throws com.liferay.portal.kernel.exception.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.kernel.exception.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.kernel.exception.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)
140         throws com.liferay.portal.kernel.exception.SystemException {
141         return getPersistence().fetchByC_C(classNameId, classPK);
142     }
143 
144     public static com.liferay.portal.model.Shard fetchByC_C(long classNameId,
145         long classPK, boolean retrieveFromCache)
146         throws com.liferay.portal.kernel.exception.SystemException {
147         return getPersistence()
148                    .fetchByC_C(classNameId, classPK, retrieveFromCache);
149     }
150 
151     public static java.util.List<com.liferay.portal.model.Shard> findAll()
152         throws com.liferay.portal.kernel.exception.SystemException {
153         return getPersistence().findAll();
154     }
155 
156     public static java.util.List<com.liferay.portal.model.Shard> findAll(
157         int start, int end)
158         throws com.liferay.portal.kernel.exception.SystemException {
159         return getPersistence().findAll(start, end);
160     }
161 
162     public static java.util.List<com.liferay.portal.model.Shard> findAll(
163         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.kernel.exception.SystemException {
165         return getPersistence().findAll(start, end, obc);
166     }
167 
168     public static void removeByName(java.lang.String name)
169         throws com.liferay.portal.NoSuchShardException,
170             com.liferay.portal.kernel.exception.SystemException {
171         getPersistence().removeByName(name);
172     }
173 
174     public static void removeByC_C(long classNameId, long classPK)
175         throws com.liferay.portal.NoSuchShardException,
176             com.liferay.portal.kernel.exception.SystemException {
177         getPersistence().removeByC_C(classNameId, classPK);
178     }
179 
180     public static void removeAll()
181         throws com.liferay.portal.kernel.exception.SystemException {
182         getPersistence().removeAll();
183     }
184 
185     public static int countByName(java.lang.String name)
186         throws com.liferay.portal.kernel.exception.SystemException {
187         return getPersistence().countByName(name);
188     }
189 
190     public static int countByC_C(long classNameId, long classPK)
191         throws com.liferay.portal.kernel.exception.SystemException {
192         return getPersistence().countByC_C(classNameId, classPK);
193     }
194 
195     public static int countAll()
196         throws com.liferay.portal.kernel.exception.SystemException {
197         return getPersistence().countAll();
198     }
199 
200     public static ShardPersistence getPersistence() {
201         if (_persistence == null) {
202             _persistence = (ShardPersistence)PortalBeanLocatorUtil.locate(ShardPersistence.class.getName());
203         }
204 
205         return _persistence;
206     }
207 
208     public void setPersistence(ShardPersistence persistence) {
209         _persistence = persistence;
210     }
211 
212     private static ShardPersistence _persistence;
213 }