001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019 import com.liferay.portal.kernel.exception.SystemException;
020 import com.liferay.portal.kernel.util.OrderByComparator;
021 import com.liferay.portal.model.Shard;
022 import com.liferay.portal.service.ServiceContext;
023
024 import java.util.List;
025
026
032 public class ShardUtil {
033
036 public static void clearCache() {
037 getPersistence().clearCache();
038 }
039
040
043 public static void clearCache(Shard shard) {
044 getPersistence().clearCache(shard);
045 }
046
047
050 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
051 throws SystemException {
052 return getPersistence().countWithDynamicQuery(dynamicQuery);
053 }
054
055
058 public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery)
059 throws SystemException {
060 return getPersistence().findWithDynamicQuery(dynamicQuery);
061 }
062
063
066 public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
067 int start, int end) throws SystemException {
068 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
069 }
070
071
074 public static List<Shard> findWithDynamicQuery(DynamicQuery dynamicQuery,
075 int start, int end, OrderByComparator orderByComparator)
076 throws SystemException {
077 return getPersistence()
078 .findWithDynamicQuery(dynamicQuery, start, end,
079 orderByComparator);
080 }
081
082
085 public static Shard remove(Shard shard) throws SystemException {
086 return getPersistence().remove(shard);
087 }
088
089
092 public static Shard update(Shard shard, boolean merge)
093 throws SystemException {
094 return getPersistence().update(shard, merge);
095 }
096
097
100 public static Shard update(Shard shard, boolean merge,
101 ServiceContext serviceContext) throws SystemException {
102 return getPersistence().update(shard, merge, serviceContext);
103 }
104
105 public static void cacheResult(com.liferay.portal.model.Shard shard) {
106 getPersistence().cacheResult(shard);
107 }
108
109 public static void cacheResult(
110 java.util.List<com.liferay.portal.model.Shard> shards) {
111 getPersistence().cacheResult(shards);
112 }
113
114 public static com.liferay.portal.model.Shard create(long shardId) {
115 return getPersistence().create(shardId);
116 }
117
118 public static com.liferay.portal.model.Shard remove(long shardId)
119 throws com.liferay.portal.NoSuchShardException,
120 com.liferay.portal.kernel.exception.SystemException {
121 return getPersistence().remove(shardId);
122 }
123
124 public static com.liferay.portal.model.Shard updateImpl(
125 com.liferay.portal.model.Shard shard, boolean merge)
126 throws com.liferay.portal.kernel.exception.SystemException {
127 return getPersistence().updateImpl(shard, merge);
128 }
129
130 public static com.liferay.portal.model.Shard findByPrimaryKey(long shardId)
131 throws com.liferay.portal.NoSuchShardException,
132 com.liferay.portal.kernel.exception.SystemException {
133 return getPersistence().findByPrimaryKey(shardId);
134 }
135
136 public static com.liferay.portal.model.Shard fetchByPrimaryKey(long shardId)
137 throws com.liferay.portal.kernel.exception.SystemException {
138 return getPersistence().fetchByPrimaryKey(shardId);
139 }
140
141 public static com.liferay.portal.model.Shard findByName(
142 java.lang.String name)
143 throws com.liferay.portal.NoSuchShardException,
144 com.liferay.portal.kernel.exception.SystemException {
145 return getPersistence().findByName(name);
146 }
147
148 public static com.liferay.portal.model.Shard fetchByName(
149 java.lang.String name)
150 throws com.liferay.portal.kernel.exception.SystemException {
151 return getPersistence().fetchByName(name);
152 }
153
154 public static com.liferay.portal.model.Shard fetchByName(
155 java.lang.String name, boolean retrieveFromCache)
156 throws com.liferay.portal.kernel.exception.SystemException {
157 return getPersistence().fetchByName(name, retrieveFromCache);
158 }
159
160 public static com.liferay.portal.model.Shard findByC_C(long classNameId,
161 long classPK)
162 throws com.liferay.portal.NoSuchShardException,
163 com.liferay.portal.kernel.exception.SystemException {
164 return getPersistence().findByC_C(classNameId, classPK);
165 }
166
167 public static com.liferay.portal.model.Shard fetchByC_C(long classNameId,
168 long classPK)
169 throws com.liferay.portal.kernel.exception.SystemException {
170 return getPersistence().fetchByC_C(classNameId, classPK);
171 }
172
173 public static com.liferay.portal.model.Shard fetchByC_C(long classNameId,
174 long classPK, boolean retrieveFromCache)
175 throws com.liferay.portal.kernel.exception.SystemException {
176 return getPersistence()
177 .fetchByC_C(classNameId, classPK, retrieveFromCache);
178 }
179
180 public static java.util.List<com.liferay.portal.model.Shard> findAll()
181 throws com.liferay.portal.kernel.exception.SystemException {
182 return getPersistence().findAll();
183 }
184
185 public static java.util.List<com.liferay.portal.model.Shard> findAll(
186 int start, int end)
187 throws com.liferay.portal.kernel.exception.SystemException {
188 return getPersistence().findAll(start, end);
189 }
190
191 public static java.util.List<com.liferay.portal.model.Shard> findAll(
192 int start, int end,
193 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
194 throws com.liferay.portal.kernel.exception.SystemException {
195 return getPersistence().findAll(start, end, orderByComparator);
196 }
197
198 public static void removeByName(java.lang.String name)
199 throws com.liferay.portal.NoSuchShardException,
200 com.liferay.portal.kernel.exception.SystemException {
201 getPersistence().removeByName(name);
202 }
203
204 public static void removeByC_C(long classNameId, long classPK)
205 throws com.liferay.portal.NoSuchShardException,
206 com.liferay.portal.kernel.exception.SystemException {
207 getPersistence().removeByC_C(classNameId, classPK);
208 }
209
210 public static void removeAll()
211 throws com.liferay.portal.kernel.exception.SystemException {
212 getPersistence().removeAll();
213 }
214
215 public static int countByName(java.lang.String name)
216 throws com.liferay.portal.kernel.exception.SystemException {
217 return getPersistence().countByName(name);
218 }
219
220 public static int countByC_C(long classNameId, long classPK)
221 throws com.liferay.portal.kernel.exception.SystemException {
222 return getPersistence().countByC_C(classNameId, classPK);
223 }
224
225 public static int countAll()
226 throws com.liferay.portal.kernel.exception.SystemException {
227 return getPersistence().countAll();
228 }
229
230 public static ShardPersistence getPersistence() {
231 if (_persistence == null) {
232 _persistence = (ShardPersistence)PortalBeanLocatorUtil.locate(ShardPersistence.class.getName());
233 }
234
235 return _persistence;
236 }
237
238 public void setPersistence(ShardPersistence persistence) {
239 _persistence = persistence;
240 }
241
242 private static ShardPersistence _persistence;
243 }