1
14
15 package com.liferay.portlet.blogs.service.persistence;
16
17 import com.liferay.portal.NoSuchModelException;
18 import com.liferay.portal.kernel.annotation.BeanReference;
19 import com.liferay.portal.kernel.cache.CacheRegistry;
20 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
21 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
22 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
23 import com.liferay.portal.kernel.dao.orm.FinderPath;
24 import com.liferay.portal.kernel.dao.orm.Query;
25 import com.liferay.portal.kernel.dao.orm.QueryPos;
26 import com.liferay.portal.kernel.dao.orm.QueryUtil;
27 import com.liferay.portal.kernel.dao.orm.Session;
28 import com.liferay.portal.kernel.exception.SystemException;
29 import com.liferay.portal.kernel.log.Log;
30 import com.liferay.portal.kernel.log.LogFactoryUtil;
31 import com.liferay.portal.kernel.util.CalendarUtil;
32 import com.liferay.portal.kernel.util.GetterUtil;
33 import com.liferay.portal.kernel.util.OrderByComparator;
34 import com.liferay.portal.kernel.util.StringBundler;
35 import com.liferay.portal.kernel.util.StringPool;
36 import com.liferay.portal.kernel.util.StringUtil;
37 import com.liferay.portal.kernel.util.Validator;
38 import com.liferay.portal.kernel.uuid.PortalUUIDUtil;
39 import com.liferay.portal.model.ModelListener;
40 import com.liferay.portal.service.persistence.BatchSessionUtil;
41 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
42
43 import com.liferay.portlet.blogs.NoSuchEntryException;
44 import com.liferay.portlet.blogs.model.BlogsEntry;
45 import com.liferay.portlet.blogs.model.impl.BlogsEntryImpl;
46 import com.liferay.portlet.blogs.model.impl.BlogsEntryModelImpl;
47
48 import java.io.Serializable;
49
50 import java.util.ArrayList;
51 import java.util.Collections;
52 import java.util.Date;
53 import java.util.List;
54
55
68 public class BlogsEntryPersistenceImpl extends BasePersistenceImpl<BlogsEntry>
69 implements BlogsEntryPersistence {
70 public static final String FINDER_CLASS_NAME_ENTITY = BlogsEntryImpl.class.getName();
71 public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
72 ".List";
73 public static final FinderPath FINDER_PATH_FIND_BY_UUID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
74 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
75 "findByUuid", new String[] { String.class.getName() });
76 public static final FinderPath FINDER_PATH_FIND_BY_OBC_UUID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
77 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
78 "findByUuid",
79 new String[] {
80 String.class.getName(),
81
82 "java.lang.Integer", "java.lang.Integer",
83 "com.liferay.portal.kernel.util.OrderByComparator"
84 });
85 public static final FinderPath FINDER_PATH_COUNT_BY_UUID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
86 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
87 "countByUuid", new String[] { String.class.getName() });
88 public static final FinderPath FINDER_PATH_FETCH_BY_UUID_G = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
89 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
90 "fetchByUUID_G",
91 new String[] { String.class.getName(), Long.class.getName() });
92 public static final FinderPath FINDER_PATH_COUNT_BY_UUID_G = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
93 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
94 "countByUUID_G",
95 new String[] { String.class.getName(), Long.class.getName() });
96 public static final FinderPath FINDER_PATH_FIND_BY_GROUPID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
97 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
98 "findByGroupId", new String[] { Long.class.getName() });
99 public static final FinderPath FINDER_PATH_FIND_BY_OBC_GROUPID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
100 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
101 "findByGroupId",
102 new String[] {
103 Long.class.getName(),
104
105 "java.lang.Integer", "java.lang.Integer",
106 "com.liferay.portal.kernel.util.OrderByComparator"
107 });
108 public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
109 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
110 "countByGroupId", new String[] { Long.class.getName() });
111 public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
112 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
113 "findByCompanyId", new String[] { Long.class.getName() });
114 public static final FinderPath FINDER_PATH_FIND_BY_OBC_COMPANYID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
115 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
116 "findByCompanyId",
117 new String[] {
118 Long.class.getName(),
119
120 "java.lang.Integer", "java.lang.Integer",
121 "com.liferay.portal.kernel.util.OrderByComparator"
122 });
123 public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
124 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
125 "countByCompanyId", new String[] { Long.class.getName() });
126 public static final FinderPath FINDER_PATH_FIND_BY_C_U = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
127 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
128 "findByC_U",
129 new String[] { Long.class.getName(), Long.class.getName() });
130 public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_U = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
131 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
132 "findByC_U",
133 new String[] {
134 Long.class.getName(), Long.class.getName(),
135
136 "java.lang.Integer", "java.lang.Integer",
137 "com.liferay.portal.kernel.util.OrderByComparator"
138 });
139 public static final FinderPath FINDER_PATH_COUNT_BY_C_U = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
140 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
141 "countByC_U",
142 new String[] { Long.class.getName(), Long.class.getName() });
143 public static final FinderPath FINDER_PATH_FIND_BY_C_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
144 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
145 "findByC_D",
146 new String[] { Long.class.getName(), Date.class.getName() });
147 public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
148 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
149 "findByC_D",
150 new String[] {
151 Long.class.getName(), Date.class.getName(),
152
153 "java.lang.Integer", "java.lang.Integer",
154 "com.liferay.portal.kernel.util.OrderByComparator"
155 });
156 public static final FinderPath FINDER_PATH_COUNT_BY_C_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
157 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
158 "countByC_D",
159 new String[] { Long.class.getName(), Date.class.getName() });
160 public static final FinderPath FINDER_PATH_FIND_BY_C_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
161 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
162 "findByC_S",
163 new String[] { Long.class.getName(), Integer.class.getName() });
164 public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
165 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
166 "findByC_S",
167 new String[] {
168 Long.class.getName(), Integer.class.getName(),
169
170 "java.lang.Integer", "java.lang.Integer",
171 "com.liferay.portal.kernel.util.OrderByComparator"
172 });
173 public static final FinderPath FINDER_PATH_COUNT_BY_C_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
174 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
175 "countByC_S",
176 new String[] { Long.class.getName(), Integer.class.getName() });
177 public static final FinderPath FINDER_PATH_FETCH_BY_G_UT = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
178 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_ENTITY,
179 "fetchByG_UT",
180 new String[] { Long.class.getName(), String.class.getName() });
181 public static final FinderPath FINDER_PATH_COUNT_BY_G_UT = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
182 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
183 "countByG_UT",
184 new String[] { Long.class.getName(), String.class.getName() });
185 public static final FinderPath FINDER_PATH_FIND_BY_G_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
186 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
187 "findByG_D",
188 new String[] { Long.class.getName(), Date.class.getName() });
189 public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
190 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
191 "findByG_D",
192 new String[] {
193 Long.class.getName(), Date.class.getName(),
194
195 "java.lang.Integer", "java.lang.Integer",
196 "com.liferay.portal.kernel.util.OrderByComparator"
197 });
198 public static final FinderPath FINDER_PATH_COUNT_BY_G_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
199 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
200 "countByG_D",
201 new String[] { Long.class.getName(), Date.class.getName() });
202 public static final FinderPath FINDER_PATH_FIND_BY_G_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
203 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
204 "findByG_S",
205 new String[] { Long.class.getName(), Integer.class.getName() });
206 public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
207 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
208 "findByG_S",
209 new String[] {
210 Long.class.getName(), Integer.class.getName(),
211
212 "java.lang.Integer", "java.lang.Integer",
213 "com.liferay.portal.kernel.util.OrderByComparator"
214 });
215 public static final FinderPath FINDER_PATH_COUNT_BY_G_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
216 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
217 "countByG_S",
218 new String[] { Long.class.getName(), Integer.class.getName() });
219 public static final FinderPath FINDER_PATH_FIND_BY_C_U_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
220 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
221 "findByC_U_S",
222 new String[] {
223 Long.class.getName(), Long.class.getName(),
224 Integer.class.getName()
225 });
226 public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_U_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
227 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
228 "findByC_U_S",
229 new String[] {
230 Long.class.getName(), Long.class.getName(),
231 Integer.class.getName(),
232
233 "java.lang.Integer", "java.lang.Integer",
234 "com.liferay.portal.kernel.util.OrderByComparator"
235 });
236 public static final FinderPath FINDER_PATH_COUNT_BY_C_U_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
237 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
238 "countByC_U_S",
239 new String[] {
240 Long.class.getName(), Long.class.getName(),
241 Integer.class.getName()
242 });
243 public static final FinderPath FINDER_PATH_FIND_BY_C_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
244 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
245 "findByC_D_S",
246 new String[] {
247 Long.class.getName(), Date.class.getName(),
248 Integer.class.getName()
249 });
250 public static final FinderPath FINDER_PATH_FIND_BY_OBC_C_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
251 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
252 "findByC_D_S",
253 new String[] {
254 Long.class.getName(), Date.class.getName(),
255 Integer.class.getName(),
256
257 "java.lang.Integer", "java.lang.Integer",
258 "com.liferay.portal.kernel.util.OrderByComparator"
259 });
260 public static final FinderPath FINDER_PATH_COUNT_BY_C_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
261 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
262 "countByC_D_S",
263 new String[] {
264 Long.class.getName(), Date.class.getName(),
265 Integer.class.getName()
266 });
267 public static final FinderPath FINDER_PATH_FIND_BY_G_U_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
268 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
269 "findByG_U_D",
270 new String[] {
271 Long.class.getName(), Long.class.getName(), Date.class.getName()
272 });
273 public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_U_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
274 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
275 "findByG_U_D",
276 new String[] {
277 Long.class.getName(), Long.class.getName(), Date.class.getName(),
278
279 "java.lang.Integer", "java.lang.Integer",
280 "com.liferay.portal.kernel.util.OrderByComparator"
281 });
282 public static final FinderPath FINDER_PATH_COUNT_BY_G_U_D = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
283 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
284 "countByG_U_D",
285 new String[] {
286 Long.class.getName(), Long.class.getName(), Date.class.getName()
287 });
288 public static final FinderPath FINDER_PATH_FIND_BY_G_U_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
289 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
290 "findByG_U_S",
291 new String[] {
292 Long.class.getName(), Long.class.getName(),
293 Integer.class.getName()
294 });
295 public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_U_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
296 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
297 "findByG_U_S",
298 new String[] {
299 Long.class.getName(), Long.class.getName(),
300 Integer.class.getName(),
301
302 "java.lang.Integer", "java.lang.Integer",
303 "com.liferay.portal.kernel.util.OrderByComparator"
304 });
305 public static final FinderPath FINDER_PATH_COUNT_BY_G_U_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
306 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
307 "countByG_U_S",
308 new String[] {
309 Long.class.getName(), Long.class.getName(),
310 Integer.class.getName()
311 });
312 public static final FinderPath FINDER_PATH_FIND_BY_G_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
313 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
314 "findByG_D_S",
315 new String[] {
316 Long.class.getName(), Date.class.getName(),
317 Integer.class.getName()
318 });
319 public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
320 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
321 "findByG_D_S",
322 new String[] {
323 Long.class.getName(), Date.class.getName(),
324 Integer.class.getName(),
325
326 "java.lang.Integer", "java.lang.Integer",
327 "com.liferay.portal.kernel.util.OrderByComparator"
328 });
329 public static final FinderPath FINDER_PATH_COUNT_BY_G_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
330 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
331 "countByG_D_S",
332 new String[] {
333 Long.class.getName(), Date.class.getName(),
334 Integer.class.getName()
335 });
336 public static final FinderPath FINDER_PATH_FIND_BY_G_U_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
337 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
338 "findByG_U_D_S",
339 new String[] {
340 Long.class.getName(), Long.class.getName(), Date.class.getName(),
341 Integer.class.getName()
342 });
343 public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_U_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
344 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
345 "findByG_U_D_S",
346 new String[] {
347 Long.class.getName(), Long.class.getName(), Date.class.getName(),
348 Integer.class.getName(),
349
350 "java.lang.Integer", "java.lang.Integer",
351 "com.liferay.portal.kernel.util.OrderByComparator"
352 });
353 public static final FinderPath FINDER_PATH_COUNT_BY_G_U_D_S = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
354 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
355 "countByG_U_D_S",
356 new String[] {
357 Long.class.getName(), Long.class.getName(), Date.class.getName(),
358 Integer.class.getName()
359 });
360 public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
361 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
362 "findAll", new String[0]);
363 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
364 BlogsEntryModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
365 "countAll", new String[0]);
366
367 public void cacheResult(BlogsEntry blogsEntry) {
368 EntityCacheUtil.putResult(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
369 BlogsEntryImpl.class, blogsEntry.getPrimaryKey(), blogsEntry);
370
371 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
372 new Object[] { blogsEntry.getUuid(), new Long(
373 blogsEntry.getGroupId()) }, blogsEntry);
374
375 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_UT,
376 new Object[] {
377 new Long(blogsEntry.getGroupId()),
378
379 blogsEntry.getUrlTitle()
380 }, blogsEntry);
381 }
382
383 public void cacheResult(List<BlogsEntry> blogsEntries) {
384 for (BlogsEntry blogsEntry : blogsEntries) {
385 if (EntityCacheUtil.getResult(
386 BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
387 BlogsEntryImpl.class, blogsEntry.getPrimaryKey(), this) == null) {
388 cacheResult(blogsEntry);
389 }
390 }
391 }
392
393 public void clearCache() {
394 CacheRegistry.clear(BlogsEntryImpl.class.getName());
395 EntityCacheUtil.clearCache(BlogsEntryImpl.class.getName());
396 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
397 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
398 }
399
400 public BlogsEntry create(long entryId) {
401 BlogsEntry blogsEntry = new BlogsEntryImpl();
402
403 blogsEntry.setNew(true);
404 blogsEntry.setPrimaryKey(entryId);
405
406 String uuid = PortalUUIDUtil.generate();
407
408 blogsEntry.setUuid(uuid);
409
410 return blogsEntry;
411 }
412
413 public BlogsEntry remove(Serializable primaryKey)
414 throws NoSuchModelException, SystemException {
415 return remove(((Long)primaryKey).longValue());
416 }
417
418 public BlogsEntry remove(long entryId)
419 throws NoSuchEntryException, SystemException {
420 Session session = null;
421
422 try {
423 session = openSession();
424
425 BlogsEntry blogsEntry = (BlogsEntry)session.get(BlogsEntryImpl.class,
426 new Long(entryId));
427
428 if (blogsEntry == null) {
429 if (_log.isWarnEnabled()) {
430 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + entryId);
431 }
432
433 throw new NoSuchEntryException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
434 entryId);
435 }
436
437 return remove(blogsEntry);
438 }
439 catch (NoSuchEntryException nsee) {
440 throw nsee;
441 }
442 catch (Exception e) {
443 throw processException(e);
444 }
445 finally {
446 closeSession(session);
447 }
448 }
449
450 public BlogsEntry remove(BlogsEntry blogsEntry) throws SystemException {
451 for (ModelListener<BlogsEntry> listener : listeners) {
452 listener.onBeforeRemove(blogsEntry);
453 }
454
455 blogsEntry = removeImpl(blogsEntry);
456
457 for (ModelListener<BlogsEntry> listener : listeners) {
458 listener.onAfterRemove(blogsEntry);
459 }
460
461 return blogsEntry;
462 }
463
464 protected BlogsEntry removeImpl(BlogsEntry blogsEntry)
465 throws SystemException {
466 blogsEntry = toUnwrappedModel(blogsEntry);
467
468 Session session = null;
469
470 try {
471 session = openSession();
472
473 if (blogsEntry.isCachedModel() || BatchSessionUtil.isEnabled()) {
474 Object staleObject = session.get(BlogsEntryImpl.class,
475 blogsEntry.getPrimaryKeyObj());
476
477 if (staleObject != null) {
478 session.evict(staleObject);
479 }
480 }
481
482 session.delete(blogsEntry);
483
484 session.flush();
485 }
486 catch (Exception e) {
487 throw processException(e);
488 }
489 finally {
490 closeSession(session);
491 }
492
493 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
494
495 BlogsEntryModelImpl blogsEntryModelImpl = (BlogsEntryModelImpl)blogsEntry;
496
497 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_UUID_G,
498 new Object[] {
499 blogsEntryModelImpl.getOriginalUuid(),
500 new Long(blogsEntryModelImpl.getOriginalGroupId())
501 });
502
503 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_UT,
504 new Object[] {
505 new Long(blogsEntryModelImpl.getOriginalGroupId()),
506
507 blogsEntryModelImpl.getOriginalUrlTitle()
508 });
509
510 EntityCacheUtil.removeResult(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
511 BlogsEntryImpl.class, blogsEntry.getPrimaryKey());
512
513 return blogsEntry;
514 }
515
516 public BlogsEntry updateImpl(
517 com.liferay.portlet.blogs.model.BlogsEntry blogsEntry, boolean merge)
518 throws SystemException {
519 blogsEntry = toUnwrappedModel(blogsEntry);
520
521 boolean isNew = blogsEntry.isNew();
522
523 BlogsEntryModelImpl blogsEntryModelImpl = (BlogsEntryModelImpl)blogsEntry;
524
525 if (Validator.isNull(blogsEntry.getUuid())) {
526 String uuid = PortalUUIDUtil.generate();
527
528 blogsEntry.setUuid(uuid);
529 }
530
531 Session session = null;
532
533 try {
534 session = openSession();
535
536 BatchSessionUtil.update(session, blogsEntry, merge);
537
538 blogsEntry.setNew(false);
539 }
540 catch (Exception e) {
541 throw processException(e);
542 }
543 finally {
544 closeSession(session);
545 }
546
547 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
548
549 EntityCacheUtil.putResult(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
550 BlogsEntryImpl.class, blogsEntry.getPrimaryKey(), blogsEntry);
551
552 if (!isNew &&
553 (!Validator.equals(blogsEntry.getUuid(),
554 blogsEntryModelImpl.getOriginalUuid()) ||
555 (blogsEntry.getGroupId() != blogsEntryModelImpl.getOriginalGroupId()))) {
556 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_UUID_G,
557 new Object[] {
558 blogsEntryModelImpl.getOriginalUuid(),
559 new Long(blogsEntryModelImpl.getOriginalGroupId())
560 });
561 }
562
563 if (isNew ||
564 (!Validator.equals(blogsEntry.getUuid(),
565 blogsEntryModelImpl.getOriginalUuid()) ||
566 (blogsEntry.getGroupId() != blogsEntryModelImpl.getOriginalGroupId()))) {
567 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
568 new Object[] {
569 blogsEntry.getUuid(), new Long(blogsEntry.getGroupId())
570 }, blogsEntry);
571 }
572
573 if (!isNew &&
574 ((blogsEntry.getGroupId() != blogsEntryModelImpl.getOriginalGroupId()) ||
575 !Validator.equals(blogsEntry.getUrlTitle(),
576 blogsEntryModelImpl.getOriginalUrlTitle()))) {
577 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_UT,
578 new Object[] {
579 new Long(blogsEntryModelImpl.getOriginalGroupId()),
580
581 blogsEntryModelImpl.getOriginalUrlTitle()
582 });
583 }
584
585 if (isNew ||
586 ((blogsEntry.getGroupId() != blogsEntryModelImpl.getOriginalGroupId()) ||
587 !Validator.equals(blogsEntry.getUrlTitle(),
588 blogsEntryModelImpl.getOriginalUrlTitle()))) {
589 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_UT,
590 new Object[] {
591 new Long(blogsEntry.getGroupId()),
592
593 blogsEntry.getUrlTitle()
594 }, blogsEntry);
595 }
596
597 return blogsEntry;
598 }
599
600 protected BlogsEntry toUnwrappedModel(BlogsEntry blogsEntry) {
601 if (blogsEntry instanceof BlogsEntryImpl) {
602 return blogsEntry;
603 }
604
605 BlogsEntryImpl blogsEntryImpl = new BlogsEntryImpl();
606
607 blogsEntryImpl.setNew(blogsEntry.isNew());
608 blogsEntryImpl.setPrimaryKey(blogsEntry.getPrimaryKey());
609
610 blogsEntryImpl.setUuid(blogsEntry.getUuid());
611 blogsEntryImpl.setEntryId(blogsEntry.getEntryId());
612 blogsEntryImpl.setGroupId(blogsEntry.getGroupId());
613 blogsEntryImpl.setCompanyId(blogsEntry.getCompanyId());
614 blogsEntryImpl.setUserId(blogsEntry.getUserId());
615 blogsEntryImpl.setUserName(blogsEntry.getUserName());
616 blogsEntryImpl.setCreateDate(blogsEntry.getCreateDate());
617 blogsEntryImpl.setModifiedDate(blogsEntry.getModifiedDate());
618 blogsEntryImpl.setTitle(blogsEntry.getTitle());
619 blogsEntryImpl.setUrlTitle(blogsEntry.getUrlTitle());
620 blogsEntryImpl.setContent(blogsEntry.getContent());
621 blogsEntryImpl.setDisplayDate(blogsEntry.getDisplayDate());
622 blogsEntryImpl.setAllowPingbacks(blogsEntry.isAllowPingbacks());
623 blogsEntryImpl.setAllowTrackbacks(blogsEntry.isAllowTrackbacks());
624 blogsEntryImpl.setTrackbacks(blogsEntry.getTrackbacks());
625 blogsEntryImpl.setStatus(blogsEntry.getStatus());
626 blogsEntryImpl.setStatusByUserId(blogsEntry.getStatusByUserId());
627 blogsEntryImpl.setStatusByUserName(blogsEntry.getStatusByUserName());
628 blogsEntryImpl.setStatusDate(blogsEntry.getStatusDate());
629
630 return blogsEntryImpl;
631 }
632
633 public BlogsEntry findByPrimaryKey(Serializable primaryKey)
634 throws NoSuchModelException, SystemException {
635 return findByPrimaryKey(((Long)primaryKey).longValue());
636 }
637
638 public BlogsEntry findByPrimaryKey(long entryId)
639 throws NoSuchEntryException, SystemException {
640 BlogsEntry blogsEntry = fetchByPrimaryKey(entryId);
641
642 if (blogsEntry == null) {
643 if (_log.isWarnEnabled()) {
644 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + entryId);
645 }
646
647 throw new NoSuchEntryException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
648 entryId);
649 }
650
651 return blogsEntry;
652 }
653
654 public BlogsEntry fetchByPrimaryKey(Serializable primaryKey)
655 throws SystemException {
656 return fetchByPrimaryKey(((Long)primaryKey).longValue());
657 }
658
659 public BlogsEntry fetchByPrimaryKey(long entryId) throws SystemException {
660 BlogsEntry blogsEntry = (BlogsEntry)EntityCacheUtil.getResult(BlogsEntryModelImpl.ENTITY_CACHE_ENABLED,
661 BlogsEntryImpl.class, entryId, this);
662
663 if (blogsEntry == null) {
664 Session session = null;
665
666 try {
667 session = openSession();
668
669 blogsEntry = (BlogsEntry)session.get(BlogsEntryImpl.class,
670 new Long(entryId));
671 }
672 catch (Exception e) {
673 throw processException(e);
674 }
675 finally {
676 if (blogsEntry != null) {
677 cacheResult(blogsEntry);
678 }
679
680 closeSession(session);
681 }
682 }
683
684 return blogsEntry;
685 }
686
687 public List<BlogsEntry> findByUuid(String uuid) throws SystemException {
688 Object[] finderArgs = new Object[] { uuid };
689
690 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_UUID,
691 finderArgs, this);
692
693 if (list == null) {
694 Session session = null;
695
696 try {
697 session = openSession();
698
699 StringBundler query = new StringBundler(3);
700
701 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
702
703 if (uuid == null) {
704 query.append(_FINDER_COLUMN_UUID_UUID_1);
705 }
706 else {
707 if (uuid.equals(StringPool.BLANK)) {
708 query.append(_FINDER_COLUMN_UUID_UUID_3);
709 }
710 else {
711 query.append(_FINDER_COLUMN_UUID_UUID_2);
712 }
713 }
714
715 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
716
717 String sql = query.toString();
718
719 Query q = session.createQuery(sql);
720
721 QueryPos qPos = QueryPos.getInstance(q);
722
723 if (uuid != null) {
724 qPos.add(uuid);
725 }
726
727 list = q.list();
728 }
729 catch (Exception e) {
730 throw processException(e);
731 }
732 finally {
733 if (list == null) {
734 list = new ArrayList<BlogsEntry>();
735 }
736
737 cacheResult(list);
738
739 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_UUID, finderArgs,
740 list);
741
742 closeSession(session);
743 }
744 }
745
746 return list;
747 }
748
749 public List<BlogsEntry> findByUuid(String uuid, int start, int end)
750 throws SystemException {
751 return findByUuid(uuid, start, end, null);
752 }
753
754 public List<BlogsEntry> findByUuid(String uuid, int start, int end,
755 OrderByComparator obc) throws SystemException {
756 Object[] finderArgs = new Object[] {
757 uuid,
758
759 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
760 };
761
762 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_UUID,
763 finderArgs, this);
764
765 if (list == null) {
766 Session session = null;
767
768 try {
769 session = openSession();
770
771 StringBundler query = null;
772
773 if (obc != null) {
774 query = new StringBundler(3 +
775 (obc.getOrderByFields().length * 3));
776 }
777 else {
778 query = new StringBundler(3);
779 }
780
781 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
782
783 if (uuid == null) {
784 query.append(_FINDER_COLUMN_UUID_UUID_1);
785 }
786 else {
787 if (uuid.equals(StringPool.BLANK)) {
788 query.append(_FINDER_COLUMN_UUID_UUID_3);
789 }
790 else {
791 query.append(_FINDER_COLUMN_UUID_UUID_2);
792 }
793 }
794
795 if (obc != null) {
796 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
797 }
798
799 else {
800 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
801 }
802
803 String sql = query.toString();
804
805 Query q = session.createQuery(sql);
806
807 QueryPos qPos = QueryPos.getInstance(q);
808
809 if (uuid != null) {
810 qPos.add(uuid);
811 }
812
813 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
814 end);
815 }
816 catch (Exception e) {
817 throw processException(e);
818 }
819 finally {
820 if (list == null) {
821 list = new ArrayList<BlogsEntry>();
822 }
823
824 cacheResult(list);
825
826 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_UUID,
827 finderArgs, list);
828
829 closeSession(session);
830 }
831 }
832
833 return list;
834 }
835
836 public BlogsEntry findByUuid_First(String uuid, OrderByComparator obc)
837 throws NoSuchEntryException, SystemException {
838 List<BlogsEntry> list = findByUuid(uuid, 0, 1, obc);
839
840 if (list.isEmpty()) {
841 StringBundler msg = new StringBundler(4);
842
843 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
844
845 msg.append("uuid=");
846 msg.append(uuid);
847
848 msg.append(StringPool.CLOSE_CURLY_BRACE);
849
850 throw new NoSuchEntryException(msg.toString());
851 }
852 else {
853 return list.get(0);
854 }
855 }
856
857 public BlogsEntry findByUuid_Last(String uuid, OrderByComparator obc)
858 throws NoSuchEntryException, SystemException {
859 int count = countByUuid(uuid);
860
861 List<BlogsEntry> list = findByUuid(uuid, count - 1, count, obc);
862
863 if (list.isEmpty()) {
864 StringBundler msg = new StringBundler(4);
865
866 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
867
868 msg.append("uuid=");
869 msg.append(uuid);
870
871 msg.append(StringPool.CLOSE_CURLY_BRACE);
872
873 throw new NoSuchEntryException(msg.toString());
874 }
875 else {
876 return list.get(0);
877 }
878 }
879
880 public BlogsEntry[] findByUuid_PrevAndNext(long entryId, String uuid,
881 OrderByComparator obc) throws NoSuchEntryException, SystemException {
882 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
883
884 int count = countByUuid(uuid);
885
886 Session session = null;
887
888 try {
889 session = openSession();
890
891 StringBundler query = null;
892
893 if (obc != null) {
894 query = new StringBundler(3 +
895 (obc.getOrderByFields().length * 3));
896 }
897 else {
898 query = new StringBundler(3);
899 }
900
901 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
902
903 if (uuid == null) {
904 query.append(_FINDER_COLUMN_UUID_UUID_1);
905 }
906 else {
907 if (uuid.equals(StringPool.BLANK)) {
908 query.append(_FINDER_COLUMN_UUID_UUID_3);
909 }
910 else {
911 query.append(_FINDER_COLUMN_UUID_UUID_2);
912 }
913 }
914
915 if (obc != null) {
916 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
917 }
918
919 else {
920 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
921 }
922
923 String sql = query.toString();
924
925 Query q = session.createQuery(sql);
926
927 QueryPos qPos = QueryPos.getInstance(q);
928
929 if (uuid != null) {
930 qPos.add(uuid);
931 }
932
933 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
934 blogsEntry);
935
936 BlogsEntry[] array = new BlogsEntryImpl[3];
937
938 array[0] = (BlogsEntry)objArray[0];
939 array[1] = (BlogsEntry)objArray[1];
940 array[2] = (BlogsEntry)objArray[2];
941
942 return array;
943 }
944 catch (Exception e) {
945 throw processException(e);
946 }
947 finally {
948 closeSession(session);
949 }
950 }
951
952 public BlogsEntry findByUUID_G(String uuid, long groupId)
953 throws NoSuchEntryException, SystemException {
954 BlogsEntry blogsEntry = fetchByUUID_G(uuid, groupId);
955
956 if (blogsEntry == null) {
957 StringBundler msg = new StringBundler(6);
958
959 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
960
961 msg.append("uuid=");
962 msg.append(uuid);
963
964 msg.append(", groupId=");
965 msg.append(groupId);
966
967 msg.append(StringPool.CLOSE_CURLY_BRACE);
968
969 if (_log.isWarnEnabled()) {
970 _log.warn(msg.toString());
971 }
972
973 throw new NoSuchEntryException(msg.toString());
974 }
975
976 return blogsEntry;
977 }
978
979 public BlogsEntry fetchByUUID_G(String uuid, long groupId)
980 throws SystemException {
981 return fetchByUUID_G(uuid, groupId, true);
982 }
983
984 public BlogsEntry fetchByUUID_G(String uuid, long groupId,
985 boolean retrieveFromCache) throws SystemException {
986 Object[] finderArgs = new Object[] { uuid, new Long(groupId) };
987
988 Object result = null;
989
990 if (retrieveFromCache) {
991 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_UUID_G,
992 finderArgs, this);
993 }
994
995 if (result == null) {
996 Session session = null;
997
998 try {
999 session = openSession();
1000
1001 StringBundler query = new StringBundler(4);
1002
1003 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1004
1005 if (uuid == null) {
1006 query.append(_FINDER_COLUMN_UUID_G_UUID_1);
1007 }
1008 else {
1009 if (uuid.equals(StringPool.BLANK)) {
1010 query.append(_FINDER_COLUMN_UUID_G_UUID_3);
1011 }
1012 else {
1013 query.append(_FINDER_COLUMN_UUID_G_UUID_2);
1014 }
1015 }
1016
1017 query.append(_FINDER_COLUMN_UUID_G_GROUPID_2);
1018
1019 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1020
1021 String sql = query.toString();
1022
1023 Query q = session.createQuery(sql);
1024
1025 QueryPos qPos = QueryPos.getInstance(q);
1026
1027 if (uuid != null) {
1028 qPos.add(uuid);
1029 }
1030
1031 qPos.add(groupId);
1032
1033 List<BlogsEntry> list = q.list();
1034
1035 result = list;
1036
1037 BlogsEntry blogsEntry = null;
1038
1039 if (list.isEmpty()) {
1040 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
1041 finderArgs, list);
1042 }
1043 else {
1044 blogsEntry = list.get(0);
1045
1046 cacheResult(blogsEntry);
1047
1048 if ((blogsEntry.getUuid() == null) ||
1049 !blogsEntry.getUuid().equals(uuid) ||
1050 (blogsEntry.getGroupId() != groupId)) {
1051 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
1052 finderArgs, blogsEntry);
1053 }
1054 }
1055
1056 return blogsEntry;
1057 }
1058 catch (Exception e) {
1059 throw processException(e);
1060 }
1061 finally {
1062 if (result == null) {
1063 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
1064 finderArgs, new ArrayList<BlogsEntry>());
1065 }
1066
1067 closeSession(session);
1068 }
1069 }
1070 else {
1071 if (result instanceof List<?>) {
1072 return null;
1073 }
1074 else {
1075 return (BlogsEntry)result;
1076 }
1077 }
1078 }
1079
1080 public List<BlogsEntry> findByGroupId(long groupId)
1081 throws SystemException {
1082 Object[] finderArgs = new Object[] { new Long(groupId) };
1083
1084 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_GROUPID,
1085 finderArgs, this);
1086
1087 if (list == null) {
1088 Session session = null;
1089
1090 try {
1091 session = openSession();
1092
1093 StringBundler query = new StringBundler(3);
1094
1095 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1096
1097 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1098
1099 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1100
1101 String sql = query.toString();
1102
1103 Query q = session.createQuery(sql);
1104
1105 QueryPos qPos = QueryPos.getInstance(q);
1106
1107 qPos.add(groupId);
1108
1109 list = q.list();
1110 }
1111 catch (Exception e) {
1112 throw processException(e);
1113 }
1114 finally {
1115 if (list == null) {
1116 list = new ArrayList<BlogsEntry>();
1117 }
1118
1119 cacheResult(list);
1120
1121 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_GROUPID,
1122 finderArgs, list);
1123
1124 closeSession(session);
1125 }
1126 }
1127
1128 return list;
1129 }
1130
1131 public List<BlogsEntry> findByGroupId(long groupId, int start, int end)
1132 throws SystemException {
1133 return findByGroupId(groupId, start, end, null);
1134 }
1135
1136 public List<BlogsEntry> findByGroupId(long groupId, int start, int end,
1137 OrderByComparator obc) throws SystemException {
1138 Object[] finderArgs = new Object[] {
1139 new Long(groupId),
1140
1141 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1142 };
1143
1144 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
1145 finderArgs, this);
1146
1147 if (list == null) {
1148 Session session = null;
1149
1150 try {
1151 session = openSession();
1152
1153 StringBundler query = null;
1154
1155 if (obc != null) {
1156 query = new StringBundler(3 +
1157 (obc.getOrderByFields().length * 3));
1158 }
1159 else {
1160 query = new StringBundler(3);
1161 }
1162
1163 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1164
1165 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1166
1167 if (obc != null) {
1168 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1169 }
1170
1171 else {
1172 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1173 }
1174
1175 String sql = query.toString();
1176
1177 Query q = session.createQuery(sql);
1178
1179 QueryPos qPos = QueryPos.getInstance(q);
1180
1181 qPos.add(groupId);
1182
1183 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
1184 end);
1185 }
1186 catch (Exception e) {
1187 throw processException(e);
1188 }
1189 finally {
1190 if (list == null) {
1191 list = new ArrayList<BlogsEntry>();
1192 }
1193
1194 cacheResult(list);
1195
1196 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
1197 finderArgs, list);
1198
1199 closeSession(session);
1200 }
1201 }
1202
1203 return list;
1204 }
1205
1206 public BlogsEntry findByGroupId_First(long groupId, OrderByComparator obc)
1207 throws NoSuchEntryException, SystemException {
1208 List<BlogsEntry> list = findByGroupId(groupId, 0, 1, obc);
1209
1210 if (list.isEmpty()) {
1211 StringBundler msg = new StringBundler(4);
1212
1213 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1214
1215 msg.append("groupId=");
1216 msg.append(groupId);
1217
1218 msg.append(StringPool.CLOSE_CURLY_BRACE);
1219
1220 throw new NoSuchEntryException(msg.toString());
1221 }
1222 else {
1223 return list.get(0);
1224 }
1225 }
1226
1227 public BlogsEntry findByGroupId_Last(long groupId, OrderByComparator obc)
1228 throws NoSuchEntryException, SystemException {
1229 int count = countByGroupId(groupId);
1230
1231 List<BlogsEntry> list = findByGroupId(groupId, count - 1, count, obc);
1232
1233 if (list.isEmpty()) {
1234 StringBundler msg = new StringBundler(4);
1235
1236 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1237
1238 msg.append("groupId=");
1239 msg.append(groupId);
1240
1241 msg.append(StringPool.CLOSE_CURLY_BRACE);
1242
1243 throw new NoSuchEntryException(msg.toString());
1244 }
1245 else {
1246 return list.get(0);
1247 }
1248 }
1249
1250 public BlogsEntry[] findByGroupId_PrevAndNext(long entryId, long groupId,
1251 OrderByComparator obc) throws NoSuchEntryException, SystemException {
1252 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
1253
1254 int count = countByGroupId(groupId);
1255
1256 Session session = null;
1257
1258 try {
1259 session = openSession();
1260
1261 StringBundler query = null;
1262
1263 if (obc != null) {
1264 query = new StringBundler(3 +
1265 (obc.getOrderByFields().length * 3));
1266 }
1267 else {
1268 query = new StringBundler(3);
1269 }
1270
1271 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1272
1273 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1274
1275 if (obc != null) {
1276 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1277 }
1278
1279 else {
1280 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1281 }
1282
1283 String sql = query.toString();
1284
1285 Query q = session.createQuery(sql);
1286
1287 QueryPos qPos = QueryPos.getInstance(q);
1288
1289 qPos.add(groupId);
1290
1291 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1292 blogsEntry);
1293
1294 BlogsEntry[] array = new BlogsEntryImpl[3];
1295
1296 array[0] = (BlogsEntry)objArray[0];
1297 array[1] = (BlogsEntry)objArray[1];
1298 array[2] = (BlogsEntry)objArray[2];
1299
1300 return array;
1301 }
1302 catch (Exception e) {
1303 throw processException(e);
1304 }
1305 finally {
1306 closeSession(session);
1307 }
1308 }
1309
1310 public List<BlogsEntry> findByCompanyId(long companyId)
1311 throws SystemException {
1312 Object[] finderArgs = new Object[] { new Long(companyId) };
1313
1314 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
1315 finderArgs, this);
1316
1317 if (list == null) {
1318 Session session = null;
1319
1320 try {
1321 session = openSession();
1322
1323 StringBundler query = new StringBundler(3);
1324
1325 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1326
1327 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
1328
1329 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1330
1331 String sql = query.toString();
1332
1333 Query q = session.createQuery(sql);
1334
1335 QueryPos qPos = QueryPos.getInstance(q);
1336
1337 qPos.add(companyId);
1338
1339 list = q.list();
1340 }
1341 catch (Exception e) {
1342 throw processException(e);
1343 }
1344 finally {
1345 if (list == null) {
1346 list = new ArrayList<BlogsEntry>();
1347 }
1348
1349 cacheResult(list);
1350
1351 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
1352 finderArgs, list);
1353
1354 closeSession(session);
1355 }
1356 }
1357
1358 return list;
1359 }
1360
1361 public List<BlogsEntry> findByCompanyId(long companyId, int start, int end)
1362 throws SystemException {
1363 return findByCompanyId(companyId, start, end, null);
1364 }
1365
1366 public List<BlogsEntry> findByCompanyId(long companyId, int start, int end,
1367 OrderByComparator obc) throws SystemException {
1368 Object[] finderArgs = new Object[] {
1369 new Long(companyId),
1370
1371 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1372 };
1373
1374 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
1375 finderArgs, this);
1376
1377 if (list == null) {
1378 Session session = null;
1379
1380 try {
1381 session = openSession();
1382
1383 StringBundler query = null;
1384
1385 if (obc != null) {
1386 query = new StringBundler(3 +
1387 (obc.getOrderByFields().length * 3));
1388 }
1389 else {
1390 query = new StringBundler(3);
1391 }
1392
1393 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1394
1395 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
1396
1397 if (obc != null) {
1398 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1399 }
1400
1401 else {
1402 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1403 }
1404
1405 String sql = query.toString();
1406
1407 Query q = session.createQuery(sql);
1408
1409 QueryPos qPos = QueryPos.getInstance(q);
1410
1411 qPos.add(companyId);
1412
1413 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
1414 end);
1415 }
1416 catch (Exception e) {
1417 throw processException(e);
1418 }
1419 finally {
1420 if (list == null) {
1421 list = new ArrayList<BlogsEntry>();
1422 }
1423
1424 cacheResult(list);
1425
1426 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
1427 finderArgs, list);
1428
1429 closeSession(session);
1430 }
1431 }
1432
1433 return list;
1434 }
1435
1436 public BlogsEntry findByCompanyId_First(long companyId,
1437 OrderByComparator obc) throws NoSuchEntryException, SystemException {
1438 List<BlogsEntry> list = findByCompanyId(companyId, 0, 1, obc);
1439
1440 if (list.isEmpty()) {
1441 StringBundler msg = new StringBundler(4);
1442
1443 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1444
1445 msg.append("companyId=");
1446 msg.append(companyId);
1447
1448 msg.append(StringPool.CLOSE_CURLY_BRACE);
1449
1450 throw new NoSuchEntryException(msg.toString());
1451 }
1452 else {
1453 return list.get(0);
1454 }
1455 }
1456
1457 public BlogsEntry findByCompanyId_Last(long companyId, OrderByComparator obc)
1458 throws NoSuchEntryException, SystemException {
1459 int count = countByCompanyId(companyId);
1460
1461 List<BlogsEntry> list = findByCompanyId(companyId, count - 1, count, obc);
1462
1463 if (list.isEmpty()) {
1464 StringBundler msg = new StringBundler(4);
1465
1466 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1467
1468 msg.append("companyId=");
1469 msg.append(companyId);
1470
1471 msg.append(StringPool.CLOSE_CURLY_BRACE);
1472
1473 throw new NoSuchEntryException(msg.toString());
1474 }
1475 else {
1476 return list.get(0);
1477 }
1478 }
1479
1480 public BlogsEntry[] findByCompanyId_PrevAndNext(long entryId,
1481 long companyId, OrderByComparator obc)
1482 throws NoSuchEntryException, SystemException {
1483 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
1484
1485 int count = countByCompanyId(companyId);
1486
1487 Session session = null;
1488
1489 try {
1490 session = openSession();
1491
1492 StringBundler query = null;
1493
1494 if (obc != null) {
1495 query = new StringBundler(3 +
1496 (obc.getOrderByFields().length * 3));
1497 }
1498 else {
1499 query = new StringBundler(3);
1500 }
1501
1502 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1503
1504 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
1505
1506 if (obc != null) {
1507 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1508 }
1509
1510 else {
1511 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1512 }
1513
1514 String sql = query.toString();
1515
1516 Query q = session.createQuery(sql);
1517
1518 QueryPos qPos = QueryPos.getInstance(q);
1519
1520 qPos.add(companyId);
1521
1522 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1523 blogsEntry);
1524
1525 BlogsEntry[] array = new BlogsEntryImpl[3];
1526
1527 array[0] = (BlogsEntry)objArray[0];
1528 array[1] = (BlogsEntry)objArray[1];
1529 array[2] = (BlogsEntry)objArray[2];
1530
1531 return array;
1532 }
1533 catch (Exception e) {
1534 throw processException(e);
1535 }
1536 finally {
1537 closeSession(session);
1538 }
1539 }
1540
1541 public List<BlogsEntry> findByC_U(long companyId, long userId)
1542 throws SystemException {
1543 Object[] finderArgs = new Object[] { new Long(companyId), new Long(userId) };
1544
1545 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_U,
1546 finderArgs, this);
1547
1548 if (list == null) {
1549 Session session = null;
1550
1551 try {
1552 session = openSession();
1553
1554 StringBundler query = new StringBundler(4);
1555
1556 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1557
1558 query.append(_FINDER_COLUMN_C_U_COMPANYID_2);
1559
1560 query.append(_FINDER_COLUMN_C_U_USERID_2);
1561
1562 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1563
1564 String sql = query.toString();
1565
1566 Query q = session.createQuery(sql);
1567
1568 QueryPos qPos = QueryPos.getInstance(q);
1569
1570 qPos.add(companyId);
1571
1572 qPos.add(userId);
1573
1574 list = q.list();
1575 }
1576 catch (Exception e) {
1577 throw processException(e);
1578 }
1579 finally {
1580 if (list == null) {
1581 list = new ArrayList<BlogsEntry>();
1582 }
1583
1584 cacheResult(list);
1585
1586 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_U, finderArgs,
1587 list);
1588
1589 closeSession(session);
1590 }
1591 }
1592
1593 return list;
1594 }
1595
1596 public List<BlogsEntry> findByC_U(long companyId, long userId, int start,
1597 int end) throws SystemException {
1598 return findByC_U(companyId, userId, start, end, null);
1599 }
1600
1601 public List<BlogsEntry> findByC_U(long companyId, long userId, int start,
1602 int end, OrderByComparator obc) throws SystemException {
1603 Object[] finderArgs = new Object[] {
1604 new Long(companyId), new Long(userId),
1605
1606 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1607 };
1608
1609 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_U,
1610 finderArgs, this);
1611
1612 if (list == null) {
1613 Session session = null;
1614
1615 try {
1616 session = openSession();
1617
1618 StringBundler query = null;
1619
1620 if (obc != null) {
1621 query = new StringBundler(4 +
1622 (obc.getOrderByFields().length * 3));
1623 }
1624 else {
1625 query = new StringBundler(4);
1626 }
1627
1628 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1629
1630 query.append(_FINDER_COLUMN_C_U_COMPANYID_2);
1631
1632 query.append(_FINDER_COLUMN_C_U_USERID_2);
1633
1634 if (obc != null) {
1635 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1636 }
1637
1638 else {
1639 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1640 }
1641
1642 String sql = query.toString();
1643
1644 Query q = session.createQuery(sql);
1645
1646 QueryPos qPos = QueryPos.getInstance(q);
1647
1648 qPos.add(companyId);
1649
1650 qPos.add(userId);
1651
1652 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
1653 end);
1654 }
1655 catch (Exception e) {
1656 throw processException(e);
1657 }
1658 finally {
1659 if (list == null) {
1660 list = new ArrayList<BlogsEntry>();
1661 }
1662
1663 cacheResult(list);
1664
1665 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_U,
1666 finderArgs, list);
1667
1668 closeSession(session);
1669 }
1670 }
1671
1672 return list;
1673 }
1674
1675 public BlogsEntry findByC_U_First(long companyId, long userId,
1676 OrderByComparator obc) throws NoSuchEntryException, SystemException {
1677 List<BlogsEntry> list = findByC_U(companyId, userId, 0, 1, obc);
1678
1679 if (list.isEmpty()) {
1680 StringBundler msg = new StringBundler(6);
1681
1682 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1683
1684 msg.append("companyId=");
1685 msg.append(companyId);
1686
1687 msg.append(", userId=");
1688 msg.append(userId);
1689
1690 msg.append(StringPool.CLOSE_CURLY_BRACE);
1691
1692 throw new NoSuchEntryException(msg.toString());
1693 }
1694 else {
1695 return list.get(0);
1696 }
1697 }
1698
1699 public BlogsEntry findByC_U_Last(long companyId, long userId,
1700 OrderByComparator obc) throws NoSuchEntryException, SystemException {
1701 int count = countByC_U(companyId, userId);
1702
1703 List<BlogsEntry> list = findByC_U(companyId, userId, count - 1, count,
1704 obc);
1705
1706 if (list.isEmpty()) {
1707 StringBundler msg = new StringBundler(6);
1708
1709 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1710
1711 msg.append("companyId=");
1712 msg.append(companyId);
1713
1714 msg.append(", userId=");
1715 msg.append(userId);
1716
1717 msg.append(StringPool.CLOSE_CURLY_BRACE);
1718
1719 throw new NoSuchEntryException(msg.toString());
1720 }
1721 else {
1722 return list.get(0);
1723 }
1724 }
1725
1726 public BlogsEntry[] findByC_U_PrevAndNext(long entryId, long companyId,
1727 long userId, OrderByComparator obc)
1728 throws NoSuchEntryException, SystemException {
1729 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
1730
1731 int count = countByC_U(companyId, userId);
1732
1733 Session session = null;
1734
1735 try {
1736 session = openSession();
1737
1738 StringBundler query = null;
1739
1740 if (obc != null) {
1741 query = new StringBundler(4 +
1742 (obc.getOrderByFields().length * 3));
1743 }
1744 else {
1745 query = new StringBundler(4);
1746 }
1747
1748 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1749
1750 query.append(_FINDER_COLUMN_C_U_COMPANYID_2);
1751
1752 query.append(_FINDER_COLUMN_C_U_USERID_2);
1753
1754 if (obc != null) {
1755 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1756 }
1757
1758 else {
1759 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1760 }
1761
1762 String sql = query.toString();
1763
1764 Query q = session.createQuery(sql);
1765
1766 QueryPos qPos = QueryPos.getInstance(q);
1767
1768 qPos.add(companyId);
1769
1770 qPos.add(userId);
1771
1772 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1773 blogsEntry);
1774
1775 BlogsEntry[] array = new BlogsEntryImpl[3];
1776
1777 array[0] = (BlogsEntry)objArray[0];
1778 array[1] = (BlogsEntry)objArray[1];
1779 array[2] = (BlogsEntry)objArray[2];
1780
1781 return array;
1782 }
1783 catch (Exception e) {
1784 throw processException(e);
1785 }
1786 finally {
1787 closeSession(session);
1788 }
1789 }
1790
1791 public List<BlogsEntry> findByC_D(long companyId, Date displayDate)
1792 throws SystemException {
1793 Object[] finderArgs = new Object[] { new Long(companyId), displayDate };
1794
1795 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_D,
1796 finderArgs, this);
1797
1798 if (list == null) {
1799 Session session = null;
1800
1801 try {
1802 session = openSession();
1803
1804 StringBundler query = new StringBundler(4);
1805
1806 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1807
1808 query.append(_FINDER_COLUMN_C_D_COMPANYID_2);
1809
1810 if (displayDate == null) {
1811 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_1);
1812 }
1813 else {
1814 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_2);
1815 }
1816
1817 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1818
1819 String sql = query.toString();
1820
1821 Query q = session.createQuery(sql);
1822
1823 QueryPos qPos = QueryPos.getInstance(q);
1824
1825 qPos.add(companyId);
1826
1827 if (displayDate != null) {
1828 qPos.add(CalendarUtil.getTimestamp(displayDate));
1829 }
1830
1831 list = q.list();
1832 }
1833 catch (Exception e) {
1834 throw processException(e);
1835 }
1836 finally {
1837 if (list == null) {
1838 list = new ArrayList<BlogsEntry>();
1839 }
1840
1841 cacheResult(list);
1842
1843 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_D, finderArgs,
1844 list);
1845
1846 closeSession(session);
1847 }
1848 }
1849
1850 return list;
1851 }
1852
1853 public List<BlogsEntry> findByC_D(long companyId, Date displayDate,
1854 int start, int end) throws SystemException {
1855 return findByC_D(companyId, displayDate, start, end, null);
1856 }
1857
1858 public List<BlogsEntry> findByC_D(long companyId, Date displayDate,
1859 int start, int end, OrderByComparator obc) throws SystemException {
1860 Object[] finderArgs = new Object[] {
1861 new Long(companyId),
1862
1863 displayDate,
1864
1865 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1866 };
1867
1868 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_D,
1869 finderArgs, this);
1870
1871 if (list == null) {
1872 Session session = null;
1873
1874 try {
1875 session = openSession();
1876
1877 StringBundler query = null;
1878
1879 if (obc != null) {
1880 query = new StringBundler(4 +
1881 (obc.getOrderByFields().length * 3));
1882 }
1883 else {
1884 query = new StringBundler(4);
1885 }
1886
1887 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
1888
1889 query.append(_FINDER_COLUMN_C_D_COMPANYID_2);
1890
1891 if (displayDate == null) {
1892 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_1);
1893 }
1894 else {
1895 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_2);
1896 }
1897
1898 if (obc != null) {
1899 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1900 }
1901
1902 else {
1903 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
1904 }
1905
1906 String sql = query.toString();
1907
1908 Query q = session.createQuery(sql);
1909
1910 QueryPos qPos = QueryPos.getInstance(q);
1911
1912 qPos.add(companyId);
1913
1914 if (displayDate != null) {
1915 qPos.add(CalendarUtil.getTimestamp(displayDate));
1916 }
1917
1918 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
1919 end);
1920 }
1921 catch (Exception e) {
1922 throw processException(e);
1923 }
1924 finally {
1925 if (list == null) {
1926 list = new ArrayList<BlogsEntry>();
1927 }
1928
1929 cacheResult(list);
1930
1931 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_D,
1932 finderArgs, list);
1933
1934 closeSession(session);
1935 }
1936 }
1937
1938 return list;
1939 }
1940
1941 public BlogsEntry findByC_D_First(long companyId, Date displayDate,
1942 OrderByComparator obc) throws NoSuchEntryException, SystemException {
1943 List<BlogsEntry> list = findByC_D(companyId, displayDate, 0, 1, obc);
1944
1945 if (list.isEmpty()) {
1946 StringBundler msg = new StringBundler(6);
1947
1948 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1949
1950 msg.append("companyId=");
1951 msg.append(companyId);
1952
1953 msg.append(", displayDate=");
1954 msg.append(displayDate);
1955
1956 msg.append(StringPool.CLOSE_CURLY_BRACE);
1957
1958 throw new NoSuchEntryException(msg.toString());
1959 }
1960 else {
1961 return list.get(0);
1962 }
1963 }
1964
1965 public BlogsEntry findByC_D_Last(long companyId, Date displayDate,
1966 OrderByComparator obc) throws NoSuchEntryException, SystemException {
1967 int count = countByC_D(companyId, displayDate);
1968
1969 List<BlogsEntry> list = findByC_D(companyId, displayDate, count - 1,
1970 count, obc);
1971
1972 if (list.isEmpty()) {
1973 StringBundler msg = new StringBundler(6);
1974
1975 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1976
1977 msg.append("companyId=");
1978 msg.append(companyId);
1979
1980 msg.append(", displayDate=");
1981 msg.append(displayDate);
1982
1983 msg.append(StringPool.CLOSE_CURLY_BRACE);
1984
1985 throw new NoSuchEntryException(msg.toString());
1986 }
1987 else {
1988 return list.get(0);
1989 }
1990 }
1991
1992 public BlogsEntry[] findByC_D_PrevAndNext(long entryId, long companyId,
1993 Date displayDate, OrderByComparator obc)
1994 throws NoSuchEntryException, SystemException {
1995 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
1996
1997 int count = countByC_D(companyId, displayDate);
1998
1999 Session session = null;
2000
2001 try {
2002 session = openSession();
2003
2004 StringBundler query = null;
2005
2006 if (obc != null) {
2007 query = new StringBundler(4 +
2008 (obc.getOrderByFields().length * 3));
2009 }
2010 else {
2011 query = new StringBundler(4);
2012 }
2013
2014 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2015
2016 query.append(_FINDER_COLUMN_C_D_COMPANYID_2);
2017
2018 if (displayDate == null) {
2019 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_1);
2020 }
2021 else {
2022 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_2);
2023 }
2024
2025 if (obc != null) {
2026 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
2027 }
2028
2029 else {
2030 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2031 }
2032
2033 String sql = query.toString();
2034
2035 Query q = session.createQuery(sql);
2036
2037 QueryPos qPos = QueryPos.getInstance(q);
2038
2039 qPos.add(companyId);
2040
2041 if (displayDate != null) {
2042 qPos.add(CalendarUtil.getTimestamp(displayDate));
2043 }
2044
2045 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
2046 blogsEntry);
2047
2048 BlogsEntry[] array = new BlogsEntryImpl[3];
2049
2050 array[0] = (BlogsEntry)objArray[0];
2051 array[1] = (BlogsEntry)objArray[1];
2052 array[2] = (BlogsEntry)objArray[2];
2053
2054 return array;
2055 }
2056 catch (Exception e) {
2057 throw processException(e);
2058 }
2059 finally {
2060 closeSession(session);
2061 }
2062 }
2063
2064 public List<BlogsEntry> findByC_S(long companyId, int status)
2065 throws SystemException {
2066 Object[] finderArgs = new Object[] {
2067 new Long(companyId), new Integer(status)
2068 };
2069
2070 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_S,
2071 finderArgs, this);
2072
2073 if (list == null) {
2074 Session session = null;
2075
2076 try {
2077 session = openSession();
2078
2079 StringBundler query = new StringBundler(4);
2080
2081 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2082
2083 query.append(_FINDER_COLUMN_C_S_COMPANYID_2);
2084
2085 query.append(_FINDER_COLUMN_C_S_STATUS_2);
2086
2087 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2088
2089 String sql = query.toString();
2090
2091 Query q = session.createQuery(sql);
2092
2093 QueryPos qPos = QueryPos.getInstance(q);
2094
2095 qPos.add(companyId);
2096
2097 qPos.add(status);
2098
2099 list = q.list();
2100 }
2101 catch (Exception e) {
2102 throw processException(e);
2103 }
2104 finally {
2105 if (list == null) {
2106 list = new ArrayList<BlogsEntry>();
2107 }
2108
2109 cacheResult(list);
2110
2111 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_S, finderArgs,
2112 list);
2113
2114 closeSession(session);
2115 }
2116 }
2117
2118 return list;
2119 }
2120
2121 public List<BlogsEntry> findByC_S(long companyId, int status, int start,
2122 int end) throws SystemException {
2123 return findByC_S(companyId, status, start, end, null);
2124 }
2125
2126 public List<BlogsEntry> findByC_S(long companyId, int status, int start,
2127 int end, OrderByComparator obc) throws SystemException {
2128 Object[] finderArgs = new Object[] {
2129 new Long(companyId), new Integer(status),
2130
2131 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
2132 };
2133
2134 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_S,
2135 finderArgs, this);
2136
2137 if (list == null) {
2138 Session session = null;
2139
2140 try {
2141 session = openSession();
2142
2143 StringBundler query = null;
2144
2145 if (obc != null) {
2146 query = new StringBundler(4 +
2147 (obc.getOrderByFields().length * 3));
2148 }
2149 else {
2150 query = new StringBundler(4);
2151 }
2152
2153 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2154
2155 query.append(_FINDER_COLUMN_C_S_COMPANYID_2);
2156
2157 query.append(_FINDER_COLUMN_C_S_STATUS_2);
2158
2159 if (obc != null) {
2160 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
2161 }
2162
2163 else {
2164 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2165 }
2166
2167 String sql = query.toString();
2168
2169 Query q = session.createQuery(sql);
2170
2171 QueryPos qPos = QueryPos.getInstance(q);
2172
2173 qPos.add(companyId);
2174
2175 qPos.add(status);
2176
2177 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
2178 end);
2179 }
2180 catch (Exception e) {
2181 throw processException(e);
2182 }
2183 finally {
2184 if (list == null) {
2185 list = new ArrayList<BlogsEntry>();
2186 }
2187
2188 cacheResult(list);
2189
2190 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_S,
2191 finderArgs, list);
2192
2193 closeSession(session);
2194 }
2195 }
2196
2197 return list;
2198 }
2199
2200 public BlogsEntry findByC_S_First(long companyId, int status,
2201 OrderByComparator obc) throws NoSuchEntryException, SystemException {
2202 List<BlogsEntry> list = findByC_S(companyId, status, 0, 1, obc);
2203
2204 if (list.isEmpty()) {
2205 StringBundler msg = new StringBundler(6);
2206
2207 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2208
2209 msg.append("companyId=");
2210 msg.append(companyId);
2211
2212 msg.append(", status=");
2213 msg.append(status);
2214
2215 msg.append(StringPool.CLOSE_CURLY_BRACE);
2216
2217 throw new NoSuchEntryException(msg.toString());
2218 }
2219 else {
2220 return list.get(0);
2221 }
2222 }
2223
2224 public BlogsEntry findByC_S_Last(long companyId, int status,
2225 OrderByComparator obc) throws NoSuchEntryException, SystemException {
2226 int count = countByC_S(companyId, status);
2227
2228 List<BlogsEntry> list = findByC_S(companyId, status, count - 1, count,
2229 obc);
2230
2231 if (list.isEmpty()) {
2232 StringBundler msg = new StringBundler(6);
2233
2234 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2235
2236 msg.append("companyId=");
2237 msg.append(companyId);
2238
2239 msg.append(", status=");
2240 msg.append(status);
2241
2242 msg.append(StringPool.CLOSE_CURLY_BRACE);
2243
2244 throw new NoSuchEntryException(msg.toString());
2245 }
2246 else {
2247 return list.get(0);
2248 }
2249 }
2250
2251 public BlogsEntry[] findByC_S_PrevAndNext(long entryId, long companyId,
2252 int status, OrderByComparator obc)
2253 throws NoSuchEntryException, SystemException {
2254 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
2255
2256 int count = countByC_S(companyId, status);
2257
2258 Session session = null;
2259
2260 try {
2261 session = openSession();
2262
2263 StringBundler query = null;
2264
2265 if (obc != null) {
2266 query = new StringBundler(4 +
2267 (obc.getOrderByFields().length * 3));
2268 }
2269 else {
2270 query = new StringBundler(4);
2271 }
2272
2273 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2274
2275 query.append(_FINDER_COLUMN_C_S_COMPANYID_2);
2276
2277 query.append(_FINDER_COLUMN_C_S_STATUS_2);
2278
2279 if (obc != null) {
2280 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
2281 }
2282
2283 else {
2284 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2285 }
2286
2287 String sql = query.toString();
2288
2289 Query q = session.createQuery(sql);
2290
2291 QueryPos qPos = QueryPos.getInstance(q);
2292
2293 qPos.add(companyId);
2294
2295 qPos.add(status);
2296
2297 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
2298 blogsEntry);
2299
2300 BlogsEntry[] array = new BlogsEntryImpl[3];
2301
2302 array[0] = (BlogsEntry)objArray[0];
2303 array[1] = (BlogsEntry)objArray[1];
2304 array[2] = (BlogsEntry)objArray[2];
2305
2306 return array;
2307 }
2308 catch (Exception e) {
2309 throw processException(e);
2310 }
2311 finally {
2312 closeSession(session);
2313 }
2314 }
2315
2316 public BlogsEntry findByG_UT(long groupId, String urlTitle)
2317 throws NoSuchEntryException, SystemException {
2318 BlogsEntry blogsEntry = fetchByG_UT(groupId, urlTitle);
2319
2320 if (blogsEntry == null) {
2321 StringBundler msg = new StringBundler(6);
2322
2323 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2324
2325 msg.append("groupId=");
2326 msg.append(groupId);
2327
2328 msg.append(", urlTitle=");
2329 msg.append(urlTitle);
2330
2331 msg.append(StringPool.CLOSE_CURLY_BRACE);
2332
2333 if (_log.isWarnEnabled()) {
2334 _log.warn(msg.toString());
2335 }
2336
2337 throw new NoSuchEntryException(msg.toString());
2338 }
2339
2340 return blogsEntry;
2341 }
2342
2343 public BlogsEntry fetchByG_UT(long groupId, String urlTitle)
2344 throws SystemException {
2345 return fetchByG_UT(groupId, urlTitle, true);
2346 }
2347
2348 public BlogsEntry fetchByG_UT(long groupId, String urlTitle,
2349 boolean retrieveFromCache) throws SystemException {
2350 Object[] finderArgs = new Object[] { new Long(groupId), urlTitle };
2351
2352 Object result = null;
2353
2354 if (retrieveFromCache) {
2355 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_G_UT,
2356 finderArgs, this);
2357 }
2358
2359 if (result == null) {
2360 Session session = null;
2361
2362 try {
2363 session = openSession();
2364
2365 StringBundler query = new StringBundler(4);
2366
2367 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2368
2369 query.append(_FINDER_COLUMN_G_UT_GROUPID_2);
2370
2371 if (urlTitle == null) {
2372 query.append(_FINDER_COLUMN_G_UT_URLTITLE_1);
2373 }
2374 else {
2375 if (urlTitle.equals(StringPool.BLANK)) {
2376 query.append(_FINDER_COLUMN_G_UT_URLTITLE_3);
2377 }
2378 else {
2379 query.append(_FINDER_COLUMN_G_UT_URLTITLE_2);
2380 }
2381 }
2382
2383 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2384
2385 String sql = query.toString();
2386
2387 Query q = session.createQuery(sql);
2388
2389 QueryPos qPos = QueryPos.getInstance(q);
2390
2391 qPos.add(groupId);
2392
2393 if (urlTitle != null) {
2394 qPos.add(urlTitle);
2395 }
2396
2397 List<BlogsEntry> list = q.list();
2398
2399 result = list;
2400
2401 BlogsEntry blogsEntry = null;
2402
2403 if (list.isEmpty()) {
2404 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_UT,
2405 finderArgs, list);
2406 }
2407 else {
2408 blogsEntry = list.get(0);
2409
2410 cacheResult(blogsEntry);
2411
2412 if ((blogsEntry.getGroupId() != groupId) ||
2413 (blogsEntry.getUrlTitle() == null) ||
2414 !blogsEntry.getUrlTitle().equals(urlTitle)) {
2415 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_UT,
2416 finderArgs, blogsEntry);
2417 }
2418 }
2419
2420 return blogsEntry;
2421 }
2422 catch (Exception e) {
2423 throw processException(e);
2424 }
2425 finally {
2426 if (result == null) {
2427 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_UT,
2428 finderArgs, new ArrayList<BlogsEntry>());
2429 }
2430
2431 closeSession(session);
2432 }
2433 }
2434 else {
2435 if (result instanceof List<?>) {
2436 return null;
2437 }
2438 else {
2439 return (BlogsEntry)result;
2440 }
2441 }
2442 }
2443
2444 public List<BlogsEntry> findByG_D(long groupId, Date displayDate)
2445 throws SystemException {
2446 Object[] finderArgs = new Object[] { new Long(groupId), displayDate };
2447
2448 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_D,
2449 finderArgs, this);
2450
2451 if (list == null) {
2452 Session session = null;
2453
2454 try {
2455 session = openSession();
2456
2457 StringBundler query = new StringBundler(4);
2458
2459 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2460
2461 query.append(_FINDER_COLUMN_G_D_GROUPID_2);
2462
2463 if (displayDate == null) {
2464 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_1);
2465 }
2466 else {
2467 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_2);
2468 }
2469
2470 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2471
2472 String sql = query.toString();
2473
2474 Query q = session.createQuery(sql);
2475
2476 QueryPos qPos = QueryPos.getInstance(q);
2477
2478 qPos.add(groupId);
2479
2480 if (displayDate != null) {
2481 qPos.add(CalendarUtil.getTimestamp(displayDate));
2482 }
2483
2484 list = q.list();
2485 }
2486 catch (Exception e) {
2487 throw processException(e);
2488 }
2489 finally {
2490 if (list == null) {
2491 list = new ArrayList<BlogsEntry>();
2492 }
2493
2494 cacheResult(list);
2495
2496 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_D, finderArgs,
2497 list);
2498
2499 closeSession(session);
2500 }
2501 }
2502
2503 return list;
2504 }
2505
2506 public List<BlogsEntry> findByG_D(long groupId, Date displayDate,
2507 int start, int end) throws SystemException {
2508 return findByG_D(groupId, displayDate, start, end, null);
2509 }
2510
2511 public List<BlogsEntry> findByG_D(long groupId, Date displayDate,
2512 int start, int end, OrderByComparator obc) throws SystemException {
2513 Object[] finderArgs = new Object[] {
2514 new Long(groupId),
2515
2516 displayDate,
2517
2518 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
2519 };
2520
2521 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_D,
2522 finderArgs, this);
2523
2524 if (list == null) {
2525 Session session = null;
2526
2527 try {
2528 session = openSession();
2529
2530 StringBundler query = null;
2531
2532 if (obc != null) {
2533 query = new StringBundler(4 +
2534 (obc.getOrderByFields().length * 3));
2535 }
2536 else {
2537 query = new StringBundler(4);
2538 }
2539
2540 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2541
2542 query.append(_FINDER_COLUMN_G_D_GROUPID_2);
2543
2544 if (displayDate == null) {
2545 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_1);
2546 }
2547 else {
2548 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_2);
2549 }
2550
2551 if (obc != null) {
2552 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
2553 }
2554
2555 else {
2556 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2557 }
2558
2559 String sql = query.toString();
2560
2561 Query q = session.createQuery(sql);
2562
2563 QueryPos qPos = QueryPos.getInstance(q);
2564
2565 qPos.add(groupId);
2566
2567 if (displayDate != null) {
2568 qPos.add(CalendarUtil.getTimestamp(displayDate));
2569 }
2570
2571 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
2572 end);
2573 }
2574 catch (Exception e) {
2575 throw processException(e);
2576 }
2577 finally {
2578 if (list == null) {
2579 list = new ArrayList<BlogsEntry>();
2580 }
2581
2582 cacheResult(list);
2583
2584 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_D,
2585 finderArgs, list);
2586
2587 closeSession(session);
2588 }
2589 }
2590
2591 return list;
2592 }
2593
2594 public BlogsEntry findByG_D_First(long groupId, Date displayDate,
2595 OrderByComparator obc) throws NoSuchEntryException, SystemException {
2596 List<BlogsEntry> list = findByG_D(groupId, displayDate, 0, 1, obc);
2597
2598 if (list.isEmpty()) {
2599 StringBundler msg = new StringBundler(6);
2600
2601 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2602
2603 msg.append("groupId=");
2604 msg.append(groupId);
2605
2606 msg.append(", displayDate=");
2607 msg.append(displayDate);
2608
2609 msg.append(StringPool.CLOSE_CURLY_BRACE);
2610
2611 throw new NoSuchEntryException(msg.toString());
2612 }
2613 else {
2614 return list.get(0);
2615 }
2616 }
2617
2618 public BlogsEntry findByG_D_Last(long groupId, Date displayDate,
2619 OrderByComparator obc) throws NoSuchEntryException, SystemException {
2620 int count = countByG_D(groupId, displayDate);
2621
2622 List<BlogsEntry> list = findByG_D(groupId, displayDate, count - 1,
2623 count, obc);
2624
2625 if (list.isEmpty()) {
2626 StringBundler msg = new StringBundler(6);
2627
2628 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2629
2630 msg.append("groupId=");
2631 msg.append(groupId);
2632
2633 msg.append(", displayDate=");
2634 msg.append(displayDate);
2635
2636 msg.append(StringPool.CLOSE_CURLY_BRACE);
2637
2638 throw new NoSuchEntryException(msg.toString());
2639 }
2640 else {
2641 return list.get(0);
2642 }
2643 }
2644
2645 public BlogsEntry[] findByG_D_PrevAndNext(long entryId, long groupId,
2646 Date displayDate, OrderByComparator obc)
2647 throws NoSuchEntryException, SystemException {
2648 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
2649
2650 int count = countByG_D(groupId, displayDate);
2651
2652 Session session = null;
2653
2654 try {
2655 session = openSession();
2656
2657 StringBundler query = null;
2658
2659 if (obc != null) {
2660 query = new StringBundler(4 +
2661 (obc.getOrderByFields().length * 3));
2662 }
2663 else {
2664 query = new StringBundler(4);
2665 }
2666
2667 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2668
2669 query.append(_FINDER_COLUMN_G_D_GROUPID_2);
2670
2671 if (displayDate == null) {
2672 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_1);
2673 }
2674 else {
2675 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_2);
2676 }
2677
2678 if (obc != null) {
2679 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
2680 }
2681
2682 else {
2683 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2684 }
2685
2686 String sql = query.toString();
2687
2688 Query q = session.createQuery(sql);
2689
2690 QueryPos qPos = QueryPos.getInstance(q);
2691
2692 qPos.add(groupId);
2693
2694 if (displayDate != null) {
2695 qPos.add(CalendarUtil.getTimestamp(displayDate));
2696 }
2697
2698 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
2699 blogsEntry);
2700
2701 BlogsEntry[] array = new BlogsEntryImpl[3];
2702
2703 array[0] = (BlogsEntry)objArray[0];
2704 array[1] = (BlogsEntry)objArray[1];
2705 array[2] = (BlogsEntry)objArray[2];
2706
2707 return array;
2708 }
2709 catch (Exception e) {
2710 throw processException(e);
2711 }
2712 finally {
2713 closeSession(session);
2714 }
2715 }
2716
2717 public List<BlogsEntry> findByG_S(long groupId, int status)
2718 throws SystemException {
2719 Object[] finderArgs = new Object[] {
2720 new Long(groupId), new Integer(status)
2721 };
2722
2723 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_S,
2724 finderArgs, this);
2725
2726 if (list == null) {
2727 Session session = null;
2728
2729 try {
2730 session = openSession();
2731
2732 StringBundler query = new StringBundler(4);
2733
2734 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2735
2736 query.append(_FINDER_COLUMN_G_S_GROUPID_2);
2737
2738 query.append(_FINDER_COLUMN_G_S_STATUS_2);
2739
2740 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2741
2742 String sql = query.toString();
2743
2744 Query q = session.createQuery(sql);
2745
2746 QueryPos qPos = QueryPos.getInstance(q);
2747
2748 qPos.add(groupId);
2749
2750 qPos.add(status);
2751
2752 list = q.list();
2753 }
2754 catch (Exception e) {
2755 throw processException(e);
2756 }
2757 finally {
2758 if (list == null) {
2759 list = new ArrayList<BlogsEntry>();
2760 }
2761
2762 cacheResult(list);
2763
2764 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_S, finderArgs,
2765 list);
2766
2767 closeSession(session);
2768 }
2769 }
2770
2771 return list;
2772 }
2773
2774 public List<BlogsEntry> findByG_S(long groupId, int status, int start,
2775 int end) throws SystemException {
2776 return findByG_S(groupId, status, start, end, null);
2777 }
2778
2779 public List<BlogsEntry> findByG_S(long groupId, int status, int start,
2780 int end, OrderByComparator obc) throws SystemException {
2781 Object[] finderArgs = new Object[] {
2782 new Long(groupId), new Integer(status),
2783
2784 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
2785 };
2786
2787 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_S,
2788 finderArgs, this);
2789
2790 if (list == null) {
2791 Session session = null;
2792
2793 try {
2794 session = openSession();
2795
2796 StringBundler query = null;
2797
2798 if (obc != null) {
2799 query = new StringBundler(4 +
2800 (obc.getOrderByFields().length * 3));
2801 }
2802 else {
2803 query = new StringBundler(4);
2804 }
2805
2806 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2807
2808 query.append(_FINDER_COLUMN_G_S_GROUPID_2);
2809
2810 query.append(_FINDER_COLUMN_G_S_STATUS_2);
2811
2812 if (obc != null) {
2813 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
2814 }
2815
2816 else {
2817 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2818 }
2819
2820 String sql = query.toString();
2821
2822 Query q = session.createQuery(sql);
2823
2824 QueryPos qPos = QueryPos.getInstance(q);
2825
2826 qPos.add(groupId);
2827
2828 qPos.add(status);
2829
2830 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
2831 end);
2832 }
2833 catch (Exception e) {
2834 throw processException(e);
2835 }
2836 finally {
2837 if (list == null) {
2838 list = new ArrayList<BlogsEntry>();
2839 }
2840
2841 cacheResult(list);
2842
2843 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_S,
2844 finderArgs, list);
2845
2846 closeSession(session);
2847 }
2848 }
2849
2850 return list;
2851 }
2852
2853 public BlogsEntry findByG_S_First(long groupId, int status,
2854 OrderByComparator obc) throws NoSuchEntryException, SystemException {
2855 List<BlogsEntry> list = findByG_S(groupId, status, 0, 1, obc);
2856
2857 if (list.isEmpty()) {
2858 StringBundler msg = new StringBundler(6);
2859
2860 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2861
2862 msg.append("groupId=");
2863 msg.append(groupId);
2864
2865 msg.append(", status=");
2866 msg.append(status);
2867
2868 msg.append(StringPool.CLOSE_CURLY_BRACE);
2869
2870 throw new NoSuchEntryException(msg.toString());
2871 }
2872 else {
2873 return list.get(0);
2874 }
2875 }
2876
2877 public BlogsEntry findByG_S_Last(long groupId, int status,
2878 OrderByComparator obc) throws NoSuchEntryException, SystemException {
2879 int count = countByG_S(groupId, status);
2880
2881 List<BlogsEntry> list = findByG_S(groupId, status, count - 1, count, obc);
2882
2883 if (list.isEmpty()) {
2884 StringBundler msg = new StringBundler(6);
2885
2886 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
2887
2888 msg.append("groupId=");
2889 msg.append(groupId);
2890
2891 msg.append(", status=");
2892 msg.append(status);
2893
2894 msg.append(StringPool.CLOSE_CURLY_BRACE);
2895
2896 throw new NoSuchEntryException(msg.toString());
2897 }
2898 else {
2899 return list.get(0);
2900 }
2901 }
2902
2903 public BlogsEntry[] findByG_S_PrevAndNext(long entryId, long groupId,
2904 int status, OrderByComparator obc)
2905 throws NoSuchEntryException, SystemException {
2906 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
2907
2908 int count = countByG_S(groupId, status);
2909
2910 Session session = null;
2911
2912 try {
2913 session = openSession();
2914
2915 StringBundler query = null;
2916
2917 if (obc != null) {
2918 query = new StringBundler(4 +
2919 (obc.getOrderByFields().length * 3));
2920 }
2921 else {
2922 query = new StringBundler(4);
2923 }
2924
2925 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2926
2927 query.append(_FINDER_COLUMN_G_S_GROUPID_2);
2928
2929 query.append(_FINDER_COLUMN_G_S_STATUS_2);
2930
2931 if (obc != null) {
2932 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
2933 }
2934
2935 else {
2936 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2937 }
2938
2939 String sql = query.toString();
2940
2941 Query q = session.createQuery(sql);
2942
2943 QueryPos qPos = QueryPos.getInstance(q);
2944
2945 qPos.add(groupId);
2946
2947 qPos.add(status);
2948
2949 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
2950 blogsEntry);
2951
2952 BlogsEntry[] array = new BlogsEntryImpl[3];
2953
2954 array[0] = (BlogsEntry)objArray[0];
2955 array[1] = (BlogsEntry)objArray[1];
2956 array[2] = (BlogsEntry)objArray[2];
2957
2958 return array;
2959 }
2960 catch (Exception e) {
2961 throw processException(e);
2962 }
2963 finally {
2964 closeSession(session);
2965 }
2966 }
2967
2968 public List<BlogsEntry> findByC_U_S(long companyId, long userId, int status)
2969 throws SystemException {
2970 Object[] finderArgs = new Object[] {
2971 new Long(companyId), new Long(userId), new Integer(status)
2972 };
2973
2974 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_U_S,
2975 finderArgs, this);
2976
2977 if (list == null) {
2978 Session session = null;
2979
2980 try {
2981 session = openSession();
2982
2983 StringBundler query = new StringBundler(5);
2984
2985 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
2986
2987 query.append(_FINDER_COLUMN_C_U_S_COMPANYID_2);
2988
2989 query.append(_FINDER_COLUMN_C_U_S_USERID_2);
2990
2991 query.append(_FINDER_COLUMN_C_U_S_STATUS_2);
2992
2993 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
2994
2995 String sql = query.toString();
2996
2997 Query q = session.createQuery(sql);
2998
2999 QueryPos qPos = QueryPos.getInstance(q);
3000
3001 qPos.add(companyId);
3002
3003 qPos.add(userId);
3004
3005 qPos.add(status);
3006
3007 list = q.list();
3008 }
3009 catch (Exception e) {
3010 throw processException(e);
3011 }
3012 finally {
3013 if (list == null) {
3014 list = new ArrayList<BlogsEntry>();
3015 }
3016
3017 cacheResult(list);
3018
3019 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_U_S,
3020 finderArgs, list);
3021
3022 closeSession(session);
3023 }
3024 }
3025
3026 return list;
3027 }
3028
3029 public List<BlogsEntry> findByC_U_S(long companyId, long userId,
3030 int status, int start, int end) throws SystemException {
3031 return findByC_U_S(companyId, userId, status, start, end, null);
3032 }
3033
3034 public List<BlogsEntry> findByC_U_S(long companyId, long userId,
3035 int status, int start, int end, OrderByComparator obc)
3036 throws SystemException {
3037 Object[] finderArgs = new Object[] {
3038 new Long(companyId), new Long(userId), new Integer(status),
3039
3040 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
3041 };
3042
3043 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_U_S,
3044 finderArgs, this);
3045
3046 if (list == null) {
3047 Session session = null;
3048
3049 try {
3050 session = openSession();
3051
3052 StringBundler query = null;
3053
3054 if (obc != null) {
3055 query = new StringBundler(5 +
3056 (obc.getOrderByFields().length * 3));
3057 }
3058 else {
3059 query = new StringBundler(5);
3060 }
3061
3062 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3063
3064 query.append(_FINDER_COLUMN_C_U_S_COMPANYID_2);
3065
3066 query.append(_FINDER_COLUMN_C_U_S_USERID_2);
3067
3068 query.append(_FINDER_COLUMN_C_U_S_STATUS_2);
3069
3070 if (obc != null) {
3071 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
3072 }
3073
3074 else {
3075 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3076 }
3077
3078 String sql = query.toString();
3079
3080 Query q = session.createQuery(sql);
3081
3082 QueryPos qPos = QueryPos.getInstance(q);
3083
3084 qPos.add(companyId);
3085
3086 qPos.add(userId);
3087
3088 qPos.add(status);
3089
3090 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
3091 end);
3092 }
3093 catch (Exception e) {
3094 throw processException(e);
3095 }
3096 finally {
3097 if (list == null) {
3098 list = new ArrayList<BlogsEntry>();
3099 }
3100
3101 cacheResult(list);
3102
3103 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_U_S,
3104 finderArgs, list);
3105
3106 closeSession(session);
3107 }
3108 }
3109
3110 return list;
3111 }
3112
3113 public BlogsEntry findByC_U_S_First(long companyId, long userId,
3114 int status, OrderByComparator obc)
3115 throws NoSuchEntryException, SystemException {
3116 List<BlogsEntry> list = findByC_U_S(companyId, userId, status, 0, 1, obc);
3117
3118 if (list.isEmpty()) {
3119 StringBundler msg = new StringBundler(8);
3120
3121 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3122
3123 msg.append("companyId=");
3124 msg.append(companyId);
3125
3126 msg.append(", userId=");
3127 msg.append(userId);
3128
3129 msg.append(", status=");
3130 msg.append(status);
3131
3132 msg.append(StringPool.CLOSE_CURLY_BRACE);
3133
3134 throw new NoSuchEntryException(msg.toString());
3135 }
3136 else {
3137 return list.get(0);
3138 }
3139 }
3140
3141 public BlogsEntry findByC_U_S_Last(long companyId, long userId, int status,
3142 OrderByComparator obc) throws NoSuchEntryException, SystemException {
3143 int count = countByC_U_S(companyId, userId, status);
3144
3145 List<BlogsEntry> list = findByC_U_S(companyId, userId, status,
3146 count - 1, count, obc);
3147
3148 if (list.isEmpty()) {
3149 StringBundler msg = new StringBundler(8);
3150
3151 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3152
3153 msg.append("companyId=");
3154 msg.append(companyId);
3155
3156 msg.append(", userId=");
3157 msg.append(userId);
3158
3159 msg.append(", status=");
3160 msg.append(status);
3161
3162 msg.append(StringPool.CLOSE_CURLY_BRACE);
3163
3164 throw new NoSuchEntryException(msg.toString());
3165 }
3166 else {
3167 return list.get(0);
3168 }
3169 }
3170
3171 public BlogsEntry[] findByC_U_S_PrevAndNext(long entryId, long companyId,
3172 long userId, int status, OrderByComparator obc)
3173 throws NoSuchEntryException, SystemException {
3174 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
3175
3176 int count = countByC_U_S(companyId, userId, status);
3177
3178 Session session = null;
3179
3180 try {
3181 session = openSession();
3182
3183 StringBundler query = null;
3184
3185 if (obc != null) {
3186 query = new StringBundler(5 +
3187 (obc.getOrderByFields().length * 3));
3188 }
3189 else {
3190 query = new StringBundler(5);
3191 }
3192
3193 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3194
3195 query.append(_FINDER_COLUMN_C_U_S_COMPANYID_2);
3196
3197 query.append(_FINDER_COLUMN_C_U_S_USERID_2);
3198
3199 query.append(_FINDER_COLUMN_C_U_S_STATUS_2);
3200
3201 if (obc != null) {
3202 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
3203 }
3204
3205 else {
3206 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3207 }
3208
3209 String sql = query.toString();
3210
3211 Query q = session.createQuery(sql);
3212
3213 QueryPos qPos = QueryPos.getInstance(q);
3214
3215 qPos.add(companyId);
3216
3217 qPos.add(userId);
3218
3219 qPos.add(status);
3220
3221 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
3222 blogsEntry);
3223
3224 BlogsEntry[] array = new BlogsEntryImpl[3];
3225
3226 array[0] = (BlogsEntry)objArray[0];
3227 array[1] = (BlogsEntry)objArray[1];
3228 array[2] = (BlogsEntry)objArray[2];
3229
3230 return array;
3231 }
3232 catch (Exception e) {
3233 throw processException(e);
3234 }
3235 finally {
3236 closeSession(session);
3237 }
3238 }
3239
3240 public List<BlogsEntry> findByC_D_S(long companyId, Date displayDate,
3241 int status) throws SystemException {
3242 Object[] finderArgs = new Object[] {
3243 new Long(companyId),
3244
3245 displayDate, new Integer(status)
3246 };
3247
3248 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_D_S,
3249 finderArgs, this);
3250
3251 if (list == null) {
3252 Session session = null;
3253
3254 try {
3255 session = openSession();
3256
3257 StringBundler query = new StringBundler(5);
3258
3259 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3260
3261 query.append(_FINDER_COLUMN_C_D_S_COMPANYID_2);
3262
3263 if (displayDate == null) {
3264 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_1);
3265 }
3266 else {
3267 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_2);
3268 }
3269
3270 query.append(_FINDER_COLUMN_C_D_S_STATUS_2);
3271
3272 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3273
3274 String sql = query.toString();
3275
3276 Query q = session.createQuery(sql);
3277
3278 QueryPos qPos = QueryPos.getInstance(q);
3279
3280 qPos.add(companyId);
3281
3282 if (displayDate != null) {
3283 qPos.add(CalendarUtil.getTimestamp(displayDate));
3284 }
3285
3286 qPos.add(status);
3287
3288 list = q.list();
3289 }
3290 catch (Exception e) {
3291 throw processException(e);
3292 }
3293 finally {
3294 if (list == null) {
3295 list = new ArrayList<BlogsEntry>();
3296 }
3297
3298 cacheResult(list);
3299
3300 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_D_S,
3301 finderArgs, list);
3302
3303 closeSession(session);
3304 }
3305 }
3306
3307 return list;
3308 }
3309
3310 public List<BlogsEntry> findByC_D_S(long companyId, Date displayDate,
3311 int status, int start, int end) throws SystemException {
3312 return findByC_D_S(companyId, displayDate, status, start, end, null);
3313 }
3314
3315 public List<BlogsEntry> findByC_D_S(long companyId, Date displayDate,
3316 int status, int start, int end, OrderByComparator obc)
3317 throws SystemException {
3318 Object[] finderArgs = new Object[] {
3319 new Long(companyId),
3320
3321 displayDate, new Integer(status),
3322
3323 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
3324 };
3325
3326 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_C_D_S,
3327 finderArgs, this);
3328
3329 if (list == null) {
3330 Session session = null;
3331
3332 try {
3333 session = openSession();
3334
3335 StringBundler query = null;
3336
3337 if (obc != null) {
3338 query = new StringBundler(5 +
3339 (obc.getOrderByFields().length * 3));
3340 }
3341 else {
3342 query = new StringBundler(5);
3343 }
3344
3345 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3346
3347 query.append(_FINDER_COLUMN_C_D_S_COMPANYID_2);
3348
3349 if (displayDate == null) {
3350 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_1);
3351 }
3352 else {
3353 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_2);
3354 }
3355
3356 query.append(_FINDER_COLUMN_C_D_S_STATUS_2);
3357
3358 if (obc != null) {
3359 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
3360 }
3361
3362 else {
3363 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3364 }
3365
3366 String sql = query.toString();
3367
3368 Query q = session.createQuery(sql);
3369
3370 QueryPos qPos = QueryPos.getInstance(q);
3371
3372 qPos.add(companyId);
3373
3374 if (displayDate != null) {
3375 qPos.add(CalendarUtil.getTimestamp(displayDate));
3376 }
3377
3378 qPos.add(status);
3379
3380 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
3381 end);
3382 }
3383 catch (Exception e) {
3384 throw processException(e);
3385 }
3386 finally {
3387 if (list == null) {
3388 list = new ArrayList<BlogsEntry>();
3389 }
3390
3391 cacheResult(list);
3392
3393 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_C_D_S,
3394 finderArgs, list);
3395
3396 closeSession(session);
3397 }
3398 }
3399
3400 return list;
3401 }
3402
3403 public BlogsEntry findByC_D_S_First(long companyId, Date displayDate,
3404 int status, OrderByComparator obc)
3405 throws NoSuchEntryException, SystemException {
3406 List<BlogsEntry> list = findByC_D_S(companyId, displayDate, status, 0,
3407 1, obc);
3408
3409 if (list.isEmpty()) {
3410 StringBundler msg = new StringBundler(8);
3411
3412 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3413
3414 msg.append("companyId=");
3415 msg.append(companyId);
3416
3417 msg.append(", displayDate=");
3418 msg.append(displayDate);
3419
3420 msg.append(", status=");
3421 msg.append(status);
3422
3423 msg.append(StringPool.CLOSE_CURLY_BRACE);
3424
3425 throw new NoSuchEntryException(msg.toString());
3426 }
3427 else {
3428 return list.get(0);
3429 }
3430 }
3431
3432 public BlogsEntry findByC_D_S_Last(long companyId, Date displayDate,
3433 int status, OrderByComparator obc)
3434 throws NoSuchEntryException, SystemException {
3435 int count = countByC_D_S(companyId, displayDate, status);
3436
3437 List<BlogsEntry> list = findByC_D_S(companyId, displayDate, status,
3438 count - 1, count, obc);
3439
3440 if (list.isEmpty()) {
3441 StringBundler msg = new StringBundler(8);
3442
3443 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3444
3445 msg.append("companyId=");
3446 msg.append(companyId);
3447
3448 msg.append(", displayDate=");
3449 msg.append(displayDate);
3450
3451 msg.append(", status=");
3452 msg.append(status);
3453
3454 msg.append(StringPool.CLOSE_CURLY_BRACE);
3455
3456 throw new NoSuchEntryException(msg.toString());
3457 }
3458 else {
3459 return list.get(0);
3460 }
3461 }
3462
3463 public BlogsEntry[] findByC_D_S_PrevAndNext(long entryId, long companyId,
3464 Date displayDate, int status, OrderByComparator obc)
3465 throws NoSuchEntryException, SystemException {
3466 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
3467
3468 int count = countByC_D_S(companyId, displayDate, status);
3469
3470 Session session = null;
3471
3472 try {
3473 session = openSession();
3474
3475 StringBundler query = null;
3476
3477 if (obc != null) {
3478 query = new StringBundler(5 +
3479 (obc.getOrderByFields().length * 3));
3480 }
3481 else {
3482 query = new StringBundler(5);
3483 }
3484
3485 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3486
3487 query.append(_FINDER_COLUMN_C_D_S_COMPANYID_2);
3488
3489 if (displayDate == null) {
3490 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_1);
3491 }
3492 else {
3493 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_2);
3494 }
3495
3496 query.append(_FINDER_COLUMN_C_D_S_STATUS_2);
3497
3498 if (obc != null) {
3499 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
3500 }
3501
3502 else {
3503 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3504 }
3505
3506 String sql = query.toString();
3507
3508 Query q = session.createQuery(sql);
3509
3510 QueryPos qPos = QueryPos.getInstance(q);
3511
3512 qPos.add(companyId);
3513
3514 if (displayDate != null) {
3515 qPos.add(CalendarUtil.getTimestamp(displayDate));
3516 }
3517
3518 qPos.add(status);
3519
3520 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
3521 blogsEntry);
3522
3523 BlogsEntry[] array = new BlogsEntryImpl[3];
3524
3525 array[0] = (BlogsEntry)objArray[0];
3526 array[1] = (BlogsEntry)objArray[1];
3527 array[2] = (BlogsEntry)objArray[2];
3528
3529 return array;
3530 }
3531 catch (Exception e) {
3532 throw processException(e);
3533 }
3534 finally {
3535 closeSession(session);
3536 }
3537 }
3538
3539 public List<BlogsEntry> findByG_U_D(long groupId, long userId,
3540 Date displayDate) throws SystemException {
3541 Object[] finderArgs = new Object[] {
3542 new Long(groupId), new Long(userId),
3543
3544 displayDate
3545 };
3546
3547 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_U_D,
3548 finderArgs, this);
3549
3550 if (list == null) {
3551 Session session = null;
3552
3553 try {
3554 session = openSession();
3555
3556 StringBundler query = new StringBundler(5);
3557
3558 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3559
3560 query.append(_FINDER_COLUMN_G_U_D_GROUPID_2);
3561
3562 query.append(_FINDER_COLUMN_G_U_D_USERID_2);
3563
3564 if (displayDate == null) {
3565 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_1);
3566 }
3567 else {
3568 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_2);
3569 }
3570
3571 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3572
3573 String sql = query.toString();
3574
3575 Query q = session.createQuery(sql);
3576
3577 QueryPos qPos = QueryPos.getInstance(q);
3578
3579 qPos.add(groupId);
3580
3581 qPos.add(userId);
3582
3583 if (displayDate != null) {
3584 qPos.add(CalendarUtil.getTimestamp(displayDate));
3585 }
3586
3587 list = q.list();
3588 }
3589 catch (Exception e) {
3590 throw processException(e);
3591 }
3592 finally {
3593 if (list == null) {
3594 list = new ArrayList<BlogsEntry>();
3595 }
3596
3597 cacheResult(list);
3598
3599 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_U_D,
3600 finderArgs, list);
3601
3602 closeSession(session);
3603 }
3604 }
3605
3606 return list;
3607 }
3608
3609 public List<BlogsEntry> findByG_U_D(long groupId, long userId,
3610 Date displayDate, int start, int end) throws SystemException {
3611 return findByG_U_D(groupId, userId, displayDate, start, end, null);
3612 }
3613
3614 public List<BlogsEntry> findByG_U_D(long groupId, long userId,
3615 Date displayDate, int start, int end, OrderByComparator obc)
3616 throws SystemException {
3617 Object[] finderArgs = new Object[] {
3618 new Long(groupId), new Long(userId),
3619
3620 displayDate,
3621
3622 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
3623 };
3624
3625 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_U_D,
3626 finderArgs, this);
3627
3628 if (list == null) {
3629 Session session = null;
3630
3631 try {
3632 session = openSession();
3633
3634 StringBundler query = null;
3635
3636 if (obc != null) {
3637 query = new StringBundler(5 +
3638 (obc.getOrderByFields().length * 3));
3639 }
3640 else {
3641 query = new StringBundler(5);
3642 }
3643
3644 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3645
3646 query.append(_FINDER_COLUMN_G_U_D_GROUPID_2);
3647
3648 query.append(_FINDER_COLUMN_G_U_D_USERID_2);
3649
3650 if (displayDate == null) {
3651 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_1);
3652 }
3653 else {
3654 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_2);
3655 }
3656
3657 if (obc != null) {
3658 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
3659 }
3660
3661 else {
3662 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3663 }
3664
3665 String sql = query.toString();
3666
3667 Query q = session.createQuery(sql);
3668
3669 QueryPos qPos = QueryPos.getInstance(q);
3670
3671 qPos.add(groupId);
3672
3673 qPos.add(userId);
3674
3675 if (displayDate != null) {
3676 qPos.add(CalendarUtil.getTimestamp(displayDate));
3677 }
3678
3679 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
3680 end);
3681 }
3682 catch (Exception e) {
3683 throw processException(e);
3684 }
3685 finally {
3686 if (list == null) {
3687 list = new ArrayList<BlogsEntry>();
3688 }
3689
3690 cacheResult(list);
3691
3692 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_U_D,
3693 finderArgs, list);
3694
3695 closeSession(session);
3696 }
3697 }
3698
3699 return list;
3700 }
3701
3702 public BlogsEntry findByG_U_D_First(long groupId, long userId,
3703 Date displayDate, OrderByComparator obc)
3704 throws NoSuchEntryException, SystemException {
3705 List<BlogsEntry> list = findByG_U_D(groupId, userId, displayDate, 0, 1,
3706 obc);
3707
3708 if (list.isEmpty()) {
3709 StringBundler msg = new StringBundler(8);
3710
3711 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3712
3713 msg.append("groupId=");
3714 msg.append(groupId);
3715
3716 msg.append(", userId=");
3717 msg.append(userId);
3718
3719 msg.append(", displayDate=");
3720 msg.append(displayDate);
3721
3722 msg.append(StringPool.CLOSE_CURLY_BRACE);
3723
3724 throw new NoSuchEntryException(msg.toString());
3725 }
3726 else {
3727 return list.get(0);
3728 }
3729 }
3730
3731 public BlogsEntry findByG_U_D_Last(long groupId, long userId,
3732 Date displayDate, OrderByComparator obc)
3733 throws NoSuchEntryException, SystemException {
3734 int count = countByG_U_D(groupId, userId, displayDate);
3735
3736 List<BlogsEntry> list = findByG_U_D(groupId, userId, displayDate,
3737 count - 1, count, obc);
3738
3739 if (list.isEmpty()) {
3740 StringBundler msg = new StringBundler(8);
3741
3742 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3743
3744 msg.append("groupId=");
3745 msg.append(groupId);
3746
3747 msg.append(", userId=");
3748 msg.append(userId);
3749
3750 msg.append(", displayDate=");
3751 msg.append(displayDate);
3752
3753 msg.append(StringPool.CLOSE_CURLY_BRACE);
3754
3755 throw new NoSuchEntryException(msg.toString());
3756 }
3757 else {
3758 return list.get(0);
3759 }
3760 }
3761
3762 public BlogsEntry[] findByG_U_D_PrevAndNext(long entryId, long groupId,
3763 long userId, Date displayDate, OrderByComparator obc)
3764 throws NoSuchEntryException, SystemException {
3765 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
3766
3767 int count = countByG_U_D(groupId, userId, displayDate);
3768
3769 Session session = null;
3770
3771 try {
3772 session = openSession();
3773
3774 StringBundler query = null;
3775
3776 if (obc != null) {
3777 query = new StringBundler(5 +
3778 (obc.getOrderByFields().length * 3));
3779 }
3780 else {
3781 query = new StringBundler(5);
3782 }
3783
3784 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3785
3786 query.append(_FINDER_COLUMN_G_U_D_GROUPID_2);
3787
3788 query.append(_FINDER_COLUMN_G_U_D_USERID_2);
3789
3790 if (displayDate == null) {
3791 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_1);
3792 }
3793 else {
3794 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_2);
3795 }
3796
3797 if (obc != null) {
3798 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
3799 }
3800
3801 else {
3802 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3803 }
3804
3805 String sql = query.toString();
3806
3807 Query q = session.createQuery(sql);
3808
3809 QueryPos qPos = QueryPos.getInstance(q);
3810
3811 qPos.add(groupId);
3812
3813 qPos.add(userId);
3814
3815 if (displayDate != null) {
3816 qPos.add(CalendarUtil.getTimestamp(displayDate));
3817 }
3818
3819 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
3820 blogsEntry);
3821
3822 BlogsEntry[] array = new BlogsEntryImpl[3];
3823
3824 array[0] = (BlogsEntry)objArray[0];
3825 array[1] = (BlogsEntry)objArray[1];
3826 array[2] = (BlogsEntry)objArray[2];
3827
3828 return array;
3829 }
3830 catch (Exception e) {
3831 throw processException(e);
3832 }
3833 finally {
3834 closeSession(session);
3835 }
3836 }
3837
3838 public List<BlogsEntry> findByG_U_S(long groupId, long userId, int status)
3839 throws SystemException {
3840 Object[] finderArgs = new Object[] {
3841 new Long(groupId), new Long(userId), new Integer(status)
3842 };
3843
3844 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_U_S,
3845 finderArgs, this);
3846
3847 if (list == null) {
3848 Session session = null;
3849
3850 try {
3851 session = openSession();
3852
3853 StringBundler query = new StringBundler(5);
3854
3855 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3856
3857 query.append(_FINDER_COLUMN_G_U_S_GROUPID_2);
3858
3859 query.append(_FINDER_COLUMN_G_U_S_USERID_2);
3860
3861 query.append(_FINDER_COLUMN_G_U_S_STATUS_2);
3862
3863 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3864
3865 String sql = query.toString();
3866
3867 Query q = session.createQuery(sql);
3868
3869 QueryPos qPos = QueryPos.getInstance(q);
3870
3871 qPos.add(groupId);
3872
3873 qPos.add(userId);
3874
3875 qPos.add(status);
3876
3877 list = q.list();
3878 }
3879 catch (Exception e) {
3880 throw processException(e);
3881 }
3882 finally {
3883 if (list == null) {
3884 list = new ArrayList<BlogsEntry>();
3885 }
3886
3887 cacheResult(list);
3888
3889 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_U_S,
3890 finderArgs, list);
3891
3892 closeSession(session);
3893 }
3894 }
3895
3896 return list;
3897 }
3898
3899 public List<BlogsEntry> findByG_U_S(long groupId, long userId, int status,
3900 int start, int end) throws SystemException {
3901 return findByG_U_S(groupId, userId, status, start, end, null);
3902 }
3903
3904 public List<BlogsEntry> findByG_U_S(long groupId, long userId, int status,
3905 int start, int end, OrderByComparator obc) throws SystemException {
3906 Object[] finderArgs = new Object[] {
3907 new Long(groupId), new Long(userId), new Integer(status),
3908
3909 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
3910 };
3911
3912 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_U_S,
3913 finderArgs, this);
3914
3915 if (list == null) {
3916 Session session = null;
3917
3918 try {
3919 session = openSession();
3920
3921 StringBundler query = null;
3922
3923 if (obc != null) {
3924 query = new StringBundler(5 +
3925 (obc.getOrderByFields().length * 3));
3926 }
3927 else {
3928 query = new StringBundler(5);
3929 }
3930
3931 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
3932
3933 query.append(_FINDER_COLUMN_G_U_S_GROUPID_2);
3934
3935 query.append(_FINDER_COLUMN_G_U_S_USERID_2);
3936
3937 query.append(_FINDER_COLUMN_G_U_S_STATUS_2);
3938
3939 if (obc != null) {
3940 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
3941 }
3942
3943 else {
3944 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
3945 }
3946
3947 String sql = query.toString();
3948
3949 Query q = session.createQuery(sql);
3950
3951 QueryPos qPos = QueryPos.getInstance(q);
3952
3953 qPos.add(groupId);
3954
3955 qPos.add(userId);
3956
3957 qPos.add(status);
3958
3959 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
3960 end);
3961 }
3962 catch (Exception e) {
3963 throw processException(e);
3964 }
3965 finally {
3966 if (list == null) {
3967 list = new ArrayList<BlogsEntry>();
3968 }
3969
3970 cacheResult(list);
3971
3972 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_U_S,
3973 finderArgs, list);
3974
3975 closeSession(session);
3976 }
3977 }
3978
3979 return list;
3980 }
3981
3982 public BlogsEntry findByG_U_S_First(long groupId, long userId, int status,
3983 OrderByComparator obc) throws NoSuchEntryException, SystemException {
3984 List<BlogsEntry> list = findByG_U_S(groupId, userId, status, 0, 1, obc);
3985
3986 if (list.isEmpty()) {
3987 StringBundler msg = new StringBundler(8);
3988
3989 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
3990
3991 msg.append("groupId=");
3992 msg.append(groupId);
3993
3994 msg.append(", userId=");
3995 msg.append(userId);
3996
3997 msg.append(", status=");
3998 msg.append(status);
3999
4000 msg.append(StringPool.CLOSE_CURLY_BRACE);
4001
4002 throw new NoSuchEntryException(msg.toString());
4003 }
4004 else {
4005 return list.get(0);
4006 }
4007 }
4008
4009 public BlogsEntry findByG_U_S_Last(long groupId, long userId, int status,
4010 OrderByComparator obc) throws NoSuchEntryException, SystemException {
4011 int count = countByG_U_S(groupId, userId, status);
4012
4013 List<BlogsEntry> list = findByG_U_S(groupId, userId, status, count - 1,
4014 count, obc);
4015
4016 if (list.isEmpty()) {
4017 StringBundler msg = new StringBundler(8);
4018
4019 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
4020
4021 msg.append("groupId=");
4022 msg.append(groupId);
4023
4024 msg.append(", userId=");
4025 msg.append(userId);
4026
4027 msg.append(", status=");
4028 msg.append(status);
4029
4030 msg.append(StringPool.CLOSE_CURLY_BRACE);
4031
4032 throw new NoSuchEntryException(msg.toString());
4033 }
4034 else {
4035 return list.get(0);
4036 }
4037 }
4038
4039 public BlogsEntry[] findByG_U_S_PrevAndNext(long entryId, long groupId,
4040 long userId, int status, OrderByComparator obc)
4041 throws NoSuchEntryException, SystemException {
4042 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
4043
4044 int count = countByG_U_S(groupId, userId, status);
4045
4046 Session session = null;
4047
4048 try {
4049 session = openSession();
4050
4051 StringBundler query = null;
4052
4053 if (obc != null) {
4054 query = new StringBundler(5 +
4055 (obc.getOrderByFields().length * 3));
4056 }
4057 else {
4058 query = new StringBundler(5);
4059 }
4060
4061 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
4062
4063 query.append(_FINDER_COLUMN_G_U_S_GROUPID_2);
4064
4065 query.append(_FINDER_COLUMN_G_U_S_USERID_2);
4066
4067 query.append(_FINDER_COLUMN_G_U_S_STATUS_2);
4068
4069 if (obc != null) {
4070 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
4071 }
4072
4073 else {
4074 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
4075 }
4076
4077 String sql = query.toString();
4078
4079 Query q = session.createQuery(sql);
4080
4081 QueryPos qPos = QueryPos.getInstance(q);
4082
4083 qPos.add(groupId);
4084
4085 qPos.add(userId);
4086
4087 qPos.add(status);
4088
4089 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
4090 blogsEntry);
4091
4092 BlogsEntry[] array = new BlogsEntryImpl[3];
4093
4094 array[0] = (BlogsEntry)objArray[0];
4095 array[1] = (BlogsEntry)objArray[1];
4096 array[2] = (BlogsEntry)objArray[2];
4097
4098 return array;
4099 }
4100 catch (Exception e) {
4101 throw processException(e);
4102 }
4103 finally {
4104 closeSession(session);
4105 }
4106 }
4107
4108 public List<BlogsEntry> findByG_D_S(long groupId, Date displayDate,
4109 int status) throws SystemException {
4110 Object[] finderArgs = new Object[] {
4111 new Long(groupId),
4112
4113 displayDate, new Integer(status)
4114 };
4115
4116 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_D_S,
4117 finderArgs, this);
4118
4119 if (list == null) {
4120 Session session = null;
4121
4122 try {
4123 session = openSession();
4124
4125 StringBundler query = new StringBundler(5);
4126
4127 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
4128
4129 query.append(_FINDER_COLUMN_G_D_S_GROUPID_2);
4130
4131 if (displayDate == null) {
4132 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_1);
4133 }
4134 else {
4135 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_2);
4136 }
4137
4138 query.append(_FINDER_COLUMN_G_D_S_STATUS_2);
4139
4140 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
4141
4142 String sql = query.toString();
4143
4144 Query q = session.createQuery(sql);
4145
4146 QueryPos qPos = QueryPos.getInstance(q);
4147
4148 qPos.add(groupId);
4149
4150 if (displayDate != null) {
4151 qPos.add(CalendarUtil.getTimestamp(displayDate));
4152 }
4153
4154 qPos.add(status);
4155
4156 list = q.list();
4157 }
4158 catch (Exception e) {
4159 throw processException(e);
4160 }
4161 finally {
4162 if (list == null) {
4163 list = new ArrayList<BlogsEntry>();
4164 }
4165
4166 cacheResult(list);
4167
4168 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_D_S,
4169 finderArgs, list);
4170
4171 closeSession(session);
4172 }
4173 }
4174
4175 return list;
4176 }
4177
4178 public List<BlogsEntry> findByG_D_S(long groupId, Date displayDate,
4179 int status, int start, int end) throws SystemException {
4180 return findByG_D_S(groupId, displayDate, status, start, end, null);
4181 }
4182
4183 public List<BlogsEntry> findByG_D_S(long groupId, Date displayDate,
4184 int status, int start, int end, OrderByComparator obc)
4185 throws SystemException {
4186 Object[] finderArgs = new Object[] {
4187 new Long(groupId),
4188
4189 displayDate, new Integer(status),
4190
4191 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
4192 };
4193
4194 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_D_S,
4195 finderArgs, this);
4196
4197 if (list == null) {
4198 Session session = null;
4199
4200 try {
4201 session = openSession();
4202
4203 StringBundler query = null;
4204
4205 if (obc != null) {
4206 query = new StringBundler(5 +
4207 (obc.getOrderByFields().length * 3));
4208 }
4209 else {
4210 query = new StringBundler(5);
4211 }
4212
4213 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
4214
4215 query.append(_FINDER_COLUMN_G_D_S_GROUPID_2);
4216
4217 if (displayDate == null) {
4218 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_1);
4219 }
4220 else {
4221 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_2);
4222 }
4223
4224 query.append(_FINDER_COLUMN_G_D_S_STATUS_2);
4225
4226 if (obc != null) {
4227 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
4228 }
4229
4230 else {
4231 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
4232 }
4233
4234 String sql = query.toString();
4235
4236 Query q = session.createQuery(sql);
4237
4238 QueryPos qPos = QueryPos.getInstance(q);
4239
4240 qPos.add(groupId);
4241
4242 if (displayDate != null) {
4243 qPos.add(CalendarUtil.getTimestamp(displayDate));
4244 }
4245
4246 qPos.add(status);
4247
4248 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
4249 end);
4250 }
4251 catch (Exception e) {
4252 throw processException(e);
4253 }
4254 finally {
4255 if (list == null) {
4256 list = new ArrayList<BlogsEntry>();
4257 }
4258
4259 cacheResult(list);
4260
4261 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_D_S,
4262 finderArgs, list);
4263
4264 closeSession(session);
4265 }
4266 }
4267
4268 return list;
4269 }
4270
4271 public BlogsEntry findByG_D_S_First(long groupId, Date displayDate,
4272 int status, OrderByComparator obc)
4273 throws NoSuchEntryException, SystemException {
4274 List<BlogsEntry> list = findByG_D_S(groupId, displayDate, status, 0, 1,
4275 obc);
4276
4277 if (list.isEmpty()) {
4278 StringBundler msg = new StringBundler(8);
4279
4280 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
4281
4282 msg.append("groupId=");
4283 msg.append(groupId);
4284
4285 msg.append(", displayDate=");
4286 msg.append(displayDate);
4287
4288 msg.append(", status=");
4289 msg.append(status);
4290
4291 msg.append(StringPool.CLOSE_CURLY_BRACE);
4292
4293 throw new NoSuchEntryException(msg.toString());
4294 }
4295 else {
4296 return list.get(0);
4297 }
4298 }
4299
4300 public BlogsEntry findByG_D_S_Last(long groupId, Date displayDate,
4301 int status, OrderByComparator obc)
4302 throws NoSuchEntryException, SystemException {
4303 int count = countByG_D_S(groupId, displayDate, status);
4304
4305 List<BlogsEntry> list = findByG_D_S(groupId, displayDate, status,
4306 count - 1, count, obc);
4307
4308 if (list.isEmpty()) {
4309 StringBundler msg = new StringBundler(8);
4310
4311 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
4312
4313 msg.append("groupId=");
4314 msg.append(groupId);
4315
4316 msg.append(", displayDate=");
4317 msg.append(displayDate);
4318
4319 msg.append(", status=");
4320 msg.append(status);
4321
4322 msg.append(StringPool.CLOSE_CURLY_BRACE);
4323
4324 throw new NoSuchEntryException(msg.toString());
4325 }
4326 else {
4327 return list.get(0);
4328 }
4329 }
4330
4331 public BlogsEntry[] findByG_D_S_PrevAndNext(long entryId, long groupId,
4332 Date displayDate, int status, OrderByComparator obc)
4333 throws NoSuchEntryException, SystemException {
4334 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
4335
4336 int count = countByG_D_S(groupId, displayDate, status);
4337
4338 Session session = null;
4339
4340 try {
4341 session = openSession();
4342
4343 StringBundler query = null;
4344
4345 if (obc != null) {
4346 query = new StringBundler(5 +
4347 (obc.getOrderByFields().length * 3));
4348 }
4349 else {
4350 query = new StringBundler(5);
4351 }
4352
4353 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
4354
4355 query.append(_FINDER_COLUMN_G_D_S_GROUPID_2);
4356
4357 if (displayDate == null) {
4358 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_1);
4359 }
4360 else {
4361 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_2);
4362 }
4363
4364 query.append(_FINDER_COLUMN_G_D_S_STATUS_2);
4365
4366 if (obc != null) {
4367 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
4368 }
4369
4370 else {
4371 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
4372 }
4373
4374 String sql = query.toString();
4375
4376 Query q = session.createQuery(sql);
4377
4378 QueryPos qPos = QueryPos.getInstance(q);
4379
4380 qPos.add(groupId);
4381
4382 if (displayDate != null) {
4383 qPos.add(CalendarUtil.getTimestamp(displayDate));
4384 }
4385
4386 qPos.add(status);
4387
4388 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
4389 blogsEntry);
4390
4391 BlogsEntry[] array = new BlogsEntryImpl[3];
4392
4393 array[0] = (BlogsEntry)objArray[0];
4394 array[1] = (BlogsEntry)objArray[1];
4395 array[2] = (BlogsEntry)objArray[2];
4396
4397 return array;
4398 }
4399 catch (Exception e) {
4400 throw processException(e);
4401 }
4402 finally {
4403 closeSession(session);
4404 }
4405 }
4406
4407 public List<BlogsEntry> findByG_U_D_S(long groupId, long userId,
4408 Date displayDate, int status) throws SystemException {
4409 Object[] finderArgs = new Object[] {
4410 new Long(groupId), new Long(userId),
4411
4412 displayDate, new Integer(status)
4413 };
4414
4415 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_U_D_S,
4416 finderArgs, this);
4417
4418 if (list == null) {
4419 Session session = null;
4420
4421 try {
4422 session = openSession();
4423
4424 StringBundler query = new StringBundler(6);
4425
4426 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
4427
4428 query.append(_FINDER_COLUMN_G_U_D_S_GROUPID_2);
4429
4430 query.append(_FINDER_COLUMN_G_U_D_S_USERID_2);
4431
4432 if (displayDate == null) {
4433 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_1);
4434 }
4435 else {
4436 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_2);
4437 }
4438
4439 query.append(_FINDER_COLUMN_G_U_D_S_STATUS_2);
4440
4441 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
4442
4443 String sql = query.toString();
4444
4445 Query q = session.createQuery(sql);
4446
4447 QueryPos qPos = QueryPos.getInstance(q);
4448
4449 qPos.add(groupId);
4450
4451 qPos.add(userId);
4452
4453 if (displayDate != null) {
4454 qPos.add(CalendarUtil.getTimestamp(displayDate));
4455 }
4456
4457 qPos.add(status);
4458
4459 list = q.list();
4460 }
4461 catch (Exception e) {
4462 throw processException(e);
4463 }
4464 finally {
4465 if (list == null) {
4466 list = new ArrayList<BlogsEntry>();
4467 }
4468
4469 cacheResult(list);
4470
4471 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_U_D_S,
4472 finderArgs, list);
4473
4474 closeSession(session);
4475 }
4476 }
4477
4478 return list;
4479 }
4480
4481 public List<BlogsEntry> findByG_U_D_S(long groupId, long userId,
4482 Date displayDate, int status, int start, int end)
4483 throws SystemException {
4484 return findByG_U_D_S(groupId, userId, displayDate, status, start, end,
4485 null);
4486 }
4487
4488 public List<BlogsEntry> findByG_U_D_S(long groupId, long userId,
4489 Date displayDate, int status, int start, int end, OrderByComparator obc)
4490 throws SystemException {
4491 Object[] finderArgs = new Object[] {
4492 new Long(groupId), new Long(userId),
4493
4494 displayDate, new Integer(status),
4495
4496 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
4497 };
4498
4499 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_U_D_S,
4500 finderArgs, this);
4501
4502 if (list == null) {
4503 Session session = null;
4504
4505 try {
4506 session = openSession();
4507
4508 StringBundler query = null;
4509
4510 if (obc != null) {
4511 query = new StringBundler(6 +
4512 (obc.getOrderByFields().length * 3));
4513 }
4514 else {
4515 query = new StringBundler(6);
4516 }
4517
4518 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
4519
4520 query.append(_FINDER_COLUMN_G_U_D_S_GROUPID_2);
4521
4522 query.append(_FINDER_COLUMN_G_U_D_S_USERID_2);
4523
4524 if (displayDate == null) {
4525 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_1);
4526 }
4527 else {
4528 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_2);
4529 }
4530
4531 query.append(_FINDER_COLUMN_G_U_D_S_STATUS_2);
4532
4533 if (obc != null) {
4534 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
4535 }
4536
4537 else {
4538 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
4539 }
4540
4541 String sql = query.toString();
4542
4543 Query q = session.createQuery(sql);
4544
4545 QueryPos qPos = QueryPos.getInstance(q);
4546
4547 qPos.add(groupId);
4548
4549 qPos.add(userId);
4550
4551 if (displayDate != null) {
4552 qPos.add(CalendarUtil.getTimestamp(displayDate));
4553 }
4554
4555 qPos.add(status);
4556
4557 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(), start,
4558 end);
4559 }
4560 catch (Exception e) {
4561 throw processException(e);
4562 }
4563 finally {
4564 if (list == null) {
4565 list = new ArrayList<BlogsEntry>();
4566 }
4567
4568 cacheResult(list);
4569
4570 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_U_D_S,
4571 finderArgs, list);
4572
4573 closeSession(session);
4574 }
4575 }
4576
4577 return list;
4578 }
4579
4580 public BlogsEntry findByG_U_D_S_First(long groupId, long userId,
4581 Date displayDate, int status, OrderByComparator obc)
4582 throws NoSuchEntryException, SystemException {
4583 List<BlogsEntry> list = findByG_U_D_S(groupId, userId, displayDate,
4584 status, 0, 1, obc);
4585
4586 if (list.isEmpty()) {
4587 StringBundler msg = new StringBundler(10);
4588
4589 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
4590
4591 msg.append("groupId=");
4592 msg.append(groupId);
4593
4594 msg.append(", userId=");
4595 msg.append(userId);
4596
4597 msg.append(", displayDate=");
4598 msg.append(displayDate);
4599
4600 msg.append(", status=");
4601 msg.append(status);
4602
4603 msg.append(StringPool.CLOSE_CURLY_BRACE);
4604
4605 throw new NoSuchEntryException(msg.toString());
4606 }
4607 else {
4608 return list.get(0);
4609 }
4610 }
4611
4612 public BlogsEntry findByG_U_D_S_Last(long groupId, long userId,
4613 Date displayDate, int status, OrderByComparator obc)
4614 throws NoSuchEntryException, SystemException {
4615 int count = countByG_U_D_S(groupId, userId, displayDate, status);
4616
4617 List<BlogsEntry> list = findByG_U_D_S(groupId, userId, displayDate,
4618 status, count - 1, count, obc);
4619
4620 if (list.isEmpty()) {
4621 StringBundler msg = new StringBundler(10);
4622
4623 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
4624
4625 msg.append("groupId=");
4626 msg.append(groupId);
4627
4628 msg.append(", userId=");
4629 msg.append(userId);
4630
4631 msg.append(", displayDate=");
4632 msg.append(displayDate);
4633
4634 msg.append(", status=");
4635 msg.append(status);
4636
4637 msg.append(StringPool.CLOSE_CURLY_BRACE);
4638
4639 throw new NoSuchEntryException(msg.toString());
4640 }
4641 else {
4642 return list.get(0);
4643 }
4644 }
4645
4646 public BlogsEntry[] findByG_U_D_S_PrevAndNext(long entryId, long groupId,
4647 long userId, Date displayDate, int status, OrderByComparator obc)
4648 throws NoSuchEntryException, SystemException {
4649 BlogsEntry blogsEntry = findByPrimaryKey(entryId);
4650
4651 int count = countByG_U_D_S(groupId, userId, displayDate, status);
4652
4653 Session session = null;
4654
4655 try {
4656 session = openSession();
4657
4658 StringBundler query = null;
4659
4660 if (obc != null) {
4661 query = new StringBundler(6 +
4662 (obc.getOrderByFields().length * 3));
4663 }
4664 else {
4665 query = new StringBundler(6);
4666 }
4667
4668 query.append(_SQL_SELECT_BLOGSENTRY_WHERE);
4669
4670 query.append(_FINDER_COLUMN_G_U_D_S_GROUPID_2);
4671
4672 query.append(_FINDER_COLUMN_G_U_D_S_USERID_2);
4673
4674 if (displayDate == null) {
4675 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_1);
4676 }
4677 else {
4678 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_2);
4679 }
4680
4681 query.append(_FINDER_COLUMN_G_U_D_S_STATUS_2);
4682
4683 if (obc != null) {
4684 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
4685 }
4686
4687 else {
4688 query.append(BlogsEntryModelImpl.ORDER_BY_JPQL);
4689 }
4690
4691 String sql = query.toString();
4692
4693 Query q = session.createQuery(sql);
4694
4695 QueryPos qPos = QueryPos.getInstance(q);
4696
4697 qPos.add(groupId);
4698
4699 qPos.add(userId);
4700
4701 if (displayDate != null) {
4702 qPos.add(CalendarUtil.getTimestamp(displayDate));
4703 }
4704
4705 qPos.add(status);
4706
4707 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
4708 blogsEntry);
4709
4710 BlogsEntry[] array = new BlogsEntryImpl[3];
4711
4712 array[0] = (BlogsEntry)objArray[0];
4713 array[1] = (BlogsEntry)objArray[1];
4714 array[2] = (BlogsEntry)objArray[2];
4715
4716 return array;
4717 }
4718 catch (Exception e) {
4719 throw processException(e);
4720 }
4721 finally {
4722 closeSession(session);
4723 }
4724 }
4725
4726 public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
4727 throws SystemException {
4728 Session session = null;
4729
4730 try {
4731 session = openSession();
4732
4733 dynamicQuery.compile(session);
4734
4735 return dynamicQuery.list();
4736 }
4737 catch (Exception e) {
4738 throw processException(e);
4739 }
4740 finally {
4741 closeSession(session);
4742 }
4743 }
4744
4745 public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
4746 int start, int end) throws SystemException {
4747 Session session = null;
4748
4749 try {
4750 session = openSession();
4751
4752 dynamicQuery.setLimit(start, end);
4753
4754 dynamicQuery.compile(session);
4755
4756 return dynamicQuery.list();
4757 }
4758 catch (Exception e) {
4759 throw processException(e);
4760 }
4761 finally {
4762 closeSession(session);
4763 }
4764 }
4765
4766 public List<BlogsEntry> findAll() throws SystemException {
4767 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
4768 }
4769
4770 public List<BlogsEntry> findAll(int start, int end)
4771 throws SystemException {
4772 return findAll(start, end, null);
4773 }
4774
4775 public List<BlogsEntry> findAll(int start, int end, OrderByComparator obc)
4776 throws SystemException {
4777 Object[] finderArgs = new Object[] {
4778 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
4779 };
4780
4781 List<BlogsEntry> list = (List<BlogsEntry>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
4782 finderArgs, this);
4783
4784 if (list == null) {
4785 Session session = null;
4786
4787 try {
4788 session = openSession();
4789
4790 StringBundler query = null;
4791 String sql = null;
4792
4793 if (obc != null) {
4794 query = new StringBundler(2 +
4795 (obc.getOrderByFields().length * 3));
4796
4797 query.append(_SQL_SELECT_BLOGSENTRY);
4798
4799 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
4800
4801 sql = query.toString();
4802 }
4803
4804 else {
4805 sql = _SQL_SELECT_BLOGSENTRY.concat(BlogsEntryModelImpl.ORDER_BY_JPQL);
4806 }
4807
4808 Query q = session.createQuery(sql);
4809
4810 if (obc == null) {
4811 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(),
4812 start, end, false);
4813
4814 Collections.sort(list);
4815 }
4816 else {
4817 list = (List<BlogsEntry>)QueryUtil.list(q, getDialect(),
4818 start, end);
4819 }
4820 }
4821 catch (Exception e) {
4822 throw processException(e);
4823 }
4824 finally {
4825 if (list == null) {
4826 list = new ArrayList<BlogsEntry>();
4827 }
4828
4829 cacheResult(list);
4830
4831 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
4832
4833 closeSession(session);
4834 }
4835 }
4836
4837 return list;
4838 }
4839
4840 public void removeByUuid(String uuid) throws SystemException {
4841 for (BlogsEntry blogsEntry : findByUuid(uuid)) {
4842 remove(blogsEntry);
4843 }
4844 }
4845
4846 public void removeByUUID_G(String uuid, long groupId)
4847 throws NoSuchEntryException, SystemException {
4848 BlogsEntry blogsEntry = findByUUID_G(uuid, groupId);
4849
4850 remove(blogsEntry);
4851 }
4852
4853 public void removeByGroupId(long groupId) throws SystemException {
4854 for (BlogsEntry blogsEntry : findByGroupId(groupId)) {
4855 remove(blogsEntry);
4856 }
4857 }
4858
4859 public void removeByCompanyId(long companyId) throws SystemException {
4860 for (BlogsEntry blogsEntry : findByCompanyId(companyId)) {
4861 remove(blogsEntry);
4862 }
4863 }
4864
4865 public void removeByC_U(long companyId, long userId)
4866 throws SystemException {
4867 for (BlogsEntry blogsEntry : findByC_U(companyId, userId)) {
4868 remove(blogsEntry);
4869 }
4870 }
4871
4872 public void removeByC_D(long companyId, Date displayDate)
4873 throws SystemException {
4874 for (BlogsEntry blogsEntry : findByC_D(companyId, displayDate)) {
4875 remove(blogsEntry);
4876 }
4877 }
4878
4879 public void removeByC_S(long companyId, int status)
4880 throws SystemException {
4881 for (BlogsEntry blogsEntry : findByC_S(companyId, status)) {
4882 remove(blogsEntry);
4883 }
4884 }
4885
4886 public void removeByG_UT(long groupId, String urlTitle)
4887 throws NoSuchEntryException, SystemException {
4888 BlogsEntry blogsEntry = findByG_UT(groupId, urlTitle);
4889
4890 remove(blogsEntry);
4891 }
4892
4893 public void removeByG_D(long groupId, Date displayDate)
4894 throws SystemException {
4895 for (BlogsEntry blogsEntry : findByG_D(groupId, displayDate)) {
4896 remove(blogsEntry);
4897 }
4898 }
4899
4900 public void removeByG_S(long groupId, int status) throws SystemException {
4901 for (BlogsEntry blogsEntry : findByG_S(groupId, status)) {
4902 remove(blogsEntry);
4903 }
4904 }
4905
4906 public void removeByC_U_S(long companyId, long userId, int status)
4907 throws SystemException {
4908 for (BlogsEntry blogsEntry : findByC_U_S(companyId, userId, status)) {
4909 remove(blogsEntry);
4910 }
4911 }
4912
4913 public void removeByC_D_S(long companyId, Date displayDate, int status)
4914 throws SystemException {
4915 for (BlogsEntry blogsEntry : findByC_D_S(companyId, displayDate, status)) {
4916 remove(blogsEntry);
4917 }
4918 }
4919
4920 public void removeByG_U_D(long groupId, long userId, Date displayDate)
4921 throws SystemException {
4922 for (BlogsEntry blogsEntry : findByG_U_D(groupId, userId, displayDate)) {
4923 remove(blogsEntry);
4924 }
4925 }
4926
4927 public void removeByG_U_S(long groupId, long userId, int status)
4928 throws SystemException {
4929 for (BlogsEntry blogsEntry : findByG_U_S(groupId, userId, status)) {
4930 remove(blogsEntry);
4931 }
4932 }
4933
4934 public void removeByG_D_S(long groupId, Date displayDate, int status)
4935 throws SystemException {
4936 for (BlogsEntry blogsEntry : findByG_D_S(groupId, displayDate, status)) {
4937 remove(blogsEntry);
4938 }
4939 }
4940
4941 public void removeByG_U_D_S(long groupId, long userId, Date displayDate,
4942 int status) throws SystemException {
4943 for (BlogsEntry blogsEntry : findByG_U_D_S(groupId, userId,
4944 displayDate, status)) {
4945 remove(blogsEntry);
4946 }
4947 }
4948
4949 public void removeAll() throws SystemException {
4950 for (BlogsEntry blogsEntry : findAll()) {
4951 remove(blogsEntry);
4952 }
4953 }
4954
4955 public int countByUuid(String uuid) throws SystemException {
4956 Object[] finderArgs = new Object[] { uuid };
4957
4958 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_UUID,
4959 finderArgs, this);
4960
4961 if (count == null) {
4962 Session session = null;
4963
4964 try {
4965 session = openSession();
4966
4967 StringBundler query = new StringBundler(2);
4968
4969 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
4970
4971 if (uuid == null) {
4972 query.append(_FINDER_COLUMN_UUID_UUID_1);
4973 }
4974 else {
4975 if (uuid.equals(StringPool.BLANK)) {
4976 query.append(_FINDER_COLUMN_UUID_UUID_3);
4977 }
4978 else {
4979 query.append(_FINDER_COLUMN_UUID_UUID_2);
4980 }
4981 }
4982
4983 String sql = query.toString();
4984
4985 Query q = session.createQuery(sql);
4986
4987 QueryPos qPos = QueryPos.getInstance(q);
4988
4989 if (uuid != null) {
4990 qPos.add(uuid);
4991 }
4992
4993 count = (Long)q.uniqueResult();
4994 }
4995 catch (Exception e) {
4996 throw processException(e);
4997 }
4998 finally {
4999 if (count == null) {
5000 count = Long.valueOf(0);
5001 }
5002
5003 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_UUID,
5004 finderArgs, count);
5005
5006 closeSession(session);
5007 }
5008 }
5009
5010 return count.intValue();
5011 }
5012
5013 public int countByUUID_G(String uuid, long groupId)
5014 throws SystemException {
5015 Object[] finderArgs = new Object[] { uuid, new Long(groupId) };
5016
5017 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_UUID_G,
5018 finderArgs, this);
5019
5020 if (count == null) {
5021 Session session = null;
5022
5023 try {
5024 session = openSession();
5025
5026 StringBundler query = new StringBundler(3);
5027
5028 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5029
5030 if (uuid == null) {
5031 query.append(_FINDER_COLUMN_UUID_G_UUID_1);
5032 }
5033 else {
5034 if (uuid.equals(StringPool.BLANK)) {
5035 query.append(_FINDER_COLUMN_UUID_G_UUID_3);
5036 }
5037 else {
5038 query.append(_FINDER_COLUMN_UUID_G_UUID_2);
5039 }
5040 }
5041
5042 query.append(_FINDER_COLUMN_UUID_G_GROUPID_2);
5043
5044 String sql = query.toString();
5045
5046 Query q = session.createQuery(sql);
5047
5048 QueryPos qPos = QueryPos.getInstance(q);
5049
5050 if (uuid != null) {
5051 qPos.add(uuid);
5052 }
5053
5054 qPos.add(groupId);
5055
5056 count = (Long)q.uniqueResult();
5057 }
5058 catch (Exception e) {
5059 throw processException(e);
5060 }
5061 finally {
5062 if (count == null) {
5063 count = Long.valueOf(0);
5064 }
5065
5066 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_UUID_G,
5067 finderArgs, count);
5068
5069 closeSession(session);
5070 }
5071 }
5072
5073 return count.intValue();
5074 }
5075
5076 public int countByGroupId(long groupId) throws SystemException {
5077 Object[] finderArgs = new Object[] { new Long(groupId) };
5078
5079 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
5080 finderArgs, this);
5081
5082 if (count == null) {
5083 Session session = null;
5084
5085 try {
5086 session = openSession();
5087
5088 StringBundler query = new StringBundler(2);
5089
5090 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5091
5092 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
5093
5094 String sql = query.toString();
5095
5096 Query q = session.createQuery(sql);
5097
5098 QueryPos qPos = QueryPos.getInstance(q);
5099
5100 qPos.add(groupId);
5101
5102 count = (Long)q.uniqueResult();
5103 }
5104 catch (Exception e) {
5105 throw processException(e);
5106 }
5107 finally {
5108 if (count == null) {
5109 count = Long.valueOf(0);
5110 }
5111
5112 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
5113 finderArgs, count);
5114
5115 closeSession(session);
5116 }
5117 }
5118
5119 return count.intValue();
5120 }
5121
5122 public int countByCompanyId(long companyId) throws SystemException {
5123 Object[] finderArgs = new Object[] { new Long(companyId) };
5124
5125 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
5126 finderArgs, this);
5127
5128 if (count == null) {
5129 Session session = null;
5130
5131 try {
5132 session = openSession();
5133
5134 StringBundler query = new StringBundler(2);
5135
5136 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5137
5138 query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
5139
5140 String sql = query.toString();
5141
5142 Query q = session.createQuery(sql);
5143
5144 QueryPos qPos = QueryPos.getInstance(q);
5145
5146 qPos.add(companyId);
5147
5148 count = (Long)q.uniqueResult();
5149 }
5150 catch (Exception e) {
5151 throw processException(e);
5152 }
5153 finally {
5154 if (count == null) {
5155 count = Long.valueOf(0);
5156 }
5157
5158 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
5159 finderArgs, count);
5160
5161 closeSession(session);
5162 }
5163 }
5164
5165 return count.intValue();
5166 }
5167
5168 public int countByC_U(long companyId, long userId)
5169 throws SystemException {
5170 Object[] finderArgs = new Object[] { new Long(companyId), new Long(userId) };
5171
5172 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_U,
5173 finderArgs, this);
5174
5175 if (count == null) {
5176 Session session = null;
5177
5178 try {
5179 session = openSession();
5180
5181 StringBundler query = new StringBundler(3);
5182
5183 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5184
5185 query.append(_FINDER_COLUMN_C_U_COMPANYID_2);
5186
5187 query.append(_FINDER_COLUMN_C_U_USERID_2);
5188
5189 String sql = query.toString();
5190
5191 Query q = session.createQuery(sql);
5192
5193 QueryPos qPos = QueryPos.getInstance(q);
5194
5195 qPos.add(companyId);
5196
5197 qPos.add(userId);
5198
5199 count = (Long)q.uniqueResult();
5200 }
5201 catch (Exception e) {
5202 throw processException(e);
5203 }
5204 finally {
5205 if (count == null) {
5206 count = Long.valueOf(0);
5207 }
5208
5209 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_U, finderArgs,
5210 count);
5211
5212 closeSession(session);
5213 }
5214 }
5215
5216 return count.intValue();
5217 }
5218
5219 public int countByC_D(long companyId, Date displayDate)
5220 throws SystemException {
5221 Object[] finderArgs = new Object[] { new Long(companyId), displayDate };
5222
5223 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_D,
5224 finderArgs, this);
5225
5226 if (count == null) {
5227 Session session = null;
5228
5229 try {
5230 session = openSession();
5231
5232 StringBundler query = new StringBundler(3);
5233
5234 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5235
5236 query.append(_FINDER_COLUMN_C_D_COMPANYID_2);
5237
5238 if (displayDate == null) {
5239 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_1);
5240 }
5241 else {
5242 query.append(_FINDER_COLUMN_C_D_DISPLAYDATE_2);
5243 }
5244
5245 String sql = query.toString();
5246
5247 Query q = session.createQuery(sql);
5248
5249 QueryPos qPos = QueryPos.getInstance(q);
5250
5251 qPos.add(companyId);
5252
5253 if (displayDate != null) {
5254 qPos.add(CalendarUtil.getTimestamp(displayDate));
5255 }
5256
5257 count = (Long)q.uniqueResult();
5258 }
5259 catch (Exception e) {
5260 throw processException(e);
5261 }
5262 finally {
5263 if (count == null) {
5264 count = Long.valueOf(0);
5265 }
5266
5267 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_D, finderArgs,
5268 count);
5269
5270 closeSession(session);
5271 }
5272 }
5273
5274 return count.intValue();
5275 }
5276
5277 public int countByC_S(long companyId, int status) throws SystemException {
5278 Object[] finderArgs = new Object[] {
5279 new Long(companyId), new Integer(status)
5280 };
5281
5282 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_S,
5283 finderArgs, this);
5284
5285 if (count == null) {
5286 Session session = null;
5287
5288 try {
5289 session = openSession();
5290
5291 StringBundler query = new StringBundler(3);
5292
5293 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5294
5295 query.append(_FINDER_COLUMN_C_S_COMPANYID_2);
5296
5297 query.append(_FINDER_COLUMN_C_S_STATUS_2);
5298
5299 String sql = query.toString();
5300
5301 Query q = session.createQuery(sql);
5302
5303 QueryPos qPos = QueryPos.getInstance(q);
5304
5305 qPos.add(companyId);
5306
5307 qPos.add(status);
5308
5309 count = (Long)q.uniqueResult();
5310 }
5311 catch (Exception e) {
5312 throw processException(e);
5313 }
5314 finally {
5315 if (count == null) {
5316 count = Long.valueOf(0);
5317 }
5318
5319 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_S, finderArgs,
5320 count);
5321
5322 closeSession(session);
5323 }
5324 }
5325
5326 return count.intValue();
5327 }
5328
5329 public int countByG_UT(long groupId, String urlTitle)
5330 throws SystemException {
5331 Object[] finderArgs = new Object[] { new Long(groupId), urlTitle };
5332
5333 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_UT,
5334 finderArgs, this);
5335
5336 if (count == null) {
5337 Session session = null;
5338
5339 try {
5340 session = openSession();
5341
5342 StringBundler query = new StringBundler(3);
5343
5344 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5345
5346 query.append(_FINDER_COLUMN_G_UT_GROUPID_2);
5347
5348 if (urlTitle == null) {
5349 query.append(_FINDER_COLUMN_G_UT_URLTITLE_1);
5350 }
5351 else {
5352 if (urlTitle.equals(StringPool.BLANK)) {
5353 query.append(_FINDER_COLUMN_G_UT_URLTITLE_3);
5354 }
5355 else {
5356 query.append(_FINDER_COLUMN_G_UT_URLTITLE_2);
5357 }
5358 }
5359
5360 String sql = query.toString();
5361
5362 Query q = session.createQuery(sql);
5363
5364 QueryPos qPos = QueryPos.getInstance(q);
5365
5366 qPos.add(groupId);
5367
5368 if (urlTitle != null) {
5369 qPos.add(urlTitle);
5370 }
5371
5372 count = (Long)q.uniqueResult();
5373 }
5374 catch (Exception e) {
5375 throw processException(e);
5376 }
5377 finally {
5378 if (count == null) {
5379 count = Long.valueOf(0);
5380 }
5381
5382 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_UT,
5383 finderArgs, count);
5384
5385 closeSession(session);
5386 }
5387 }
5388
5389 return count.intValue();
5390 }
5391
5392 public int countByG_D(long groupId, Date displayDate)
5393 throws SystemException {
5394 Object[] finderArgs = new Object[] { new Long(groupId), displayDate };
5395
5396 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_D,
5397 finderArgs, this);
5398
5399 if (count == null) {
5400 Session session = null;
5401
5402 try {
5403 session = openSession();
5404
5405 StringBundler query = new StringBundler(3);
5406
5407 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5408
5409 query.append(_FINDER_COLUMN_G_D_GROUPID_2);
5410
5411 if (displayDate == null) {
5412 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_1);
5413 }
5414 else {
5415 query.append(_FINDER_COLUMN_G_D_DISPLAYDATE_2);
5416 }
5417
5418 String sql = query.toString();
5419
5420 Query q = session.createQuery(sql);
5421
5422 QueryPos qPos = QueryPos.getInstance(q);
5423
5424 qPos.add(groupId);
5425
5426 if (displayDate != null) {
5427 qPos.add(CalendarUtil.getTimestamp(displayDate));
5428 }
5429
5430 count = (Long)q.uniqueResult();
5431 }
5432 catch (Exception e) {
5433 throw processException(e);
5434 }
5435 finally {
5436 if (count == null) {
5437 count = Long.valueOf(0);
5438 }
5439
5440 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_D, finderArgs,
5441 count);
5442
5443 closeSession(session);
5444 }
5445 }
5446
5447 return count.intValue();
5448 }
5449
5450 public int countByG_S(long groupId, int status) throws SystemException {
5451 Object[] finderArgs = new Object[] {
5452 new Long(groupId), new Integer(status)
5453 };
5454
5455 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_S,
5456 finderArgs, this);
5457
5458 if (count == null) {
5459 Session session = null;
5460
5461 try {
5462 session = openSession();
5463
5464 StringBundler query = new StringBundler(3);
5465
5466 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5467
5468 query.append(_FINDER_COLUMN_G_S_GROUPID_2);
5469
5470 query.append(_FINDER_COLUMN_G_S_STATUS_2);
5471
5472 String sql = query.toString();
5473
5474 Query q = session.createQuery(sql);
5475
5476 QueryPos qPos = QueryPos.getInstance(q);
5477
5478 qPos.add(groupId);
5479
5480 qPos.add(status);
5481
5482 count = (Long)q.uniqueResult();
5483 }
5484 catch (Exception e) {
5485 throw processException(e);
5486 }
5487 finally {
5488 if (count == null) {
5489 count = Long.valueOf(0);
5490 }
5491
5492 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_S, finderArgs,
5493 count);
5494
5495 closeSession(session);
5496 }
5497 }
5498
5499 return count.intValue();
5500 }
5501
5502 public int countByC_U_S(long companyId, long userId, int status)
5503 throws SystemException {
5504 Object[] finderArgs = new Object[] {
5505 new Long(companyId), new Long(userId), new Integer(status)
5506 };
5507
5508 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_U_S,
5509 finderArgs, this);
5510
5511 if (count == null) {
5512 Session session = null;
5513
5514 try {
5515 session = openSession();
5516
5517 StringBundler query = new StringBundler(4);
5518
5519 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5520
5521 query.append(_FINDER_COLUMN_C_U_S_COMPANYID_2);
5522
5523 query.append(_FINDER_COLUMN_C_U_S_USERID_2);
5524
5525 query.append(_FINDER_COLUMN_C_U_S_STATUS_2);
5526
5527 String sql = query.toString();
5528
5529 Query q = session.createQuery(sql);
5530
5531 QueryPos qPos = QueryPos.getInstance(q);
5532
5533 qPos.add(companyId);
5534
5535 qPos.add(userId);
5536
5537 qPos.add(status);
5538
5539 count = (Long)q.uniqueResult();
5540 }
5541 catch (Exception e) {
5542 throw processException(e);
5543 }
5544 finally {
5545 if (count == null) {
5546 count = Long.valueOf(0);
5547 }
5548
5549 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_U_S,
5550 finderArgs, count);
5551
5552 closeSession(session);
5553 }
5554 }
5555
5556 return count.intValue();
5557 }
5558
5559 public int countByC_D_S(long companyId, Date displayDate, int status)
5560 throws SystemException {
5561 Object[] finderArgs = new Object[] {
5562 new Long(companyId),
5563
5564 displayDate, new Integer(status)
5565 };
5566
5567 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_D_S,
5568 finderArgs, this);
5569
5570 if (count == null) {
5571 Session session = null;
5572
5573 try {
5574 session = openSession();
5575
5576 StringBundler query = new StringBundler(4);
5577
5578 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5579
5580 query.append(_FINDER_COLUMN_C_D_S_COMPANYID_2);
5581
5582 if (displayDate == null) {
5583 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_1);
5584 }
5585 else {
5586 query.append(_FINDER_COLUMN_C_D_S_DISPLAYDATE_2);
5587 }
5588
5589 query.append(_FINDER_COLUMN_C_D_S_STATUS_2);
5590
5591 String sql = query.toString();
5592
5593 Query q = session.createQuery(sql);
5594
5595 QueryPos qPos = QueryPos.getInstance(q);
5596
5597 qPos.add(companyId);
5598
5599 if (displayDate != null) {
5600 qPos.add(CalendarUtil.getTimestamp(displayDate));
5601 }
5602
5603 qPos.add(status);
5604
5605 count = (Long)q.uniqueResult();
5606 }
5607 catch (Exception e) {
5608 throw processException(e);
5609 }
5610 finally {
5611 if (count == null) {
5612 count = Long.valueOf(0);
5613 }
5614
5615 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_D_S,
5616 finderArgs, count);
5617
5618 closeSession(session);
5619 }
5620 }
5621
5622 return count.intValue();
5623 }
5624
5625 public int countByG_U_D(long groupId, long userId, Date displayDate)
5626 throws SystemException {
5627 Object[] finderArgs = new Object[] {
5628 new Long(groupId), new Long(userId),
5629
5630 displayDate
5631 };
5632
5633 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_U_D,
5634 finderArgs, this);
5635
5636 if (count == null) {
5637 Session session = null;
5638
5639 try {
5640 session = openSession();
5641
5642 StringBundler query = new StringBundler(4);
5643
5644 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5645
5646 query.append(_FINDER_COLUMN_G_U_D_GROUPID_2);
5647
5648 query.append(_FINDER_COLUMN_G_U_D_USERID_2);
5649
5650 if (displayDate == null) {
5651 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_1);
5652 }
5653 else {
5654 query.append(_FINDER_COLUMN_G_U_D_DISPLAYDATE_2);
5655 }
5656
5657 String sql = query.toString();
5658
5659 Query q = session.createQuery(sql);
5660
5661 QueryPos qPos = QueryPos.getInstance(q);
5662
5663 qPos.add(groupId);
5664
5665 qPos.add(userId);
5666
5667 if (displayDate != null) {
5668 qPos.add(CalendarUtil.getTimestamp(displayDate));
5669 }
5670
5671 count = (Long)q.uniqueResult();
5672 }
5673 catch (Exception e) {
5674 throw processException(e);
5675 }
5676 finally {
5677 if (count == null) {
5678 count = Long.valueOf(0);
5679 }
5680
5681 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_U_D,
5682 finderArgs, count);
5683
5684 closeSession(session);
5685 }
5686 }
5687
5688 return count.intValue();
5689 }
5690
5691 public int countByG_U_S(long groupId, long userId, int status)
5692 throws SystemException {
5693 Object[] finderArgs = new Object[] {
5694 new Long(groupId), new Long(userId), new Integer(status)
5695 };
5696
5697 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_U_S,
5698 finderArgs, this);
5699
5700 if (count == null) {
5701 Session session = null;
5702
5703 try {
5704 session = openSession();
5705
5706 StringBundler query = new StringBundler(4);
5707
5708 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5709
5710 query.append(_FINDER_COLUMN_G_U_S_GROUPID_2);
5711
5712 query.append(_FINDER_COLUMN_G_U_S_USERID_2);
5713
5714 query.append(_FINDER_COLUMN_G_U_S_STATUS_2);
5715
5716 String sql = query.toString();
5717
5718 Query q = session.createQuery(sql);
5719
5720 QueryPos qPos = QueryPos.getInstance(q);
5721
5722 qPos.add(groupId);
5723
5724 qPos.add(userId);
5725
5726 qPos.add(status);
5727
5728 count = (Long)q.uniqueResult();
5729 }
5730 catch (Exception e) {
5731 throw processException(e);
5732 }
5733 finally {
5734 if (count == null) {
5735 count = Long.valueOf(0);
5736 }
5737
5738 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_U_S,
5739 finderArgs, count);
5740
5741 closeSession(session);
5742 }
5743 }
5744
5745 return count.intValue();
5746 }
5747
5748 public int countByG_D_S(long groupId, Date displayDate, int status)
5749 throws SystemException {
5750 Object[] finderArgs = new Object[] {
5751 new Long(groupId),
5752
5753 displayDate, new Integer(status)
5754 };
5755
5756 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_D_S,
5757 finderArgs, this);
5758
5759 if (count == null) {
5760 Session session = null;
5761
5762 try {
5763 session = openSession();
5764
5765 StringBundler query = new StringBundler(4);
5766
5767 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5768
5769 query.append(_FINDER_COLUMN_G_D_S_GROUPID_2);
5770
5771 if (displayDate == null) {
5772 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_1);
5773 }
5774 else {
5775 query.append(_FINDER_COLUMN_G_D_S_DISPLAYDATE_2);
5776 }
5777
5778 query.append(_FINDER_COLUMN_G_D_S_STATUS_2);
5779
5780 String sql = query.toString();
5781
5782 Query q = session.createQuery(sql);
5783
5784 QueryPos qPos = QueryPos.getInstance(q);
5785
5786 qPos.add(groupId);
5787
5788 if (displayDate != null) {
5789 qPos.add(CalendarUtil.getTimestamp(displayDate));
5790 }
5791
5792 qPos.add(status);
5793
5794 count = (Long)q.uniqueResult();
5795 }
5796 catch (Exception e) {
5797 throw processException(e);
5798 }
5799 finally {
5800 if (count == null) {
5801 count = Long.valueOf(0);
5802 }
5803
5804 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_D_S,
5805 finderArgs, count);
5806
5807 closeSession(session);
5808 }
5809 }
5810
5811 return count.intValue();
5812 }
5813
5814 public int countByG_U_D_S(long groupId, long userId, Date displayDate,
5815 int status) throws SystemException {
5816 Object[] finderArgs = new Object[] {
5817 new Long(groupId), new Long(userId),
5818
5819 displayDate, new Integer(status)
5820 };
5821
5822 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_U_D_S,
5823 finderArgs, this);
5824
5825 if (count == null) {
5826 Session session = null;
5827
5828 try {
5829 session = openSession();
5830
5831 StringBundler query = new StringBundler(5);
5832
5833 query.append(_SQL_COUNT_BLOGSENTRY_WHERE);
5834
5835 query.append(_FINDER_COLUMN_G_U_D_S_GROUPID_2);
5836
5837 query.append(_FINDER_COLUMN_G_U_D_S_USERID_2);
5838
5839 if (displayDate == null) {
5840 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_1);
5841 }
5842 else {
5843 query.append(_FINDER_COLUMN_G_U_D_S_DISPLAYDATE_2);
5844 }
5845
5846 query.append(_FINDER_COLUMN_G_U_D_S_STATUS_2);
5847
5848 String sql = query.toString();
5849
5850 Query q = session.createQuery(sql);
5851
5852 QueryPos qPos = QueryPos.getInstance(q);
5853
5854 qPos.add(groupId);
5855
5856 qPos.add(userId);
5857
5858 if (displayDate != null) {
5859 qPos.add(CalendarUtil.getTimestamp(displayDate));
5860 }
5861
5862 qPos.add(status);
5863
5864 count = (Long)q.uniqueResult();
5865 }
5866 catch (Exception e) {
5867 throw processException(e);
5868 }
5869 finally {
5870 if (count == null) {
5871 count = Long.valueOf(0);
5872 }
5873
5874 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_U_D_S,
5875 finderArgs, count);
5876
5877 closeSession(session);
5878 }
5879 }
5880
5881 return count.intValue();
5882 }
5883
5884 public int countAll() throws SystemException {
5885 Object[] finderArgs = new Object[0];
5886
5887 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
5888 finderArgs, this);
5889
5890 if (count == null) {
5891 Session session = null;
5892
5893 try {
5894 session = openSession();
5895
5896 Query q = session.createQuery(_SQL_COUNT_BLOGSENTRY);
5897
5898 count = (Long)q.uniqueResult();
5899 }
5900 catch (Exception e) {
5901 throw processException(e);
5902 }
5903 finally {
5904 if (count == null) {
5905 count = Long.valueOf(0);
5906 }
5907
5908 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
5909 count);
5910
5911 closeSession(session);
5912 }
5913 }
5914
5915 return count.intValue();
5916 }
5917
5918 public void afterPropertiesSet() {
5919 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
5920 com.liferay.portal.util.PropsUtil.get(
5921 "value.object.listener.com.liferay.portlet.blogs.model.BlogsEntry")));
5922
5923 if (listenerClassNames.length > 0) {
5924 try {
5925 List<ModelListener<BlogsEntry>> listenersList = new ArrayList<ModelListener<BlogsEntry>>();
5926
5927 for (String listenerClassName : listenerClassNames) {
5928 listenersList.add((ModelListener<BlogsEntry>)Class.forName(
5929 listenerClassName).newInstance());
5930 }
5931
5932 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
5933 }
5934 catch (Exception e) {
5935 _log.error(e);
5936 }
5937 }
5938 }
5939
5940 @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence")
5941 protected com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence blogsEntryPersistence;
5942 @BeanReference(name = "com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence")
5943 protected com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence blogsStatsUserPersistence;
5944 @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence")
5945 protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
5946 @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence")
5947 protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
5948 @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence")
5949 protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
5950 @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence")
5951 protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
5952 @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
5953 protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
5954 @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
5955 protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
5956 @BeanReference(name = "com.liferay.portlet.asset.service.persistence.AssetEntryPersistence")
5957 protected com.liferay.portlet.asset.service.persistence.AssetEntryPersistence assetEntryPersistence;
5958 @BeanReference(name = "com.liferay.portlet.asset.service.persistence.AssetTagPersistence")
5959 protected com.liferay.portlet.asset.service.persistence.AssetTagPersistence assetTagPersistence;
5960 @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence")
5961 protected com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence expandoValuePersistence;
5962 @BeanReference(name = "com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence")
5963 protected com.liferay.portlet.messageboards.service.persistence.MBMessagePersistence mbMessagePersistence;
5964 @BeanReference(name = "com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence")
5965 protected com.liferay.portlet.ratings.service.persistence.RatingsStatsPersistence ratingsStatsPersistence;
5966 @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityPersistence")
5967 protected com.liferay.portlet.social.service.persistence.SocialActivityPersistence socialActivityPersistence;
5968 private static final String _SQL_SELECT_BLOGSENTRY = "SELECT blogsEntry FROM BlogsEntry blogsEntry";
5969 private static final String _SQL_SELECT_BLOGSENTRY_WHERE = "SELECT blogsEntry FROM BlogsEntry blogsEntry WHERE ";
5970 private static final String _SQL_COUNT_BLOGSENTRY = "SELECT COUNT(blogsEntry) FROM BlogsEntry blogsEntry";
5971 private static final String _SQL_COUNT_BLOGSENTRY_WHERE = "SELECT COUNT(blogsEntry) FROM BlogsEntry blogsEntry WHERE ";
5972 private static final String _FINDER_COLUMN_UUID_UUID_1 = "blogsEntry.uuid IS NULL";
5973 private static final String _FINDER_COLUMN_UUID_UUID_2 = "blogsEntry.uuid = ?";
5974 private static final String _FINDER_COLUMN_UUID_UUID_3 = "(blogsEntry.uuid IS NULL OR blogsEntry.uuid = ?)";
5975 private static final String _FINDER_COLUMN_UUID_G_UUID_1 = "blogsEntry.uuid IS NULL AND ";
5976 private static final String _FINDER_COLUMN_UUID_G_UUID_2 = "blogsEntry.uuid = ? AND ";
5977 private static final String _FINDER_COLUMN_UUID_G_UUID_3 = "(blogsEntry.uuid IS NULL OR blogsEntry.uuid = ?) AND ";
5978 private static final String _FINDER_COLUMN_UUID_G_GROUPID_2 = "blogsEntry.groupId = ?";
5979 private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "blogsEntry.groupId = ?";
5980 private static final String _FINDER_COLUMN_COMPANYID_COMPANYID_2 = "blogsEntry.companyId = ?";
5981 private static final String _FINDER_COLUMN_C_U_COMPANYID_2 = "blogsEntry.companyId = ? AND ";
5982 private static final String _FINDER_COLUMN_C_U_USERID_2 = "blogsEntry.userId = ?";
5983 private static final String _FINDER_COLUMN_C_D_COMPANYID_2 = "blogsEntry.companyId = ? AND ";
5984 private static final String _FINDER_COLUMN_C_D_DISPLAYDATE_1 = "blogsEntry.displayDate < NULL";
5985 private static final String _FINDER_COLUMN_C_D_DISPLAYDATE_2 = "blogsEntry.displayDate < ?";
5986 private static final String _FINDER_COLUMN_C_S_COMPANYID_2 = "blogsEntry.companyId = ? AND ";
5987 private static final String _FINDER_COLUMN_C_S_STATUS_2 = "blogsEntry.status = ?";
5988 private static final String _FINDER_COLUMN_G_UT_GROUPID_2 = "blogsEntry.groupId = ? AND ";
5989 private static final String _FINDER_COLUMN_G_UT_URLTITLE_1 = "blogsEntry.urlTitle IS NULL";
5990 private static final String _FINDER_COLUMN_G_UT_URLTITLE_2 = "blogsEntry.urlTitle = ?";
5991 private static final String _FINDER_COLUMN_G_UT_URLTITLE_3 = "(blogsEntry.urlTitle IS NULL OR blogsEntry.urlTitle = ?)";
5992 private static final String _FINDER_COLUMN_G_D_GROUPID_2 = "blogsEntry.groupId = ? AND ";
5993 private static final String _FINDER_COLUMN_G_D_DISPLAYDATE_1 = "blogsEntry.displayDate < NULL";
5994 private static final String _FINDER_COLUMN_G_D_DISPLAYDATE_2 = "blogsEntry.displayDate < ?";
5995 private static final String _FINDER_COLUMN_G_S_GROUPID_2 = "blogsEntry.groupId = ? AND ";
5996 private static final String _FINDER_COLUMN_G_S_STATUS_2 = "blogsEntry.status = ?";
5997 private static final String _FINDER_COLUMN_C_U_S_COMPANYID_2 = "blogsEntry.companyId = ? AND ";
5998 private static final String _FINDER_COLUMN_C_U_S_USERID_2 = "blogsEntry.userId = ? AND ";
5999 private static final String _FINDER_COLUMN_C_U_S_STATUS_2 = "blogsEntry.status = ?";
6000 private static final String _FINDER_COLUMN_C_D_S_COMPANYID_2 = "blogsEntry.companyId = ? AND ";
6001 private static final String _FINDER_COLUMN_C_D_S_DISPLAYDATE_1 = "blogsEntry.displayDate < NULL AND ";
6002 private static final String _FINDER_COLUMN_C_D_S_DISPLAYDATE_2 = "blogsEntry.displayDate < ? AND ";
6003 private static final String _FINDER_COLUMN_C_D_S_STATUS_2 = "blogsEntry.status = ?";
6004 private static final String _FINDER_COLUMN_G_U_D_GROUPID_2 = "blogsEntry.groupId = ? AND ";
6005 private static final String _FINDER_COLUMN_G_U_D_USERID_2 = "blogsEntry.userId = ? AND ";
6006 private static final String _FINDER_COLUMN_G_U_D_DISPLAYDATE_1 = "blogsEntry.displayDate < NULL";
6007 private static final String _FINDER_COLUMN_G_U_D_DISPLAYDATE_2 = "blogsEntry.displayDate < ?";
6008 private static final String _FINDER_COLUMN_G_U_S_GROUPID_2 = "blogsEntry.groupId = ? AND ";
6009 private static final String _FINDER_COLUMN_G_U_S_USERID_2 = "blogsEntry.userId = ? AND ";
6010 private static final String _FINDER_COLUMN_G_U_S_STATUS_2 = "blogsEntry.status = ?";
6011 private static final String _FINDER_COLUMN_G_D_S_GROUPID_2 = "blogsEntry.groupId = ? AND ";
6012 private static final String _FINDER_COLUMN_G_D_S_DISPLAYDATE_1 = "blogsEntry.displayDate < NULL AND ";
6013 private static final String _FINDER_COLUMN_G_D_S_DISPLAYDATE_2 = "blogsEntry.displayDate < ? AND ";
6014 private static final String _FINDER_COLUMN_G_D_S_STATUS_2 = "blogsEntry.status = ?";
6015 private static final String _FINDER_COLUMN_G_U_D_S_GROUPID_2 = "blogsEntry.groupId = ? AND ";
6016 private static final String _FINDER_COLUMN_G_U_D_S_USERID_2 = "blogsEntry.userId = ? AND ";
6017 private static final String _FINDER_COLUMN_G_U_D_S_DISPLAYDATE_1 = "blogsEntry.displayDate < NULL AND ";
6018 private static final String _FINDER_COLUMN_G_U_D_S_DISPLAYDATE_2 = "blogsEntry.displayDate < ? AND ";
6019 private static final String _FINDER_COLUMN_G_U_D_S_STATUS_2 = "blogsEntry.status = ?";
6020 private static final String _ORDER_BY_ENTITY_ALIAS = "blogsEntry.";
6021 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No BlogsEntry exists with the primary key ";
6022 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No BlogsEntry exists with the key {";
6023 private static Log _log = LogFactoryUtil.getLog(BlogsEntryPersistenceImpl.class);
6024}