1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.bookmarks.service.persistence;
24  
25  import com.liferay.portal.SystemException;
26  import com.liferay.portal.kernel.annotation.BeanReference;
27  import com.liferay.portal.kernel.cache.CacheRegistry;
28  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
29  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
30  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
31  import com.liferay.portal.kernel.dao.orm.FinderPath;
32  import com.liferay.portal.kernel.dao.orm.Query;
33  import com.liferay.portal.kernel.dao.orm.QueryPos;
34  import com.liferay.portal.kernel.dao.orm.QueryUtil;
35  import com.liferay.portal.kernel.dao.orm.Session;
36  import com.liferay.portal.kernel.log.Log;
37  import com.liferay.portal.kernel.log.LogFactoryUtil;
38  import com.liferay.portal.kernel.util.GetterUtil;
39  import com.liferay.portal.kernel.util.OrderByComparator;
40  import com.liferay.portal.kernel.util.StringPool;
41  import com.liferay.portal.kernel.util.StringUtil;
42  import com.liferay.portal.kernel.util.Validator;
43  import com.liferay.portal.kernel.uuid.PortalUUIDUtil;
44  import com.liferay.portal.model.ModelListener;
45  import com.liferay.portal.service.persistence.BatchSessionUtil;
46  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
47  
48  import com.liferay.portlet.bookmarks.NoSuchFolderException;
49  import com.liferay.portlet.bookmarks.model.BookmarksFolder;
50  import com.liferay.portlet.bookmarks.model.impl.BookmarksFolderImpl;
51  import com.liferay.portlet.bookmarks.model.impl.BookmarksFolderModelImpl;
52  
53  import java.util.ArrayList;
54  import java.util.Collections;
55  import java.util.List;
56  
57  /**
58   * <a href="BookmarksFolderPersistenceImpl.java.html"><b><i>View Source</i></b></a>
59   *
60   * <p>
61   * ServiceBuilder generated this class. Modifications in this class will be
62   * overwritten the next time is generated.
63   * </p>
64   *
65   * @author    Brian Wing Shun Chan
66   * @see       BookmarksFolderPersistence
67   * @see       BookmarksFolderUtil
68   * @generated
69   */
70  public class BookmarksFolderPersistenceImpl extends BasePersistenceImpl
71      implements BookmarksFolderPersistence {
72      public static final String FINDER_CLASS_NAME_ENTITY = BookmarksFolderImpl.class.getName();
73      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
74          ".List";
75      public static final FinderPath FINDER_PATH_FIND_BY_UUID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
76              BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
77              FINDER_CLASS_NAME_LIST, "findByUuid",
78              new String[] { String.class.getName() });
79      public static final FinderPath FINDER_PATH_FIND_BY_OBC_UUID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
80              BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
81              FINDER_CLASS_NAME_LIST, "findByUuid",
82              new String[] {
83                  String.class.getName(),
84                  
85              "java.lang.Integer", "java.lang.Integer",
86                  "com.liferay.portal.kernel.util.OrderByComparator"
87              });
88      public static final FinderPath FINDER_PATH_COUNT_BY_UUID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
89              BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
90              FINDER_CLASS_NAME_LIST, "countByUuid",
91              new String[] { String.class.getName() });
92      public static final FinderPath FINDER_PATH_FETCH_BY_UUID_G = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
93              BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
94              FINDER_CLASS_NAME_ENTITY, "fetchByUUID_G",
95              new String[] { String.class.getName(), Long.class.getName() });
96      public static final FinderPath FINDER_PATH_COUNT_BY_UUID_G = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
97              BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
98              FINDER_CLASS_NAME_LIST, "countByUUID_G",
99              new String[] { String.class.getName(), Long.class.getName() });
100     public static final FinderPath FINDER_PATH_FIND_BY_GROUPID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
101             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
102             FINDER_CLASS_NAME_LIST, "findByGroupId",
103             new String[] { Long.class.getName() });
104     public static final FinderPath FINDER_PATH_FIND_BY_OBC_GROUPID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
105             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
106             FINDER_CLASS_NAME_LIST, "findByGroupId",
107             new String[] {
108                 Long.class.getName(),
109                 
110             "java.lang.Integer", "java.lang.Integer",
111                 "com.liferay.portal.kernel.util.OrderByComparator"
112             });
113     public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
114             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
115             FINDER_CLASS_NAME_LIST, "countByGroupId",
116             new String[] { Long.class.getName() });
117     public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
118             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
119             FINDER_CLASS_NAME_LIST, "findByCompanyId",
120             new String[] { Long.class.getName() });
121     public static final FinderPath FINDER_PATH_FIND_BY_OBC_COMPANYID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
122             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
123             FINDER_CLASS_NAME_LIST, "findByCompanyId",
124             new String[] {
125                 Long.class.getName(),
126                 
127             "java.lang.Integer", "java.lang.Integer",
128                 "com.liferay.portal.kernel.util.OrderByComparator"
129             });
130     public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
131             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
132             FINDER_CLASS_NAME_LIST, "countByCompanyId",
133             new String[] { Long.class.getName() });
134     public static final FinderPath FINDER_PATH_FIND_BY_G_P = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
135             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
136             FINDER_CLASS_NAME_LIST, "findByG_P",
137             new String[] { Long.class.getName(), Long.class.getName() });
138     public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_P = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
139             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
140             FINDER_CLASS_NAME_LIST, "findByG_P",
141             new String[] {
142                 Long.class.getName(), Long.class.getName(),
143                 
144             "java.lang.Integer", "java.lang.Integer",
145                 "com.liferay.portal.kernel.util.OrderByComparator"
146             });
147     public static final FinderPath FINDER_PATH_COUNT_BY_G_P = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
148             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
149             FINDER_CLASS_NAME_LIST, "countByG_P",
150             new String[] { Long.class.getName(), Long.class.getName() });
151     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
152             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
153             FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
154     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
155             BookmarksFolderModelImpl.FINDER_CACHE_ENABLED,
156             FINDER_CLASS_NAME_LIST, "countAll", new String[0]);
157 
158     public void cacheResult(BookmarksFolder bookmarksFolder) {
159         EntityCacheUtil.putResult(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
160             BookmarksFolderImpl.class, bookmarksFolder.getPrimaryKey(),
161             bookmarksFolder);
162 
163         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
164             new Object[] {
165                 bookmarksFolder.getUuid(),
166                 new Long(bookmarksFolder.getGroupId())
167             }, bookmarksFolder);
168     }
169 
170     public void cacheResult(List<BookmarksFolder> bookmarksFolders) {
171         for (BookmarksFolder bookmarksFolder : bookmarksFolders) {
172             if (EntityCacheUtil.getResult(
173                         BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
174                         BookmarksFolderImpl.class,
175                         bookmarksFolder.getPrimaryKey(), this) == null) {
176                 cacheResult(bookmarksFolder);
177             }
178         }
179     }
180 
181     public void clearCache() {
182         CacheRegistry.clear(BookmarksFolderImpl.class.getName());
183         EntityCacheUtil.clearCache(BookmarksFolderImpl.class.getName());
184         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
185         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
186     }
187 
188     public BookmarksFolder create(long folderId) {
189         BookmarksFolder bookmarksFolder = new BookmarksFolderImpl();
190 
191         bookmarksFolder.setNew(true);
192         bookmarksFolder.setPrimaryKey(folderId);
193 
194         String uuid = PortalUUIDUtil.generate();
195 
196         bookmarksFolder.setUuid(uuid);
197 
198         return bookmarksFolder;
199     }
200 
201     public BookmarksFolder remove(long folderId)
202         throws NoSuchFolderException, SystemException {
203         Session session = null;
204 
205         try {
206             session = openSession();
207 
208             BookmarksFolder bookmarksFolder = (BookmarksFolder)session.get(BookmarksFolderImpl.class,
209                     new Long(folderId));
210 
211             if (bookmarksFolder == null) {
212                 if (_log.isWarnEnabled()) {
213                     _log.warn("No BookmarksFolder exists with the primary key " +
214                         folderId);
215                 }
216 
217                 throw new NoSuchFolderException(
218                     "No BookmarksFolder exists with the primary key " +
219                     folderId);
220             }
221 
222             return remove(bookmarksFolder);
223         }
224         catch (NoSuchFolderException nsee) {
225             throw nsee;
226         }
227         catch (Exception e) {
228             throw processException(e);
229         }
230         finally {
231             closeSession(session);
232         }
233     }
234 
235     public BookmarksFolder remove(BookmarksFolder bookmarksFolder)
236         throws SystemException {
237         for (ModelListener<BookmarksFolder> listener : listeners) {
238             listener.onBeforeRemove(bookmarksFolder);
239         }
240 
241         bookmarksFolder = removeImpl(bookmarksFolder);
242 
243         for (ModelListener<BookmarksFolder> listener : listeners) {
244             listener.onAfterRemove(bookmarksFolder);
245         }
246 
247         return bookmarksFolder;
248     }
249 
250     protected BookmarksFolder removeImpl(BookmarksFolder bookmarksFolder)
251         throws SystemException {
252         bookmarksFolder = toUnwrappedModel(bookmarksFolder);
253 
254         Session session = null;
255 
256         try {
257             session = openSession();
258 
259             if (bookmarksFolder.isCachedModel() ||
260                     BatchSessionUtil.isEnabled()) {
261                 Object staleObject = session.get(BookmarksFolderImpl.class,
262                         bookmarksFolder.getPrimaryKeyObj());
263 
264                 if (staleObject != null) {
265                     session.evict(staleObject);
266                 }
267             }
268 
269             session.delete(bookmarksFolder);
270 
271             session.flush();
272         }
273         catch (Exception e) {
274             throw processException(e);
275         }
276         finally {
277             closeSession(session);
278         }
279 
280         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
281 
282         BookmarksFolderModelImpl bookmarksFolderModelImpl = (BookmarksFolderModelImpl)bookmarksFolder;
283 
284         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_UUID_G,
285             new Object[] {
286                 bookmarksFolderModelImpl.getOriginalUuid(),
287                 new Long(bookmarksFolderModelImpl.getOriginalGroupId())
288             });
289 
290         EntityCacheUtil.removeResult(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
291             BookmarksFolderImpl.class, bookmarksFolder.getPrimaryKey());
292 
293         return bookmarksFolder;
294     }
295 
296     /**
297      * @deprecated Use {@link #update(BookmarksFolder, boolean merge)}.
298      */
299     public BookmarksFolder update(BookmarksFolder bookmarksFolder)
300         throws SystemException {
301         if (_log.isWarnEnabled()) {
302             _log.warn(
303                 "Using the deprecated update(BookmarksFolder bookmarksFolder) method. Use update(BookmarksFolder bookmarksFolder, boolean merge) instead.");
304         }
305 
306         return update(bookmarksFolder, false);
307     }
308 
309     /**
310      * Add, update, or merge, the entity. This method also calls the model
311      * listeners to trigger the proper events associated with adding, deleting,
312      * or updating an entity.
313      *
314      * @param  bookmarksFolder the entity to add, update, or merge
315      * @param  merge boolean value for whether to merge the entity. The default
316      *         value is false. Setting merge to true is more expensive and
317      *         should only be true when bookmarksFolder is transient. See
318      *         LEP-5473 for a detailed discussion of this method.
319      * @return the entity that was added, updated, or merged
320      */
321     public BookmarksFolder update(BookmarksFolder bookmarksFolder, boolean merge)
322         throws SystemException {
323         boolean isNew = bookmarksFolder.isNew();
324 
325         for (ModelListener<BookmarksFolder> listener : listeners) {
326             if (isNew) {
327                 listener.onBeforeCreate(bookmarksFolder);
328             }
329             else {
330                 listener.onBeforeUpdate(bookmarksFolder);
331             }
332         }
333 
334         bookmarksFolder = updateImpl(bookmarksFolder, merge);
335 
336         for (ModelListener<BookmarksFolder> listener : listeners) {
337             if (isNew) {
338                 listener.onAfterCreate(bookmarksFolder);
339             }
340             else {
341                 listener.onAfterUpdate(bookmarksFolder);
342             }
343         }
344 
345         return bookmarksFolder;
346     }
347 
348     public BookmarksFolder updateImpl(
349         com.liferay.portlet.bookmarks.model.BookmarksFolder bookmarksFolder,
350         boolean merge) throws SystemException {
351         bookmarksFolder = toUnwrappedModel(bookmarksFolder);
352 
353         boolean isNew = bookmarksFolder.isNew();
354 
355         BookmarksFolderModelImpl bookmarksFolderModelImpl = (BookmarksFolderModelImpl)bookmarksFolder;
356 
357         if (Validator.isNull(bookmarksFolder.getUuid())) {
358             String uuid = PortalUUIDUtil.generate();
359 
360             bookmarksFolder.setUuid(uuid);
361         }
362 
363         Session session = null;
364 
365         try {
366             session = openSession();
367 
368             BatchSessionUtil.update(session, bookmarksFolder, merge);
369 
370             bookmarksFolder.setNew(false);
371         }
372         catch (Exception e) {
373             throw processException(e);
374         }
375         finally {
376             closeSession(session);
377         }
378 
379         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
380 
381         EntityCacheUtil.putResult(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
382             BookmarksFolderImpl.class, bookmarksFolder.getPrimaryKey(),
383             bookmarksFolder);
384 
385         if (!isNew &&
386                 (!Validator.equals(bookmarksFolder.getUuid(),
387                     bookmarksFolderModelImpl.getOriginalUuid()) ||
388                 (bookmarksFolder.getGroupId() != bookmarksFolderModelImpl.getOriginalGroupId()))) {
389             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_UUID_G,
390                 new Object[] {
391                     bookmarksFolderModelImpl.getOriginalUuid(),
392                     new Long(bookmarksFolderModelImpl.getOriginalGroupId())
393                 });
394         }
395 
396         if (isNew ||
397                 (!Validator.equals(bookmarksFolder.getUuid(),
398                     bookmarksFolderModelImpl.getOriginalUuid()) ||
399                 (bookmarksFolder.getGroupId() != bookmarksFolderModelImpl.getOriginalGroupId()))) {
400             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
401                 new Object[] {
402                     bookmarksFolder.getUuid(),
403                     new Long(bookmarksFolder.getGroupId())
404                 }, bookmarksFolder);
405         }
406 
407         return bookmarksFolder;
408     }
409 
410     protected BookmarksFolder toUnwrappedModel(BookmarksFolder bookmarksFolder) {
411         if (bookmarksFolder instanceof BookmarksFolderImpl) {
412             return bookmarksFolder;
413         }
414 
415         BookmarksFolderImpl bookmarksFolderImpl = new BookmarksFolderImpl();
416 
417         bookmarksFolderImpl.setNew(bookmarksFolder.isNew());
418         bookmarksFolderImpl.setPrimaryKey(bookmarksFolder.getPrimaryKey());
419 
420         bookmarksFolderImpl.setUuid(bookmarksFolder.getUuid());
421         bookmarksFolderImpl.setFolderId(bookmarksFolder.getFolderId());
422         bookmarksFolderImpl.setGroupId(bookmarksFolder.getGroupId());
423         bookmarksFolderImpl.setCompanyId(bookmarksFolder.getCompanyId());
424         bookmarksFolderImpl.setUserId(bookmarksFolder.getUserId());
425         bookmarksFolderImpl.setCreateDate(bookmarksFolder.getCreateDate());
426         bookmarksFolderImpl.setModifiedDate(bookmarksFolder.getModifiedDate());
427         bookmarksFolderImpl.setParentFolderId(bookmarksFolder.getParentFolderId());
428         bookmarksFolderImpl.setName(bookmarksFolder.getName());
429         bookmarksFolderImpl.setDescription(bookmarksFolder.getDescription());
430 
431         return bookmarksFolderImpl;
432     }
433 
434     public BookmarksFolder findByPrimaryKey(long folderId)
435         throws NoSuchFolderException, SystemException {
436         BookmarksFolder bookmarksFolder = fetchByPrimaryKey(folderId);
437 
438         if (bookmarksFolder == null) {
439             if (_log.isWarnEnabled()) {
440                 _log.warn("No BookmarksFolder exists with the primary key " +
441                     folderId);
442             }
443 
444             throw new NoSuchFolderException(
445                 "No BookmarksFolder exists with the primary key " + folderId);
446         }
447 
448         return bookmarksFolder;
449     }
450 
451     public BookmarksFolder fetchByPrimaryKey(long folderId)
452         throws SystemException {
453         BookmarksFolder bookmarksFolder = (BookmarksFolder)EntityCacheUtil.getResult(BookmarksFolderModelImpl.ENTITY_CACHE_ENABLED,
454                 BookmarksFolderImpl.class, folderId, this);
455 
456         if (bookmarksFolder == null) {
457             Session session = null;
458 
459             try {
460                 session = openSession();
461 
462                 bookmarksFolder = (BookmarksFolder)session.get(BookmarksFolderImpl.class,
463                         new Long(folderId));
464             }
465             catch (Exception e) {
466                 throw processException(e);
467             }
468             finally {
469                 if (bookmarksFolder != null) {
470                     cacheResult(bookmarksFolder);
471                 }
472 
473                 closeSession(session);
474             }
475         }
476 
477         return bookmarksFolder;
478     }
479 
480     public List<BookmarksFolder> findByUuid(String uuid)
481         throws SystemException {
482         Object[] finderArgs = new Object[] { uuid };
483 
484         List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_UUID,
485                 finderArgs, this);
486 
487         if (list == null) {
488             Session session = null;
489 
490             try {
491                 session = openSession();
492 
493                 StringBuilder query = new StringBuilder();
494 
495                 query.append(
496                     "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
497 
498                 if (uuid == null) {
499                     query.append("bookmarksFolder.uuid IS NULL");
500                 }
501                 else {
502                     query.append("bookmarksFolder.uuid = ?");
503                 }
504 
505                 query.append(" ");
506 
507                 query.append("ORDER BY ");
508 
509                 query.append("bookmarksFolder.parentFolderId ASC, ");
510                 query.append("bookmarksFolder.name ASC");
511 
512                 Query q = session.createQuery(query.toString());
513 
514                 QueryPos qPos = QueryPos.getInstance(q);
515 
516                 if (uuid != null) {
517                     qPos.add(uuid);
518                 }
519 
520                 list = q.list();
521             }
522             catch (Exception e) {
523                 throw processException(e);
524             }
525             finally {
526                 if (list == null) {
527                     list = new ArrayList<BookmarksFolder>();
528                 }
529 
530                 cacheResult(list);
531 
532                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_UUID, finderArgs,
533                     list);
534 
535                 closeSession(session);
536             }
537         }
538 
539         return list;
540     }
541 
542     public List<BookmarksFolder> findByUuid(String uuid, int start, int end)
543         throws SystemException {
544         return findByUuid(uuid, start, end, null);
545     }
546 
547     public List<BookmarksFolder> findByUuid(String uuid, int start, int end,
548         OrderByComparator obc) throws SystemException {
549         Object[] finderArgs = new Object[] {
550                 uuid,
551                 
552                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
553             };
554 
555         List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_UUID,
556                 finderArgs, this);
557 
558         if (list == null) {
559             Session session = null;
560 
561             try {
562                 session = openSession();
563 
564                 StringBuilder query = new StringBuilder();
565 
566                 query.append(
567                     "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
568 
569                 if (uuid == null) {
570                     query.append("bookmarksFolder.uuid IS NULL");
571                 }
572                 else {
573                     query.append("bookmarksFolder.uuid = ?");
574                 }
575 
576                 query.append(" ");
577 
578                 if (obc != null) {
579                     query.append("ORDER BY ");
580 
581                     String[] orderByFields = obc.getOrderByFields();
582 
583                     for (int i = 0; i < orderByFields.length; i++) {
584                         query.append("bookmarksFolder.");
585                         query.append(orderByFields[i]);
586 
587                         if (obc.isAscending()) {
588                             query.append(" ASC");
589                         }
590                         else {
591                             query.append(" DESC");
592                         }
593 
594                         if ((i + 1) < orderByFields.length) {
595                             query.append(", ");
596                         }
597                     }
598                 }
599 
600                 else {
601                     query.append("ORDER BY ");
602 
603                     query.append("bookmarksFolder.parentFolderId ASC, ");
604                     query.append("bookmarksFolder.name ASC");
605                 }
606 
607                 Query q = session.createQuery(query.toString());
608 
609                 QueryPos qPos = QueryPos.getInstance(q);
610 
611                 if (uuid != null) {
612                     qPos.add(uuid);
613                 }
614 
615                 list = (List<BookmarksFolder>)QueryUtil.list(q, getDialect(),
616                         start, end);
617             }
618             catch (Exception e) {
619                 throw processException(e);
620             }
621             finally {
622                 if (list == null) {
623                     list = new ArrayList<BookmarksFolder>();
624                 }
625 
626                 cacheResult(list);
627 
628                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_UUID,
629                     finderArgs, list);
630 
631                 closeSession(session);
632             }
633         }
634 
635         return list;
636     }
637 
638     public BookmarksFolder findByUuid_First(String uuid, OrderByComparator obc)
639         throws NoSuchFolderException, SystemException {
640         List<BookmarksFolder> list = findByUuid(uuid, 0, 1, obc);
641 
642         if (list.isEmpty()) {
643             StringBuilder msg = new StringBuilder();
644 
645             msg.append("No BookmarksFolder exists with the key {");
646 
647             msg.append("uuid=" + uuid);
648 
649             msg.append(StringPool.CLOSE_CURLY_BRACE);
650 
651             throw new NoSuchFolderException(msg.toString());
652         }
653         else {
654             return list.get(0);
655         }
656     }
657 
658     public BookmarksFolder findByUuid_Last(String uuid, OrderByComparator obc)
659         throws NoSuchFolderException, SystemException {
660         int count = countByUuid(uuid);
661 
662         List<BookmarksFolder> list = findByUuid(uuid, count - 1, count, obc);
663 
664         if (list.isEmpty()) {
665             StringBuilder msg = new StringBuilder();
666 
667             msg.append("No BookmarksFolder exists with the key {");
668 
669             msg.append("uuid=" + uuid);
670 
671             msg.append(StringPool.CLOSE_CURLY_BRACE);
672 
673             throw new NoSuchFolderException(msg.toString());
674         }
675         else {
676             return list.get(0);
677         }
678     }
679 
680     public BookmarksFolder[] findByUuid_PrevAndNext(long folderId, String uuid,
681         OrderByComparator obc) throws NoSuchFolderException, SystemException {
682         BookmarksFolder bookmarksFolder = findByPrimaryKey(folderId);
683 
684         int count = countByUuid(uuid);
685 
686         Session session = null;
687 
688         try {
689             session = openSession();
690 
691             StringBuilder query = new StringBuilder();
692 
693             query.append(
694                 "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
695 
696             if (uuid == null) {
697                 query.append("bookmarksFolder.uuid IS NULL");
698             }
699             else {
700                 query.append("bookmarksFolder.uuid = ?");
701             }
702 
703             query.append(" ");
704 
705             if (obc != null) {
706                 query.append("ORDER BY ");
707 
708                 String[] orderByFields = obc.getOrderByFields();
709 
710                 for (int i = 0; i < orderByFields.length; i++) {
711                     query.append("bookmarksFolder.");
712                     query.append(orderByFields[i]);
713 
714                     if (obc.isAscending()) {
715                         query.append(" ASC");
716                     }
717                     else {
718                         query.append(" DESC");
719                     }
720 
721                     if ((i + 1) < orderByFields.length) {
722                         query.append(", ");
723                     }
724                 }
725             }
726 
727             else {
728                 query.append("ORDER BY ");
729 
730                 query.append("bookmarksFolder.parentFolderId ASC, ");
731                 query.append("bookmarksFolder.name ASC");
732             }
733 
734             Query q = session.createQuery(query.toString());
735 
736             QueryPos qPos = QueryPos.getInstance(q);
737 
738             if (uuid != null) {
739                 qPos.add(uuid);
740             }
741 
742             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
743                     bookmarksFolder);
744 
745             BookmarksFolder[] array = new BookmarksFolderImpl[3];
746 
747             array[0] = (BookmarksFolder)objArray[0];
748             array[1] = (BookmarksFolder)objArray[1];
749             array[2] = (BookmarksFolder)objArray[2];
750 
751             return array;
752         }
753         catch (Exception e) {
754             throw processException(e);
755         }
756         finally {
757             closeSession(session);
758         }
759     }
760 
761     public BookmarksFolder findByUUID_G(String uuid, long groupId)
762         throws NoSuchFolderException, SystemException {
763         BookmarksFolder bookmarksFolder = fetchByUUID_G(uuid, groupId);
764 
765         if (bookmarksFolder == null) {
766             StringBuilder msg = new StringBuilder();
767 
768             msg.append("No BookmarksFolder exists with the key {");
769 
770             msg.append("uuid=" + uuid);
771 
772             msg.append(", ");
773             msg.append("groupId=" + groupId);
774 
775             msg.append(StringPool.CLOSE_CURLY_BRACE);
776 
777             if (_log.isWarnEnabled()) {
778                 _log.warn(msg.toString());
779             }
780 
781             throw new NoSuchFolderException(msg.toString());
782         }
783 
784         return bookmarksFolder;
785     }
786 
787     public BookmarksFolder fetchByUUID_G(String uuid, long groupId)
788         throws SystemException {
789         return fetchByUUID_G(uuid, groupId, true);
790     }
791 
792     public BookmarksFolder fetchByUUID_G(String uuid, long groupId,
793         boolean retrieveFromCache) throws SystemException {
794         Object[] finderArgs = new Object[] { uuid, new Long(groupId) };
795 
796         Object result = null;
797 
798         if (retrieveFromCache) {
799             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_UUID_G,
800                     finderArgs, this);
801         }
802 
803         if (result == null) {
804             Session session = null;
805 
806             try {
807                 session = openSession();
808 
809                 StringBuilder query = new StringBuilder();
810 
811                 query.append(
812                     "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
813 
814                 if (uuid == null) {
815                     query.append("bookmarksFolder.uuid IS NULL");
816                 }
817                 else {
818                     query.append("bookmarksFolder.uuid = ?");
819                 }
820 
821                 query.append(" AND ");
822 
823                 query.append("bookmarksFolder.groupId = ?");
824 
825                 query.append(" ");
826 
827                 query.append("ORDER BY ");
828 
829                 query.append("bookmarksFolder.parentFolderId ASC, ");
830                 query.append("bookmarksFolder.name ASC");
831 
832                 Query q = session.createQuery(query.toString());
833 
834                 QueryPos qPos = QueryPos.getInstance(q);
835 
836                 if (uuid != null) {
837                     qPos.add(uuid);
838                 }
839 
840                 qPos.add(groupId);
841 
842                 List<BookmarksFolder> list = q.list();
843 
844                 result = list;
845 
846                 BookmarksFolder bookmarksFolder = null;
847 
848                 if (list.isEmpty()) {
849                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
850                         finderArgs, list);
851                 }
852                 else {
853                     bookmarksFolder = list.get(0);
854 
855                     cacheResult(bookmarksFolder);
856 
857                     if ((bookmarksFolder.getUuid() == null) ||
858                             !bookmarksFolder.getUuid().equals(uuid) ||
859                             (bookmarksFolder.getGroupId() != groupId)) {
860                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
861                             finderArgs, bookmarksFolder);
862                     }
863                 }
864 
865                 return bookmarksFolder;
866             }
867             catch (Exception e) {
868                 throw processException(e);
869             }
870             finally {
871                 if (result == null) {
872                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_UUID_G,
873                         finderArgs, new ArrayList<BookmarksFolder>());
874                 }
875 
876                 closeSession(session);
877             }
878         }
879         else {
880             if (result instanceof List<?>) {
881                 return null;
882             }
883             else {
884                 return (BookmarksFolder)result;
885             }
886         }
887     }
888 
889     public List<BookmarksFolder> findByGroupId(long groupId)
890         throws SystemException {
891         Object[] finderArgs = new Object[] { new Long(groupId) };
892 
893         List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_GROUPID,
894                 finderArgs, this);
895 
896         if (list == null) {
897             Session session = null;
898 
899             try {
900                 session = openSession();
901 
902                 StringBuilder query = new StringBuilder();
903 
904                 query.append(
905                     "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
906 
907                 query.append("bookmarksFolder.groupId = ?");
908 
909                 query.append(" ");
910 
911                 query.append("ORDER BY ");
912 
913                 query.append("bookmarksFolder.parentFolderId ASC, ");
914                 query.append("bookmarksFolder.name ASC");
915 
916                 Query q = session.createQuery(query.toString());
917 
918                 QueryPos qPos = QueryPos.getInstance(q);
919 
920                 qPos.add(groupId);
921 
922                 list = q.list();
923             }
924             catch (Exception e) {
925                 throw processException(e);
926             }
927             finally {
928                 if (list == null) {
929                     list = new ArrayList<BookmarksFolder>();
930                 }
931 
932                 cacheResult(list);
933 
934                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_GROUPID,
935                     finderArgs, list);
936 
937                 closeSession(session);
938             }
939         }
940 
941         return list;
942     }
943 
944     public List<BookmarksFolder> findByGroupId(long groupId, int start, int end)
945         throws SystemException {
946         return findByGroupId(groupId, start, end, null);
947     }
948 
949     public List<BookmarksFolder> findByGroupId(long groupId, int start,
950         int end, OrderByComparator obc) throws SystemException {
951         Object[] finderArgs = new Object[] {
952                 new Long(groupId),
953                 
954                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
955             };
956 
957         List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
958                 finderArgs, this);
959 
960         if (list == null) {
961             Session session = null;
962 
963             try {
964                 session = openSession();
965 
966                 StringBuilder query = new StringBuilder();
967 
968                 query.append(
969                     "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
970 
971                 query.append("bookmarksFolder.groupId = ?");
972 
973                 query.append(" ");
974 
975                 if (obc != null) {
976                     query.append("ORDER BY ");
977 
978                     String[] orderByFields = obc.getOrderByFields();
979 
980                     for (int i = 0; i < orderByFields.length; i++) {
981                         query.append("bookmarksFolder.");
982                         query.append(orderByFields[i]);
983 
984                         if (obc.isAscending()) {
985                             query.append(" ASC");
986                         }
987                         else {
988                             query.append(" DESC");
989                         }
990 
991                         if ((i + 1) < orderByFields.length) {
992                             query.append(", ");
993                         }
994                     }
995                 }
996 
997                 else {
998                     query.append("ORDER BY ");
999 
1000                    query.append("bookmarksFolder.parentFolderId ASC, ");
1001                    query.append("bookmarksFolder.name ASC");
1002                }
1003
1004                Query q = session.createQuery(query.toString());
1005
1006                QueryPos qPos = QueryPos.getInstance(q);
1007
1008                qPos.add(groupId);
1009
1010                list = (List<BookmarksFolder>)QueryUtil.list(q, getDialect(),
1011                        start, end);
1012            }
1013            catch (Exception e) {
1014                throw processException(e);
1015            }
1016            finally {
1017                if (list == null) {
1018                    list = new ArrayList<BookmarksFolder>();
1019                }
1020
1021                cacheResult(list);
1022
1023                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
1024                    finderArgs, list);
1025
1026                closeSession(session);
1027            }
1028        }
1029
1030        return list;
1031    }
1032
1033    public BookmarksFolder findByGroupId_First(long groupId,
1034        OrderByComparator obc) throws NoSuchFolderException, SystemException {
1035        List<BookmarksFolder> list = findByGroupId(groupId, 0, 1, obc);
1036
1037        if (list.isEmpty()) {
1038            StringBuilder msg = new StringBuilder();
1039
1040            msg.append("No BookmarksFolder exists with the key {");
1041
1042            msg.append("groupId=" + groupId);
1043
1044            msg.append(StringPool.CLOSE_CURLY_BRACE);
1045
1046            throw new NoSuchFolderException(msg.toString());
1047        }
1048        else {
1049            return list.get(0);
1050        }
1051    }
1052
1053    public BookmarksFolder findByGroupId_Last(long groupId,
1054        OrderByComparator obc) throws NoSuchFolderException, SystemException {
1055        int count = countByGroupId(groupId);
1056
1057        List<BookmarksFolder> list = findByGroupId(groupId, count - 1, count,
1058                obc);
1059
1060        if (list.isEmpty()) {
1061            StringBuilder msg = new StringBuilder();
1062
1063            msg.append("No BookmarksFolder exists with the key {");
1064
1065            msg.append("groupId=" + groupId);
1066
1067            msg.append(StringPool.CLOSE_CURLY_BRACE);
1068
1069            throw new NoSuchFolderException(msg.toString());
1070        }
1071        else {
1072            return list.get(0);
1073        }
1074    }
1075
1076    public BookmarksFolder[] findByGroupId_PrevAndNext(long folderId,
1077        long groupId, OrderByComparator obc)
1078        throws NoSuchFolderException, SystemException {
1079        BookmarksFolder bookmarksFolder = findByPrimaryKey(folderId);
1080
1081        int count = countByGroupId(groupId);
1082
1083        Session session = null;
1084
1085        try {
1086            session = openSession();
1087
1088            StringBuilder query = new StringBuilder();
1089
1090            query.append(
1091                "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
1092
1093            query.append("bookmarksFolder.groupId = ?");
1094
1095            query.append(" ");
1096
1097            if (obc != null) {
1098                query.append("ORDER BY ");
1099
1100                String[] orderByFields = obc.getOrderByFields();
1101
1102                for (int i = 0; i < orderByFields.length; i++) {
1103                    query.append("bookmarksFolder.");
1104                    query.append(orderByFields[i]);
1105
1106                    if (obc.isAscending()) {
1107                        query.append(" ASC");
1108                    }
1109                    else {
1110                        query.append(" DESC");
1111                    }
1112
1113                    if ((i + 1) < orderByFields.length) {
1114                        query.append(", ");
1115                    }
1116                }
1117            }
1118
1119            else {
1120                query.append("ORDER BY ");
1121
1122                query.append("bookmarksFolder.parentFolderId ASC, ");
1123                query.append("bookmarksFolder.name ASC");
1124            }
1125
1126            Query q = session.createQuery(query.toString());
1127
1128            QueryPos qPos = QueryPos.getInstance(q);
1129
1130            qPos.add(groupId);
1131
1132            Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1133                    bookmarksFolder);
1134
1135            BookmarksFolder[] array = new BookmarksFolderImpl[3];
1136
1137            array[0] = (BookmarksFolder)objArray[0];
1138            array[1] = (BookmarksFolder)objArray[1];
1139            array[2] = (BookmarksFolder)objArray[2];
1140
1141            return array;
1142        }
1143        catch (Exception e) {
1144            throw processException(e);
1145        }
1146        finally {
1147            closeSession(session);
1148        }
1149    }
1150
1151    public List<BookmarksFolder> findByCompanyId(long companyId)
1152        throws SystemException {
1153        Object[] finderArgs = new Object[] { new Long(companyId) };
1154
1155        List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
1156                finderArgs, this);
1157
1158        if (list == null) {
1159            Session session = null;
1160
1161            try {
1162                session = openSession();
1163
1164                StringBuilder query = new StringBuilder();
1165
1166                query.append(
1167                    "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
1168
1169                query.append("bookmarksFolder.companyId = ?");
1170
1171                query.append(" ");
1172
1173                query.append("ORDER BY ");
1174
1175                query.append("bookmarksFolder.parentFolderId ASC, ");
1176                query.append("bookmarksFolder.name ASC");
1177
1178                Query q = session.createQuery(query.toString());
1179
1180                QueryPos qPos = QueryPos.getInstance(q);
1181
1182                qPos.add(companyId);
1183
1184                list = q.list();
1185            }
1186            catch (Exception e) {
1187                throw processException(e);
1188            }
1189            finally {
1190                if (list == null) {
1191                    list = new ArrayList<BookmarksFolder>();
1192                }
1193
1194                cacheResult(list);
1195
1196                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
1197                    finderArgs, list);
1198
1199                closeSession(session);
1200            }
1201        }
1202
1203        return list;
1204    }
1205
1206    public List<BookmarksFolder> findByCompanyId(long companyId, int start,
1207        int end) throws SystemException {
1208        return findByCompanyId(companyId, start, end, null);
1209    }
1210
1211    public List<BookmarksFolder> findByCompanyId(long companyId, int start,
1212        int end, OrderByComparator obc) throws SystemException {
1213        Object[] finderArgs = new Object[] {
1214                new Long(companyId),
1215                
1216                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1217            };
1218
1219        List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
1220                finderArgs, this);
1221
1222        if (list == null) {
1223            Session session = null;
1224
1225            try {
1226                session = openSession();
1227
1228                StringBuilder query = new StringBuilder();
1229
1230                query.append(
1231                    "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
1232
1233                query.append("bookmarksFolder.companyId = ?");
1234
1235                query.append(" ");
1236
1237                if (obc != null) {
1238                    query.append("ORDER BY ");
1239
1240                    String[] orderByFields = obc.getOrderByFields();
1241
1242                    for (int i = 0; i < orderByFields.length; i++) {
1243                        query.append("bookmarksFolder.");
1244                        query.append(orderByFields[i]);
1245
1246                        if (obc.isAscending()) {
1247                            query.append(" ASC");
1248                        }
1249                        else {
1250                            query.append(" DESC");
1251                        }
1252
1253                        if ((i + 1) < orderByFields.length) {
1254                            query.append(", ");
1255                        }
1256                    }
1257                }
1258
1259                else {
1260                    query.append("ORDER BY ");
1261
1262                    query.append("bookmarksFolder.parentFolderId ASC, ");
1263                    query.append("bookmarksFolder.name ASC");
1264                }
1265
1266                Query q = session.createQuery(query.toString());
1267
1268                QueryPos qPos = QueryPos.getInstance(q);
1269
1270                qPos.add(companyId);
1271
1272                list = (List<BookmarksFolder>)QueryUtil.list(q, getDialect(),
1273                        start, end);
1274            }
1275            catch (Exception e) {
1276                throw processException(e);
1277            }
1278            finally {
1279                if (list == null) {
1280                    list = new ArrayList<BookmarksFolder>();
1281                }
1282
1283                cacheResult(list);
1284
1285                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
1286                    finderArgs, list);
1287
1288                closeSession(session);
1289            }
1290        }
1291
1292        return list;
1293    }
1294
1295    public BookmarksFolder findByCompanyId_First(long companyId,
1296        OrderByComparator obc) throws NoSuchFolderException, SystemException {
1297        List<BookmarksFolder> list = findByCompanyId(companyId, 0, 1, obc);
1298
1299        if (list.isEmpty()) {
1300            StringBuilder msg = new StringBuilder();
1301
1302            msg.append("No BookmarksFolder exists with the key {");
1303
1304            msg.append("companyId=" + companyId);
1305
1306            msg.append(StringPool.CLOSE_CURLY_BRACE);
1307
1308            throw new NoSuchFolderException(msg.toString());
1309        }
1310        else {
1311            return list.get(0);
1312        }
1313    }
1314
1315    public BookmarksFolder findByCompanyId_Last(long companyId,
1316        OrderByComparator obc) throws NoSuchFolderException, SystemException {
1317        int count = countByCompanyId(companyId);
1318
1319        List<BookmarksFolder> list = findByCompanyId(companyId, count - 1,
1320                count, obc);
1321
1322        if (list.isEmpty()) {
1323            StringBuilder msg = new StringBuilder();
1324
1325            msg.append("No BookmarksFolder exists with the key {");
1326
1327            msg.append("companyId=" + companyId);
1328
1329            msg.append(StringPool.CLOSE_CURLY_BRACE);
1330
1331            throw new NoSuchFolderException(msg.toString());
1332        }
1333        else {
1334            return list.get(0);
1335        }
1336    }
1337
1338    public BookmarksFolder[] findByCompanyId_PrevAndNext(long folderId,
1339        long companyId, OrderByComparator obc)
1340        throws NoSuchFolderException, SystemException {
1341        BookmarksFolder bookmarksFolder = findByPrimaryKey(folderId);
1342
1343        int count = countByCompanyId(companyId);
1344
1345        Session session = null;
1346
1347        try {
1348            session = openSession();
1349
1350            StringBuilder query = new StringBuilder();
1351
1352            query.append(
1353                "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
1354
1355            query.append("bookmarksFolder.companyId = ?");
1356
1357            query.append(" ");
1358
1359            if (obc != null) {
1360                query.append("ORDER BY ");
1361
1362                String[] orderByFields = obc.getOrderByFields();
1363
1364                for (int i = 0; i < orderByFields.length; i++) {
1365                    query.append("bookmarksFolder.");
1366                    query.append(orderByFields[i]);
1367
1368                    if (obc.isAscending()) {
1369                        query.append(" ASC");
1370                    }
1371                    else {
1372                        query.append(" DESC");
1373                    }
1374
1375                    if ((i + 1) < orderByFields.length) {
1376                        query.append(", ");
1377                    }
1378                }
1379            }
1380
1381            else {
1382                query.append("ORDER BY ");
1383
1384                query.append("bookmarksFolder.parentFolderId ASC, ");
1385                query.append("bookmarksFolder.name ASC");
1386            }
1387
1388            Query q = session.createQuery(query.toString());
1389
1390            QueryPos qPos = QueryPos.getInstance(q);
1391
1392            qPos.add(companyId);
1393
1394            Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1395                    bookmarksFolder);
1396
1397            BookmarksFolder[] array = new BookmarksFolderImpl[3];
1398
1399            array[0] = (BookmarksFolder)objArray[0];
1400            array[1] = (BookmarksFolder)objArray[1];
1401            array[2] = (BookmarksFolder)objArray[2];
1402
1403            return array;
1404        }
1405        catch (Exception e) {
1406            throw processException(e);
1407        }
1408        finally {
1409            closeSession(session);
1410        }
1411    }
1412
1413    public List<BookmarksFolder> findByG_P(long groupId, long parentFolderId)
1414        throws SystemException {
1415        Object[] finderArgs = new Object[] {
1416                new Long(groupId), new Long(parentFolderId)
1417            };
1418
1419        List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_P,
1420                finderArgs, this);
1421
1422        if (list == null) {
1423            Session session = null;
1424
1425            try {
1426                session = openSession();
1427
1428                StringBuilder query = new StringBuilder();
1429
1430                query.append(
1431                    "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
1432
1433                query.append("bookmarksFolder.groupId = ?");
1434
1435                query.append(" AND ");
1436
1437                query.append("bookmarksFolder.parentFolderId = ?");
1438
1439                query.append(" ");
1440
1441                query.append("ORDER BY ");
1442
1443                query.append("bookmarksFolder.parentFolderId ASC, ");
1444                query.append("bookmarksFolder.name ASC");
1445
1446                Query q = session.createQuery(query.toString());
1447
1448                QueryPos qPos = QueryPos.getInstance(q);
1449
1450                qPos.add(groupId);
1451
1452                qPos.add(parentFolderId);
1453
1454                list = q.list();
1455            }
1456            catch (Exception e) {
1457                throw processException(e);
1458            }
1459            finally {
1460                if (list == null) {
1461                    list = new ArrayList<BookmarksFolder>();
1462                }
1463
1464                cacheResult(list);
1465
1466                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_P, finderArgs,
1467                    list);
1468
1469                closeSession(session);
1470            }
1471        }
1472
1473        return list;
1474    }
1475
1476    public List<BookmarksFolder> findByG_P(long groupId, long parentFolderId,
1477        int start, int end) throws SystemException {
1478        return findByG_P(groupId, parentFolderId, start, end, null);
1479    }
1480
1481    public List<BookmarksFolder> findByG_P(long groupId, long parentFolderId,
1482        int start, int end, OrderByComparator obc) throws SystemException {
1483        Object[] finderArgs = new Object[] {
1484                new Long(groupId), new Long(parentFolderId),
1485                
1486                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1487            };
1488
1489        List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_P,
1490                finderArgs, this);
1491
1492        if (list == null) {
1493            Session session = null;
1494
1495            try {
1496                session = openSession();
1497
1498                StringBuilder query = new StringBuilder();
1499
1500                query.append(
1501                    "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
1502
1503                query.append("bookmarksFolder.groupId = ?");
1504
1505                query.append(" AND ");
1506
1507                query.append("bookmarksFolder.parentFolderId = ?");
1508
1509                query.append(" ");
1510
1511                if (obc != null) {
1512                    query.append("ORDER BY ");
1513
1514                    String[] orderByFields = obc.getOrderByFields();
1515
1516                    for (int i = 0; i < orderByFields.length; i++) {
1517                        query.append("bookmarksFolder.");
1518                        query.append(orderByFields[i]);
1519
1520                        if (obc.isAscending()) {
1521                            query.append(" ASC");
1522                        }
1523                        else {
1524                            query.append(" DESC");
1525                        }
1526
1527                        if ((i + 1) < orderByFields.length) {
1528                            query.append(", ");
1529                        }
1530                    }
1531                }
1532
1533                else {
1534                    query.append("ORDER BY ");
1535
1536                    query.append("bookmarksFolder.parentFolderId ASC, ");
1537                    query.append("bookmarksFolder.name ASC");
1538                }
1539
1540                Query q = session.createQuery(query.toString());
1541
1542                QueryPos qPos = QueryPos.getInstance(q);
1543
1544                qPos.add(groupId);
1545
1546                qPos.add(parentFolderId);
1547
1548                list = (List<BookmarksFolder>)QueryUtil.list(q, getDialect(),
1549                        start, end);
1550            }
1551            catch (Exception e) {
1552                throw processException(e);
1553            }
1554            finally {
1555                if (list == null) {
1556                    list = new ArrayList<BookmarksFolder>();
1557                }
1558
1559                cacheResult(list);
1560
1561                FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_P,
1562                    finderArgs, list);
1563
1564                closeSession(session);
1565            }
1566        }
1567
1568        return list;
1569    }
1570
1571    public BookmarksFolder findByG_P_First(long groupId, long parentFolderId,
1572        OrderByComparator obc) throws NoSuchFolderException, SystemException {
1573        List<BookmarksFolder> list = findByG_P(groupId, parentFolderId, 0, 1,
1574                obc);
1575
1576        if (list.isEmpty()) {
1577            StringBuilder msg = new StringBuilder();
1578
1579            msg.append("No BookmarksFolder exists with the key {");
1580
1581            msg.append("groupId=" + groupId);
1582
1583            msg.append(", ");
1584            msg.append("parentFolderId=" + parentFolderId);
1585
1586            msg.append(StringPool.CLOSE_CURLY_BRACE);
1587
1588            throw new NoSuchFolderException(msg.toString());
1589        }
1590        else {
1591            return list.get(0);
1592        }
1593    }
1594
1595    public BookmarksFolder findByG_P_Last(long groupId, long parentFolderId,
1596        OrderByComparator obc) throws NoSuchFolderException, SystemException {
1597        int count = countByG_P(groupId, parentFolderId);
1598
1599        List<BookmarksFolder> list = findByG_P(groupId, parentFolderId,
1600                count - 1, count, obc);
1601
1602        if (list.isEmpty()) {
1603            StringBuilder msg = new StringBuilder();
1604
1605            msg.append("No BookmarksFolder exists with the key {");
1606
1607            msg.append("groupId=" + groupId);
1608
1609            msg.append(", ");
1610            msg.append("parentFolderId=" + parentFolderId);
1611
1612            msg.append(StringPool.CLOSE_CURLY_BRACE);
1613
1614            throw new NoSuchFolderException(msg.toString());
1615        }
1616        else {
1617            return list.get(0);
1618        }
1619    }
1620
1621    public BookmarksFolder[] findByG_P_PrevAndNext(long folderId, long groupId,
1622        long parentFolderId, OrderByComparator obc)
1623        throws NoSuchFolderException, SystemException {
1624        BookmarksFolder bookmarksFolder = findByPrimaryKey(folderId);
1625
1626        int count = countByG_P(groupId, parentFolderId);
1627
1628        Session session = null;
1629
1630        try {
1631            session = openSession();
1632
1633            StringBuilder query = new StringBuilder();
1634
1635            query.append(
1636                "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder WHERE ");
1637
1638            query.append("bookmarksFolder.groupId = ?");
1639
1640            query.append(" AND ");
1641
1642            query.append("bookmarksFolder.parentFolderId = ?");
1643
1644            query.append(" ");
1645
1646            if (obc != null) {
1647                query.append("ORDER BY ");
1648
1649                String[] orderByFields = obc.getOrderByFields();
1650
1651                for (int i = 0; i < orderByFields.length; i++) {
1652                    query.append("bookmarksFolder.");
1653                    query.append(orderByFields[i]);
1654
1655                    if (obc.isAscending()) {
1656                        query.append(" ASC");
1657                    }
1658                    else {
1659                        query.append(" DESC");
1660                    }
1661
1662                    if ((i + 1) < orderByFields.length) {
1663                        query.append(", ");
1664                    }
1665                }
1666            }
1667
1668            else {
1669                query.append("ORDER BY ");
1670
1671                query.append("bookmarksFolder.parentFolderId ASC, ");
1672                query.append("bookmarksFolder.name ASC");
1673            }
1674
1675            Query q = session.createQuery(query.toString());
1676
1677            QueryPos qPos = QueryPos.getInstance(q);
1678
1679            qPos.add(groupId);
1680
1681            qPos.add(parentFolderId);
1682
1683            Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1684                    bookmarksFolder);
1685
1686            BookmarksFolder[] array = new BookmarksFolderImpl[3];
1687
1688            array[0] = (BookmarksFolder)objArray[0];
1689            array[1] = (BookmarksFolder)objArray[1];
1690            array[2] = (BookmarksFolder)objArray[2];
1691
1692            return array;
1693        }
1694        catch (Exception e) {
1695            throw processException(e);
1696        }
1697        finally {
1698            closeSession(session);
1699        }
1700    }
1701
1702    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
1703        throws SystemException {
1704        Session session = null;
1705
1706        try {
1707            session = openSession();
1708
1709            dynamicQuery.compile(session);
1710
1711            return dynamicQuery.list();
1712        }
1713        catch (Exception e) {
1714            throw processException(e);
1715        }
1716        finally {
1717            closeSession(session);
1718        }
1719    }
1720
1721    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
1722        int start, int end) throws SystemException {
1723        Session session = null;
1724
1725        try {
1726            session = openSession();
1727
1728            dynamicQuery.setLimit(start, end);
1729
1730            dynamicQuery.compile(session);
1731
1732            return dynamicQuery.list();
1733        }
1734        catch (Exception e) {
1735            throw processException(e);
1736        }
1737        finally {
1738            closeSession(session);
1739        }
1740    }
1741
1742    public List<BookmarksFolder> findAll() throws SystemException {
1743        return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1744    }
1745
1746    public List<BookmarksFolder> findAll(int start, int end)
1747        throws SystemException {
1748        return findAll(start, end, null);
1749    }
1750
1751    public List<BookmarksFolder> findAll(int start, int end,
1752        OrderByComparator obc) throws SystemException {
1753        Object[] finderArgs = new Object[] {
1754                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1755            };
1756
1757        List<BookmarksFolder> list = (List<BookmarksFolder>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1758                finderArgs, this);
1759
1760        if (list == null) {
1761            Session session = null;
1762
1763            try {
1764                session = openSession();
1765
1766                StringBuilder query = new StringBuilder();
1767
1768                query.append(
1769                    "SELECT bookmarksFolder FROM BookmarksFolder bookmarksFolder ");
1770
1771                if (obc != null) {
1772                    query.append("ORDER BY ");
1773
1774                    String[] orderByFields = obc.getOrderByFields();
1775
1776                    for (int i = 0; i < orderByFields.length; i++) {
1777                        query.append("bookmarksFolder.");
1778                        query.append(orderByFields[i]);
1779
1780                        if (obc.isAscending()) {
1781                            query.append(" ASC");
1782                        }
1783                        else {
1784                            query.append(" DESC");
1785                        }
1786
1787                        if ((i + 1) < orderByFields.length) {
1788                            query.append(", ");
1789                        }
1790                    }
1791                }
1792
1793                else {
1794                    query.append("ORDER BY ");
1795
1796                    query.append("bookmarksFolder.parentFolderId ASC, ");
1797                    query.append("bookmarksFolder.name ASC");
1798                }
1799
1800                Query q = session.createQuery(query.toString());
1801
1802                if (obc == null) {
1803                    list = (List<BookmarksFolder>)QueryUtil.list(q,
1804                            getDialect(), start, end, false);
1805
1806                    Collections.sort(list);
1807                }
1808                else {
1809                    list = (List<BookmarksFolder>)QueryUtil.list(q,
1810                            getDialect(), start, end);
1811                }
1812            }
1813            catch (Exception e) {
1814                throw processException(e);
1815            }
1816            finally {
1817                if (list == null) {
1818                    list = new ArrayList<BookmarksFolder>();
1819                }
1820
1821                cacheResult(list);
1822
1823                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1824
1825                closeSession(session);
1826            }
1827        }
1828
1829        return list;
1830    }
1831
1832    public void removeByUuid(String uuid) throws SystemException {
1833        for (BookmarksFolder bookmarksFolder : findByUuid(uuid)) {
1834            remove(bookmarksFolder);
1835        }
1836    }
1837
1838    public void removeByUUID_G(String uuid, long groupId)
1839        throws NoSuchFolderException, SystemException {
1840        BookmarksFolder bookmarksFolder = findByUUID_G(uuid, groupId);
1841
1842        remove(bookmarksFolder);
1843    }
1844
1845    public void removeByGroupId(long groupId) throws SystemException {
1846        for (BookmarksFolder bookmarksFolder : findByGroupId(groupId)) {
1847            remove(bookmarksFolder);
1848        }
1849    }
1850
1851    public void removeByCompanyId(long companyId) throws SystemException {
1852        for (BookmarksFolder bookmarksFolder : findByCompanyId(companyId)) {
1853            remove(bookmarksFolder);
1854        }
1855    }
1856
1857    public void removeByG_P(long groupId, long parentFolderId)
1858        throws SystemException {
1859        for (BookmarksFolder bookmarksFolder : findByG_P(groupId, parentFolderId)) {
1860            remove(bookmarksFolder);
1861        }
1862    }
1863
1864    public void removeAll() throws SystemException {
1865        for (BookmarksFolder bookmarksFolder : findAll()) {
1866            remove(bookmarksFolder);
1867        }
1868    }
1869
1870    public int countByUuid(String uuid) throws SystemException {
1871        Object[] finderArgs = new Object[] { uuid };
1872
1873        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_UUID,
1874                finderArgs, this);
1875
1876        if (count == null) {
1877            Session session = null;
1878
1879            try {
1880                session = openSession();
1881
1882                StringBuilder query = new StringBuilder();
1883
1884                query.append("SELECT COUNT(bookmarksFolder) ");
1885                query.append("FROM BookmarksFolder bookmarksFolder WHERE ");
1886
1887                if (uuid == null) {
1888                    query.append("bookmarksFolder.uuid IS NULL");
1889                }
1890                else {
1891                    query.append("bookmarksFolder.uuid = ?");
1892                }
1893
1894                query.append(" ");
1895
1896                Query q = session.createQuery(query.toString());
1897
1898                QueryPos qPos = QueryPos.getInstance(q);
1899
1900                if (uuid != null) {
1901                    qPos.add(uuid);
1902                }
1903
1904                count = (Long)q.uniqueResult();
1905            }
1906            catch (Exception e) {
1907                throw processException(e);
1908            }
1909            finally {
1910                if (count == null) {
1911                    count = Long.valueOf(0);
1912                }
1913
1914                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_UUID,
1915                    finderArgs, count);
1916
1917                closeSession(session);
1918            }
1919        }
1920
1921        return count.intValue();
1922    }
1923
1924    public int countByUUID_G(String uuid, long groupId)
1925        throws SystemException {
1926        Object[] finderArgs = new Object[] { uuid, new Long(groupId) };
1927
1928        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_UUID_G,
1929                finderArgs, this);
1930
1931        if (count == null) {
1932            Session session = null;
1933
1934            try {
1935                session = openSession();
1936
1937                StringBuilder query = new StringBuilder();
1938
1939                query.append("SELECT COUNT(bookmarksFolder) ");
1940                query.append("FROM BookmarksFolder bookmarksFolder WHERE ");
1941
1942                if (uuid == null) {
1943                    query.append("bookmarksFolder.uuid IS NULL");
1944                }
1945                else {
1946                    query.append("bookmarksFolder.uuid = ?");
1947                }
1948
1949                query.append(" AND ");
1950
1951                query.append("bookmarksFolder.groupId = ?");
1952
1953                query.append(" ");
1954
1955                Query q = session.createQuery(query.toString());
1956
1957                QueryPos qPos = QueryPos.getInstance(q);
1958
1959                if (uuid != null) {
1960                    qPos.add(uuid);
1961                }
1962
1963                qPos.add(groupId);
1964
1965                count = (Long)q.uniqueResult();
1966            }
1967            catch (Exception e) {
1968                throw processException(e);
1969            }
1970            finally {
1971                if (count == null) {
1972                    count = Long.valueOf(0);
1973                }
1974
1975                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_UUID_G,
1976                    finderArgs, count);
1977
1978                closeSession(session);
1979            }
1980        }
1981
1982        return count.intValue();
1983    }
1984
1985    public int countByGroupId(long groupId) throws SystemException {
1986        Object[] finderArgs = new Object[] { new Long(groupId) };
1987
1988        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
1989                finderArgs, this);
1990
1991        if (count == null) {
1992            Session session = null;
1993
1994            try {
1995                session = openSession();
1996
1997                StringBuilder query = new StringBuilder();
1998
1999                query.append("SELECT COUNT(bookmarksFolder) ");
2000                query.append("FROM BookmarksFolder bookmarksFolder WHERE ");
2001
2002                query.append("bookmarksFolder.groupId = ?");
2003
2004                query.append(" ");
2005
2006                Query q = session.createQuery(query.toString());
2007
2008                QueryPos qPos = QueryPos.getInstance(q);
2009
2010                qPos.add(groupId);
2011
2012                count = (Long)q.uniqueResult();
2013            }
2014            catch (Exception e) {
2015                throw processException(e);
2016            }
2017            finally {
2018                if (count == null) {
2019                    count = Long.valueOf(0);
2020                }
2021
2022                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
2023                    finderArgs, count);
2024
2025                closeSession(session);
2026            }
2027        }
2028
2029        return count.intValue();
2030    }
2031
2032    public int countByCompanyId(long companyId) throws SystemException {
2033        Object[] finderArgs = new Object[] { new Long(companyId) };
2034
2035        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
2036                finderArgs, this);
2037
2038        if (count == null) {
2039            Session session = null;
2040
2041            try {
2042                session = openSession();
2043
2044                StringBuilder query = new StringBuilder();
2045
2046                query.append("SELECT COUNT(bookmarksFolder) ");
2047                query.append("FROM BookmarksFolder bookmarksFolder WHERE ");
2048
2049                query.append("bookmarksFolder.companyId = ?");
2050
2051                query.append(" ");
2052
2053                Query q = session.createQuery(query.toString());
2054
2055                QueryPos qPos = QueryPos.getInstance(q);
2056
2057                qPos.add(companyId);
2058
2059                count = (Long)q.uniqueResult();
2060            }
2061            catch (Exception e) {
2062                throw processException(e);
2063            }
2064            finally {
2065                if (count == null) {
2066                    count = Long.valueOf(0);
2067                }
2068
2069                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
2070                    finderArgs, count);
2071
2072                closeSession(session);
2073            }
2074        }
2075
2076        return count.intValue();
2077    }
2078
2079    public int countByG_P(long groupId, long parentFolderId)
2080        throws SystemException {
2081        Object[] finderArgs = new Object[] {
2082                new Long(groupId), new Long(parentFolderId)
2083            };
2084
2085        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_P,
2086                finderArgs, this);
2087
2088        if (count == null) {
2089            Session session = null;
2090
2091            try {
2092                session = openSession();
2093
2094                StringBuilder query = new StringBuilder();
2095
2096                query.append("SELECT COUNT(bookmarksFolder) ");
2097                query.append("FROM BookmarksFolder bookmarksFolder WHERE ");
2098
2099                query.append("bookmarksFolder.groupId = ?");
2100
2101                query.append(" AND ");
2102
2103                query.append("bookmarksFolder.parentFolderId = ?");
2104
2105                query.append(" ");
2106
2107                Query q = session.createQuery(query.toString());
2108
2109                QueryPos qPos = QueryPos.getInstance(q);
2110
2111                qPos.add(groupId);
2112
2113                qPos.add(parentFolderId);
2114
2115                count = (Long)q.uniqueResult();
2116            }
2117            catch (Exception e) {
2118                throw processException(e);
2119            }
2120            finally {
2121                if (count == null) {
2122                    count = Long.valueOf(0);
2123                }
2124
2125                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_P, finderArgs,
2126                    count);
2127
2128                closeSession(session);
2129            }
2130        }
2131
2132        return count.intValue();
2133    }
2134
2135    public int countAll() throws SystemException {
2136        Object[] finderArgs = new Object[0];
2137
2138        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
2139                finderArgs, this);
2140
2141        if (count == null) {
2142            Session session = null;
2143
2144            try {
2145                session = openSession();
2146
2147                Query q = session.createQuery(
2148                        "SELECT COUNT(bookmarksFolder) FROM BookmarksFolder bookmarksFolder");
2149
2150                count = (Long)q.uniqueResult();
2151            }
2152            catch (Exception e) {
2153                throw processException(e);
2154            }
2155            finally {
2156                if (count == null) {
2157                    count = Long.valueOf(0);
2158                }
2159
2160                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
2161                    count);
2162
2163                closeSession(session);
2164            }
2165        }
2166
2167        return count.intValue();
2168    }
2169
2170    public void afterPropertiesSet() {
2171        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
2172                    com.liferay.portal.util.PropsUtil.get(
2173                        "value.object.listener.com.liferay.portlet.bookmarks.model.BookmarksFolder")));
2174
2175        if (listenerClassNames.length > 0) {
2176            try {
2177                List<ModelListener<BookmarksFolder>> listenersList = new ArrayList<ModelListener<BookmarksFolder>>();
2178
2179                for (String listenerClassName : listenerClassNames) {
2180                    listenersList.add((ModelListener<BookmarksFolder>)Class.forName(
2181                            listenerClassName).newInstance());
2182                }
2183
2184                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
2185            }
2186            catch (Exception e) {
2187                _log.error(e);
2188            }
2189        }
2190    }
2191
2192    @BeanReference(name = "com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence.impl")
2193    protected com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence bookmarksEntryPersistence;
2194    @BeanReference(name = "com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence.impl")
2195    protected com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence bookmarksFolderPersistence;
2196    @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence.impl")
2197    protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
2198    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
2199    protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
2200    @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
2201    protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
2202    @BeanReference(name = "com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence.impl")
2203    protected com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence expandoValuePersistence;
2204    private static Log _log = LogFactoryUtil.getLog(BookmarksFolderPersistenceImpl.class);
2205}