1
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
38 public class ShardUtil {
39
42 public static void clearCache() {
43 getPersistence().clearCache();
44 }
45
46
49 public static void clearCache(Shard shard) {
50 getPersistence().clearCache(shard);
51 }
52
53
56 public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57 throws SystemException {
58 return getPersistence().countWithDynamicQuery(dynamicQuery);
59 }
60
61
64 public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65 throws SystemException {
66 return getPersistence().findWithDynamicQuery(dynamicQuery);
67 }
68
69
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
80 public static Shard remove(Shard shard) throws SystemException {
81 return getPersistence().remove(shard);
82 }
83
84
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
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 }