1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.tags.service.persistence;
16  
17  import com.liferay.portal.NoSuchModelException;
18  import com.liferay.portal.SystemException;
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.cache.CacheRegistry;
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.log.Log;
29  import com.liferay.portal.kernel.log.LogFactoryUtil;
30  import com.liferay.portal.kernel.util.GetterUtil;
31  import com.liferay.portal.kernel.util.InstanceFactory;
32  import com.liferay.portal.kernel.util.OrderByComparator;
33  import com.liferay.portal.kernel.util.StringBundler;
34  import com.liferay.portal.kernel.util.StringPool;
35  import com.liferay.portal.kernel.util.StringUtil;
36  import com.liferay.portal.kernel.util.Validator;
37  import com.liferay.portal.model.ModelListener;
38  import com.liferay.portal.service.persistence.BatchSessionUtil;
39  import com.liferay.portal.service.persistence.ResourcePersistence;
40  import com.liferay.portal.service.persistence.UserPersistence;
41  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
42  
43  import com.liferay.portlet.tags.NoSuchVocabularyException;
44  import com.liferay.portlet.tags.model.TagsVocabulary;
45  import com.liferay.portlet.tags.model.impl.TagsVocabularyImpl;
46  import com.liferay.portlet.tags.model.impl.TagsVocabularyModelImpl;
47  
48  import java.io.Serializable;
49  
50  import java.util.ArrayList;
51  import java.util.Collections;
52  import java.util.List;
53  
54  /**
55   * <a href="TagsVocabularyPersistenceImpl.java.html"><b><i>View Source</i></b></a>
56   *
57   * <p>
58   * ServiceBuilder generated this class. Modifications in this class will be
59   * overwritten the next time is generated.
60   * </p>
61   *
62   * @author    Brian Wing Shun Chan
63   * @see       TagsVocabularyPersistence
64   * @see       TagsVocabularyUtil
65   * @generated
66   */
67  public class TagsVocabularyPersistenceImpl extends BasePersistenceImpl<TagsVocabulary>
68      implements TagsVocabularyPersistence {
69      public static final String FINDER_CLASS_NAME_ENTITY = TagsVocabularyImpl.class.getName();
70      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
71          ".List";
72      public static final FinderPath FINDER_PATH_FETCH_BY_G_N = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
73              TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
74              FINDER_CLASS_NAME_ENTITY, "fetchByG_N",
75              new String[] { Long.class.getName(), String.class.getName() });
76      public static final FinderPath FINDER_PATH_COUNT_BY_G_N = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
77              TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
78              FINDER_CLASS_NAME_LIST, "countByG_N",
79              new String[] { Long.class.getName(), String.class.getName() });
80      public static final FinderPath FINDER_PATH_FIND_BY_G_F = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
81              TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
82              FINDER_CLASS_NAME_LIST, "findByG_F",
83              new String[] {
84                  Long.class.getName(), Boolean.class.getName(),
85                  
86              "java.lang.Integer", "java.lang.Integer",
87                  "com.liferay.portal.kernel.util.OrderByComparator"
88              });
89      public static final FinderPath FINDER_PATH_COUNT_BY_G_F = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
90              TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
91              FINDER_CLASS_NAME_LIST, "countByG_F",
92              new String[] { Long.class.getName(), Boolean.class.getName() });
93      public static final FinderPath FINDER_PATH_FIND_BY_C_F = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
94              TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
95              FINDER_CLASS_NAME_LIST, "findByC_F",
96              new String[] {
97                  Long.class.getName(), Boolean.class.getName(),
98                  
99              "java.lang.Integer", "java.lang.Integer",
100                 "com.liferay.portal.kernel.util.OrderByComparator"
101             });
102     public static final FinderPath FINDER_PATH_COUNT_BY_C_F = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
103             TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
104             FINDER_CLASS_NAME_LIST, "countByC_F",
105             new String[] { Long.class.getName(), Boolean.class.getName() });
106     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
107             TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
108             FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
109     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
110             TagsVocabularyModelImpl.FINDER_CACHE_ENABLED,
111             FINDER_CLASS_NAME_LIST, "countAll", new String[0]);
112 
113     public void cacheResult(TagsVocabulary tagsVocabulary) {
114         EntityCacheUtil.putResult(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
115             TagsVocabularyImpl.class, tagsVocabulary.getPrimaryKey(),
116             tagsVocabulary);
117 
118         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N,
119             new Object[] {
120                 new Long(tagsVocabulary.getGroupId()),
121                 
122             tagsVocabulary.getName()
123             }, tagsVocabulary);
124     }
125 
126     public void cacheResult(List<TagsVocabulary> tagsVocabularies) {
127         for (TagsVocabulary tagsVocabulary : tagsVocabularies) {
128             if (EntityCacheUtil.getResult(
129                         TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
130                         TagsVocabularyImpl.class,
131                         tagsVocabulary.getPrimaryKey(), this) == null) {
132                 cacheResult(tagsVocabulary);
133             }
134         }
135     }
136 
137     public void clearCache() {
138         CacheRegistry.clear(TagsVocabularyImpl.class.getName());
139         EntityCacheUtil.clearCache(TagsVocabularyImpl.class.getName());
140         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
141         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
142     }
143 
144     public void clearCache(TagsVocabulary tagsVocabulary) {
145         EntityCacheUtil.removeResult(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
146             TagsVocabularyImpl.class, tagsVocabulary.getPrimaryKey());
147 
148         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_N,
149             new Object[] {
150                 new Long(tagsVocabulary.getGroupId()),
151                 
152             tagsVocabulary.getName()
153             });
154     }
155 
156     public TagsVocabulary create(long vocabularyId) {
157         TagsVocabulary tagsVocabulary = new TagsVocabularyImpl();
158 
159         tagsVocabulary.setNew(true);
160         tagsVocabulary.setPrimaryKey(vocabularyId);
161 
162         return tagsVocabulary;
163     }
164 
165     public TagsVocabulary remove(Serializable primaryKey)
166         throws NoSuchModelException, SystemException {
167         return remove(((Long)primaryKey).longValue());
168     }
169 
170     public TagsVocabulary remove(long vocabularyId)
171         throws NoSuchVocabularyException, SystemException {
172         Session session = null;
173 
174         try {
175             session = openSession();
176 
177             TagsVocabulary tagsVocabulary = (TagsVocabulary)session.get(TagsVocabularyImpl.class,
178                     new Long(vocabularyId));
179 
180             if (tagsVocabulary == null) {
181                 if (_log.isWarnEnabled()) {
182                     _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + vocabularyId);
183                 }
184 
185                 throw new NoSuchVocabularyException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
186                     vocabularyId);
187             }
188 
189             return remove(tagsVocabulary);
190         }
191         catch (NoSuchVocabularyException nsee) {
192             throw nsee;
193         }
194         catch (Exception e) {
195             throw processException(e);
196         }
197         finally {
198             closeSession(session);
199         }
200     }
201 
202     protected TagsVocabulary removeImpl(TagsVocabulary tagsVocabulary)
203         throws SystemException {
204         tagsVocabulary = toUnwrappedModel(tagsVocabulary);
205 
206         Session session = null;
207 
208         try {
209             session = openSession();
210 
211             BatchSessionUtil.delete(session, tagsVocabulary);
212         }
213         catch (Exception e) {
214             throw processException(e);
215         }
216         finally {
217             closeSession(session);
218         }
219 
220         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
221 
222         TagsVocabularyModelImpl tagsVocabularyModelImpl = (TagsVocabularyModelImpl)tagsVocabulary;
223 
224         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_N,
225             new Object[] {
226                 new Long(tagsVocabularyModelImpl.getOriginalGroupId()),
227                 
228             tagsVocabularyModelImpl.getOriginalName()
229             });
230 
231         EntityCacheUtil.removeResult(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
232             TagsVocabularyImpl.class, tagsVocabulary.getPrimaryKey());
233 
234         return tagsVocabulary;
235     }
236 
237     /**
238      * @deprecated Use {@link BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)}.
239      */
240     public TagsVocabulary update(TagsVocabulary tagsVocabulary)
241         throws SystemException {
242         if (_log.isWarnEnabled()) {
243             _log.warn(
244                 "Using the deprecated update(TagsVocabulary tagsVocabulary) method. Use update(TagsVocabulary tagsVocabulary, boolean merge) instead.");
245         }
246 
247         return update(tagsVocabulary, false);
248     }
249 
250     public TagsVocabulary updateImpl(
251         com.liferay.portlet.tags.model.TagsVocabulary tagsVocabulary,
252         boolean merge) throws SystemException {
253         tagsVocabulary = toUnwrappedModel(tagsVocabulary);
254 
255         boolean isNew = tagsVocabulary.isNew();
256 
257         TagsVocabularyModelImpl tagsVocabularyModelImpl = (TagsVocabularyModelImpl)tagsVocabulary;
258 
259         Session session = null;
260 
261         try {
262             session = openSession();
263 
264             BatchSessionUtil.update(session, tagsVocabulary, merge);
265 
266             tagsVocabulary.setNew(false);
267         }
268         catch (Exception e) {
269             throw processException(e);
270         }
271         finally {
272             closeSession(session);
273         }
274 
275         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
276 
277         EntityCacheUtil.putResult(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
278             TagsVocabularyImpl.class, tagsVocabulary.getPrimaryKey(),
279             tagsVocabulary);
280 
281         if (!isNew &&
282                 ((tagsVocabulary.getGroupId() != tagsVocabularyModelImpl.getOriginalGroupId()) ||
283                 !Validator.equals(tagsVocabulary.getName(),
284                     tagsVocabularyModelImpl.getOriginalName()))) {
285             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_N,
286                 new Object[] {
287                     new Long(tagsVocabularyModelImpl.getOriginalGroupId()),
288                     
289                 tagsVocabularyModelImpl.getOriginalName()
290                 });
291         }
292 
293         if (isNew ||
294                 ((tagsVocabulary.getGroupId() != tagsVocabularyModelImpl.getOriginalGroupId()) ||
295                 !Validator.equals(tagsVocabulary.getName(),
296                     tagsVocabularyModelImpl.getOriginalName()))) {
297             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N,
298                 new Object[] {
299                     new Long(tagsVocabulary.getGroupId()),
300                     
301                 tagsVocabulary.getName()
302                 }, tagsVocabulary);
303         }
304 
305         return tagsVocabulary;
306     }
307 
308     protected TagsVocabulary toUnwrappedModel(TagsVocabulary tagsVocabulary) {
309         if (tagsVocabulary instanceof TagsVocabularyImpl) {
310             return tagsVocabulary;
311         }
312 
313         TagsVocabularyImpl tagsVocabularyImpl = new TagsVocabularyImpl();
314 
315         tagsVocabularyImpl.setNew(tagsVocabulary.isNew());
316         tagsVocabularyImpl.setPrimaryKey(tagsVocabulary.getPrimaryKey());
317 
318         tagsVocabularyImpl.setVocabularyId(tagsVocabulary.getVocabularyId());
319         tagsVocabularyImpl.setGroupId(tagsVocabulary.getGroupId());
320         tagsVocabularyImpl.setCompanyId(tagsVocabulary.getCompanyId());
321         tagsVocabularyImpl.setUserId(tagsVocabulary.getUserId());
322         tagsVocabularyImpl.setUserName(tagsVocabulary.getUserName());
323         tagsVocabularyImpl.setCreateDate(tagsVocabulary.getCreateDate());
324         tagsVocabularyImpl.setModifiedDate(tagsVocabulary.getModifiedDate());
325         tagsVocabularyImpl.setName(tagsVocabulary.getName());
326         tagsVocabularyImpl.setDescription(tagsVocabulary.getDescription());
327         tagsVocabularyImpl.setFolksonomy(tagsVocabulary.isFolksonomy());
328 
329         return tagsVocabularyImpl;
330     }
331 
332     public TagsVocabulary findByPrimaryKey(Serializable primaryKey)
333         throws NoSuchModelException, SystemException {
334         return findByPrimaryKey(((Long)primaryKey).longValue());
335     }
336 
337     public TagsVocabulary findByPrimaryKey(long vocabularyId)
338         throws NoSuchVocabularyException, SystemException {
339         TagsVocabulary tagsVocabulary = fetchByPrimaryKey(vocabularyId);
340 
341         if (tagsVocabulary == null) {
342             if (_log.isWarnEnabled()) {
343                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + vocabularyId);
344             }
345 
346             throw new NoSuchVocabularyException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
347                 vocabularyId);
348         }
349 
350         return tagsVocabulary;
351     }
352 
353     public TagsVocabulary fetchByPrimaryKey(Serializable primaryKey)
354         throws SystemException {
355         return fetchByPrimaryKey(((Long)primaryKey).longValue());
356     }
357 
358     public TagsVocabulary fetchByPrimaryKey(long vocabularyId)
359         throws SystemException {
360         TagsVocabulary tagsVocabulary = (TagsVocabulary)EntityCacheUtil.getResult(TagsVocabularyModelImpl.ENTITY_CACHE_ENABLED,
361                 TagsVocabularyImpl.class, vocabularyId, this);
362 
363         if (tagsVocabulary == null) {
364             Session session = null;
365 
366             try {
367                 session = openSession();
368 
369                 tagsVocabulary = (TagsVocabulary)session.get(TagsVocabularyImpl.class,
370                         new Long(vocabularyId));
371             }
372             catch (Exception e) {
373                 throw processException(e);
374             }
375             finally {
376                 if (tagsVocabulary != null) {
377                     cacheResult(tagsVocabulary);
378                 }
379 
380                 closeSession(session);
381             }
382         }
383 
384         return tagsVocabulary;
385     }
386 
387     public TagsVocabulary findByG_N(long groupId, String name)
388         throws NoSuchVocabularyException, SystemException {
389         TagsVocabulary tagsVocabulary = fetchByG_N(groupId, name);
390 
391         if (tagsVocabulary == null) {
392             StringBundler msg = new StringBundler(6);
393 
394             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
395 
396             msg.append("groupId=");
397             msg.append(groupId);
398 
399             msg.append(", name=");
400             msg.append(name);
401 
402             msg.append(StringPool.CLOSE_CURLY_BRACE);
403 
404             if (_log.isWarnEnabled()) {
405                 _log.warn(msg.toString());
406             }
407 
408             throw new NoSuchVocabularyException(msg.toString());
409         }
410 
411         return tagsVocabulary;
412     }
413 
414     public TagsVocabulary fetchByG_N(long groupId, String name)
415         throws SystemException {
416         return fetchByG_N(groupId, name, true);
417     }
418 
419     public TagsVocabulary fetchByG_N(long groupId, String name,
420         boolean retrieveFromCache) throws SystemException {
421         Object[] finderArgs = new Object[] { groupId, name };
422 
423         Object result = null;
424 
425         if (retrieveFromCache) {
426             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_G_N,
427                     finderArgs, this);
428         }
429 
430         if (result == null) {
431             StringBundler query = new StringBundler(4);
432 
433             query.append(_SQL_SELECT_TAGSVOCABULARY_WHERE);
434 
435             query.append(_FINDER_COLUMN_G_N_GROUPID_2);
436 
437             if (name == null) {
438                 query.append(_FINDER_COLUMN_G_N_NAME_1);
439             }
440             else {
441                 if (name.equals(StringPool.BLANK)) {
442                     query.append(_FINDER_COLUMN_G_N_NAME_3);
443                 }
444                 else {
445                     query.append(_FINDER_COLUMN_G_N_NAME_2);
446                 }
447             }
448 
449             query.append(TagsVocabularyModelImpl.ORDER_BY_JPQL);
450 
451             String sql = query.toString();
452 
453             Session session = null;
454 
455             try {
456                 session = openSession();
457 
458                 Query q = session.createQuery(sql);
459 
460                 QueryPos qPos = QueryPos.getInstance(q);
461 
462                 qPos.add(groupId);
463 
464                 if (name != null) {
465                     qPos.add(name);
466                 }
467 
468                 List<TagsVocabulary> list = q.list();
469 
470                 result = list;
471 
472                 TagsVocabulary tagsVocabulary = null;
473 
474                 if (list.isEmpty()) {
475                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N,
476                         finderArgs, list);
477                 }
478                 else {
479                     tagsVocabulary = list.get(0);
480 
481                     cacheResult(tagsVocabulary);
482 
483                     if ((tagsVocabulary.getGroupId() != groupId) ||
484                             (tagsVocabulary.getName() == null) ||
485                             !tagsVocabulary.getName().equals(name)) {
486                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N,
487                             finderArgs, tagsVocabulary);
488                     }
489                 }
490 
491                 return tagsVocabulary;
492             }
493             catch (Exception e) {
494                 throw processException(e);
495             }
496             finally {
497                 if (result == null) {
498                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N,
499                         finderArgs, new ArrayList<TagsVocabulary>());
500                 }
501 
502                 closeSession(session);
503             }
504         }
505         else {
506             if (result instanceof List<?>) {
507                 return null;
508             }
509             else {
510                 return (TagsVocabulary)result;
511             }
512         }
513     }
514 
515     public List<TagsVocabulary> findByG_F(long groupId, boolean folksonomy)
516         throws SystemException {
517         return findByG_F(groupId, folksonomy, QueryUtil.ALL_POS,
518             QueryUtil.ALL_POS, null);
519     }
520 
521     public List<TagsVocabulary> findByG_F(long groupId, boolean folksonomy,
522         int start, int end) throws SystemException {
523         return findByG_F(groupId, folksonomy, start, end, null);
524     }
525 
526     public List<TagsVocabulary> findByG_F(long groupId, boolean folksonomy,
527         int start, int end, OrderByComparator orderByComparator)
528         throws SystemException {
529         Object[] finderArgs = new Object[] {
530                 groupId, folksonomy,
531                 
532                 String.valueOf(start), String.valueOf(end),
533                 String.valueOf(orderByComparator)
534             };
535 
536         List<TagsVocabulary> list = (List<TagsVocabulary>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_F,
537                 finderArgs, this);
538 
539         if (list == null) {
540             StringBundler query = null;
541 
542             if (orderByComparator != null) {
543                 query = new StringBundler(4 +
544                         (orderByComparator.getOrderByFields().length * 3));
545             }
546             else {
547                 query = new StringBundler(4);
548             }
549 
550             query.append(_SQL_SELECT_TAGSVOCABULARY_WHERE);
551 
552             query.append(_FINDER_COLUMN_G_F_GROUPID_2);
553 
554             query.append(_FINDER_COLUMN_G_F_FOLKSONOMY_2);
555 
556             if (orderByComparator != null) {
557                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
558                     orderByComparator);
559             }
560 
561             else {
562                 query.append(TagsVocabularyModelImpl.ORDER_BY_JPQL);
563             }
564 
565             String sql = query.toString();
566 
567             Session session = null;
568 
569             try {
570                 session = openSession();
571 
572                 Query q = session.createQuery(sql);
573 
574                 QueryPos qPos = QueryPos.getInstance(q);
575 
576                 qPos.add(groupId);
577 
578                 qPos.add(folksonomy);
579 
580                 list = (List<TagsVocabulary>)QueryUtil.list(q, getDialect(),
581                         start, end);
582             }
583             catch (Exception e) {
584                 throw processException(e);
585             }
586             finally {
587                 if (list == null) {
588                     list = new ArrayList<TagsVocabulary>();
589                 }
590 
591                 cacheResult(list);
592 
593                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_F, finderArgs,
594                     list);
595 
596                 closeSession(session);
597             }
598         }
599 
600         return list;
601     }
602 
603     public TagsVocabulary findByG_F_First(long groupId, boolean folksonomy,
604         OrderByComparator orderByComparator)
605         throws NoSuchVocabularyException, SystemException {
606         List<TagsVocabulary> list = findByG_F(groupId, folksonomy, 0, 1,
607                 orderByComparator);
608 
609         if (list.isEmpty()) {
610             StringBundler msg = new StringBundler(6);
611 
612             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
613 
614             msg.append("groupId=");
615             msg.append(groupId);
616 
617             msg.append(", folksonomy=");
618             msg.append(folksonomy);
619 
620             msg.append(StringPool.CLOSE_CURLY_BRACE);
621 
622             throw new NoSuchVocabularyException(msg.toString());
623         }
624         else {
625             return list.get(0);
626         }
627     }
628 
629     public TagsVocabulary findByG_F_Last(long groupId, boolean folksonomy,
630         OrderByComparator orderByComparator)
631         throws NoSuchVocabularyException, SystemException {
632         int count = countByG_F(groupId, folksonomy);
633 
634         List<TagsVocabulary> list = findByG_F(groupId, folksonomy, count - 1,
635                 count, orderByComparator);
636 
637         if (list.isEmpty()) {
638             StringBundler msg = new StringBundler(6);
639 
640             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
641 
642             msg.append("groupId=");
643             msg.append(groupId);
644 
645             msg.append(", folksonomy=");
646             msg.append(folksonomy);
647 
648             msg.append(StringPool.CLOSE_CURLY_BRACE);
649 
650             throw new NoSuchVocabularyException(msg.toString());
651         }
652         else {
653             return list.get(0);
654         }
655     }
656 
657     public TagsVocabulary[] findByG_F_PrevAndNext(long vocabularyId,
658         long groupId, boolean folksonomy, OrderByComparator orderByComparator)
659         throws NoSuchVocabularyException, SystemException {
660         TagsVocabulary tagsVocabulary = findByPrimaryKey(vocabularyId);
661 
662         Session session = null;
663 
664         try {
665             session = openSession();
666 
667             TagsVocabulary[] array = new TagsVocabularyImpl[3];
668 
669             array[0] = getByG_F_PrevAndNext(session, tagsVocabulary, groupId,
670                     folksonomy, orderByComparator, true);
671 
672             array[1] = tagsVocabulary;
673 
674             array[2] = getByG_F_PrevAndNext(session, tagsVocabulary, groupId,
675                     folksonomy, orderByComparator, false);
676 
677             return array;
678         }
679         catch (Exception e) {
680             throw processException(e);
681         }
682         finally {
683             closeSession(session);
684         }
685     }
686 
687     protected TagsVocabulary getByG_F_PrevAndNext(Session session,
688         TagsVocabulary tagsVocabulary, long groupId, boolean folksonomy,
689         OrderByComparator orderByComparator, boolean previous) {
690         StringBundler query = null;
691 
692         if (orderByComparator != null) {
693             query = new StringBundler(6 +
694                     (orderByComparator.getOrderByFields().length * 6));
695         }
696         else {
697             query = new StringBundler(3);
698         }
699 
700         query.append(_SQL_SELECT_TAGSVOCABULARY_WHERE);
701 
702         query.append(_FINDER_COLUMN_G_F_GROUPID_2);
703 
704         query.append(_FINDER_COLUMN_G_F_FOLKSONOMY_2);
705 
706         if (orderByComparator != null) {
707             String[] orderByFields = orderByComparator.getOrderByFields();
708 
709             if (orderByFields.length > 0) {
710                 query.append(WHERE_AND);
711             }
712 
713             for (int i = 0; i < orderByFields.length; i++) {
714                 query.append(_ORDER_BY_ENTITY_ALIAS);
715                 query.append(orderByFields[i]);
716 
717                 if ((i + 1) < orderByFields.length) {
718                     if (orderByComparator.isAscending() ^ previous) {
719                         query.append(WHERE_GREATER_THAN_HAS_NEXT);
720                     }
721                     else {
722                         query.append(WHERE_LESSER_THAN_HAS_NEXT);
723                     }
724                 }
725                 else {
726                     if (orderByComparator.isAscending() ^ previous) {
727                         query.append(WHERE_GREATER_THAN);
728                     }
729                     else {
730                         query.append(WHERE_LESSER_THAN);
731                     }
732                 }
733             }
734 
735             query.append(ORDER_BY_CLAUSE);
736 
737             for (int i = 0; i < orderByFields.length; i++) {
738                 query.append(_ORDER_BY_ENTITY_ALIAS);
739                 query.append(orderByFields[i]);
740 
741                 if ((i + 1) < orderByFields.length) {
742                     if (orderByComparator.isAscending() ^ previous) {
743                         query.append(ORDER_BY_ASC_HAS_NEXT);
744                     }
745                     else {
746                         query.append(ORDER_BY_DESC_HAS_NEXT);
747                     }
748                 }
749                 else {
750                     if (orderByComparator.isAscending() ^ previous) {
751                         query.append(ORDER_BY_ASC);
752                     }
753                     else {
754                         query.append(ORDER_BY_DESC);
755                     }
756                 }
757             }
758         }
759 
760         else {
761             query.append(TagsVocabularyModelImpl.ORDER_BY_JPQL);
762         }
763 
764         String sql = query.toString();
765 
766         Query q = session.createQuery(sql);
767 
768         q.setFirstResult(0);
769         q.setMaxResults(2);
770 
771         QueryPos qPos = QueryPos.getInstance(q);
772 
773         qPos.add(groupId);
774 
775         qPos.add(folksonomy);
776 
777         if (orderByComparator != null) {
778             Object[] values = orderByComparator.getOrderByValues(tagsVocabulary);
779 
780             for (Object value : values) {
781                 qPos.add(value);
782             }
783         }
784 
785         List<TagsVocabulary> list = q.list();
786 
787         if (list.size() == 2) {
788             return list.get(1);
789         }
790         else {
791             return null;
792         }
793     }
794 
795     public List<TagsVocabulary> findByC_F(long companyId, boolean folksonomy)
796         throws SystemException {
797         return findByC_F(companyId, folksonomy, QueryUtil.ALL_POS,
798             QueryUtil.ALL_POS, null);
799     }
800 
801     public List<TagsVocabulary> findByC_F(long companyId, boolean folksonomy,
802         int start, int end) throws SystemException {
803         return findByC_F(companyId, folksonomy, start, end, null);
804     }
805 
806     public List<TagsVocabulary> findByC_F(long companyId, boolean folksonomy,
807         int start, int end, OrderByComparator orderByComparator)
808         throws SystemException {
809         Object[] finderArgs = new Object[] {
810                 companyId, folksonomy,
811                 
812                 String.valueOf(start), String.valueOf(end),
813                 String.valueOf(orderByComparator)
814             };
815 
816         List<TagsVocabulary> list = (List<TagsVocabulary>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_C_F,
817                 finderArgs, this);
818 
819         if (list == null) {
820             StringBundler query = null;
821 
822             if (orderByComparator != null) {
823                 query = new StringBundler(4 +
824                         (orderByComparator.getOrderByFields().length * 3));
825             }
826             else {
827                 query = new StringBundler(4);
828             }
829 
830             query.append(_SQL_SELECT_TAGSVOCABULARY_WHERE);
831 
832             query.append(_FINDER_COLUMN_C_F_COMPANYID_2);
833 
834             query.append(_FINDER_COLUMN_C_F_FOLKSONOMY_2);
835 
836             if (orderByComparator != null) {
837                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
838                     orderByComparator);
839             }
840 
841             else {
842                 query.append(TagsVocabularyModelImpl.ORDER_BY_JPQL);
843             }
844 
845             String sql = query.toString();
846 
847             Session session = null;
848 
849             try {
850                 session = openSession();
851 
852                 Query q = session.createQuery(sql);
853 
854                 QueryPos qPos = QueryPos.getInstance(q);
855 
856                 qPos.add(companyId);
857 
858                 qPos.add(folksonomy);
859 
860                 list = (List<TagsVocabulary>)QueryUtil.list(q, getDialect(),
861                         start, end);
862             }
863             catch (Exception e) {
864                 throw processException(e);
865             }
866             finally {
867                 if (list == null) {
868                     list = new ArrayList<TagsVocabulary>();
869                 }
870 
871                 cacheResult(list);
872 
873                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_C_F, finderArgs,
874                     list);
875 
876                 closeSession(session);
877             }
878         }
879 
880         return list;
881     }
882 
883     public TagsVocabulary findByC_F_First(long companyId, boolean folksonomy,
884         OrderByComparator orderByComparator)
885         throws NoSuchVocabularyException, SystemException {
886         List<TagsVocabulary> list = findByC_F(companyId, folksonomy, 0, 1,
887                 orderByComparator);
888 
889         if (list.isEmpty()) {
890             StringBundler msg = new StringBundler(6);
891 
892             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
893 
894             msg.append("companyId=");
895             msg.append(companyId);
896 
897             msg.append(", folksonomy=");
898             msg.append(folksonomy);
899 
900             msg.append(StringPool.CLOSE_CURLY_BRACE);
901 
902             throw new NoSuchVocabularyException(msg.toString());
903         }
904         else {
905             return list.get(0);
906         }
907     }
908 
909     public TagsVocabulary findByC_F_Last(long companyId, boolean folksonomy,
910         OrderByComparator orderByComparator)
911         throws NoSuchVocabularyException, SystemException {
912         int count = countByC_F(companyId, folksonomy);
913 
914         List<TagsVocabulary> list = findByC_F(companyId, folksonomy, count - 1,
915                 count, orderByComparator);
916 
917         if (list.isEmpty()) {
918             StringBundler msg = new StringBundler(6);
919 
920             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
921 
922             msg.append("companyId=");
923             msg.append(companyId);
924 
925             msg.append(", folksonomy=");
926             msg.append(folksonomy);
927 
928             msg.append(StringPool.CLOSE_CURLY_BRACE);
929 
930             throw new NoSuchVocabularyException(msg.toString());
931         }
932         else {
933             return list.get(0);
934         }
935     }
936 
937     public TagsVocabulary[] findByC_F_PrevAndNext(long vocabularyId,
938         long companyId, boolean folksonomy, OrderByComparator orderByComparator)
939         throws NoSuchVocabularyException, SystemException {
940         TagsVocabulary tagsVocabulary = findByPrimaryKey(vocabularyId);
941 
942         Session session = null;
943 
944         try {
945             session = openSession();
946 
947             TagsVocabulary[] array = new TagsVocabularyImpl[3];
948 
949             array[0] = getByC_F_PrevAndNext(session, tagsVocabulary, companyId,
950                     folksonomy, orderByComparator, true);
951 
952             array[1] = tagsVocabulary;
953 
954             array[2] = getByC_F_PrevAndNext(session, tagsVocabulary, companyId,
955                     folksonomy, orderByComparator, false);
956 
957             return array;
958         }
959         catch (Exception e) {
960             throw processException(e);
961         }
962         finally {
963             closeSession(session);
964         }
965     }
966 
967     protected TagsVocabulary getByC_F_PrevAndNext(Session session,
968         TagsVocabulary tagsVocabulary, long companyId, boolean folksonomy,
969         OrderByComparator orderByComparator, boolean previous) {
970         StringBundler query = null;
971 
972         if (orderByComparator != null) {
973             query = new StringBundler(6 +
974                     (orderByComparator.getOrderByFields().length * 6));
975         }
976         else {
977             query = new StringBundler(3);
978         }
979 
980         query.append(_SQL_SELECT_TAGSVOCABULARY_WHERE);
981 
982         query.append(_FINDER_COLUMN_C_F_COMPANYID_2);
983 
984         query.append(_FINDER_COLUMN_C_F_FOLKSONOMY_2);
985 
986         if (orderByComparator != null) {
987             String[] orderByFields = orderByComparator.getOrderByFields();
988 
989             if (orderByFields.length > 0) {
990                 query.append(WHERE_AND);
991             }
992 
993             for (int i = 0; i < orderByFields.length; i++) {
994                 query.append(_ORDER_BY_ENTITY_ALIAS);
995                 query.append(orderByFields[i]);
996 
997                 if ((i + 1) < orderByFields.length) {
998                     if (orderByComparator.isAscending() ^ previous) {
999                         query.append(WHERE_GREATER_THAN_HAS_NEXT);
1000                    }
1001                    else {
1002                        query.append(WHERE_LESSER_THAN_HAS_NEXT);
1003                    }
1004                }
1005                else {
1006                    if (orderByComparator.isAscending() ^ previous) {
1007                        query.append(WHERE_GREATER_THAN);
1008                    }
1009                    else {
1010                        query.append(WHERE_LESSER_THAN);
1011                    }
1012                }
1013            }
1014
1015            query.append(ORDER_BY_CLAUSE);
1016
1017            for (int i = 0; i < orderByFields.length; i++) {
1018                query.append(_ORDER_BY_ENTITY_ALIAS);
1019                query.append(orderByFields[i]);
1020
1021                if ((i + 1) < orderByFields.length) {
1022                    if (orderByComparator.isAscending() ^ previous) {
1023                        query.append(ORDER_BY_ASC_HAS_NEXT);
1024                    }
1025                    else {
1026                        query.append(ORDER_BY_DESC_HAS_NEXT);
1027                    }
1028                }
1029                else {
1030                    if (orderByComparator.isAscending() ^ previous) {
1031                        query.append(ORDER_BY_ASC);
1032                    }
1033                    else {
1034                        query.append(ORDER_BY_DESC);
1035                    }
1036                }
1037            }
1038        }
1039
1040        else {
1041            query.append(TagsVocabularyModelImpl.ORDER_BY_JPQL);
1042        }
1043
1044        String sql = query.toString();
1045
1046        Query q = session.createQuery(sql);
1047
1048        q.setFirstResult(0);
1049        q.setMaxResults(2);
1050
1051        QueryPos qPos = QueryPos.getInstance(q);
1052
1053        qPos.add(companyId);
1054
1055        qPos.add(folksonomy);
1056
1057        if (orderByComparator != null) {
1058            Object[] values = orderByComparator.getOrderByValues(tagsVocabulary);
1059
1060            for (Object value : values) {
1061                qPos.add(value);
1062            }
1063        }
1064
1065        List<TagsVocabulary> list = q.list();
1066
1067        if (list.size() == 2) {
1068            return list.get(1);
1069        }
1070        else {
1071            return null;
1072        }
1073    }
1074
1075    public List<TagsVocabulary> findAll() throws SystemException {
1076        return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1077    }
1078
1079    public List<TagsVocabulary> findAll(int start, int end)
1080        throws SystemException {
1081        return findAll(start, end, null);
1082    }
1083
1084    public List<TagsVocabulary> findAll(int start, int end,
1085        OrderByComparator orderByComparator) throws SystemException {
1086        Object[] finderArgs = new Object[] {
1087                String.valueOf(start), String.valueOf(end),
1088                String.valueOf(orderByComparator)
1089            };
1090
1091        List<TagsVocabulary> list = (List<TagsVocabulary>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1092                finderArgs, this);
1093
1094        if (list == null) {
1095            StringBundler query = null;
1096            String sql = null;
1097
1098            if (orderByComparator != null) {
1099                query = new StringBundler(2 +
1100                        (orderByComparator.getOrderByFields().length * 3));
1101
1102                query.append(_SQL_SELECT_TAGSVOCABULARY);
1103
1104                appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1105                    orderByComparator);
1106
1107                sql = query.toString();
1108            }
1109            else {
1110                sql = _SQL_SELECT_TAGSVOCABULARY.concat(TagsVocabularyModelImpl.ORDER_BY_JPQL);
1111            }
1112
1113            Session session = null;
1114
1115            try {
1116                session = openSession();
1117
1118                Query q = session.createQuery(sql);
1119
1120                if (orderByComparator == null) {
1121                    list = (List<TagsVocabulary>)QueryUtil.list(q,
1122                            getDialect(), start, end, false);
1123
1124                    Collections.sort(list);
1125                }
1126                else {
1127                    list = (List<TagsVocabulary>)QueryUtil.list(q,
1128                            getDialect(), start, end);
1129                }
1130            }
1131            catch (Exception e) {
1132                throw processException(e);
1133            }
1134            finally {
1135                if (list == null) {
1136                    list = new ArrayList<TagsVocabulary>();
1137                }
1138
1139                cacheResult(list);
1140
1141                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1142
1143                closeSession(session);
1144            }
1145        }
1146
1147        return list;
1148    }
1149
1150    public void removeByG_N(long groupId, String name)
1151        throws NoSuchVocabularyException, SystemException {
1152        TagsVocabulary tagsVocabulary = findByG_N(groupId, name);
1153
1154        remove(tagsVocabulary);
1155    }
1156
1157    public void removeByG_F(long groupId, boolean folksonomy)
1158        throws SystemException {
1159        for (TagsVocabulary tagsVocabulary : findByG_F(groupId, folksonomy)) {
1160            remove(tagsVocabulary);
1161        }
1162    }
1163
1164    public void removeByC_F(long companyId, boolean folksonomy)
1165        throws SystemException {
1166        for (TagsVocabulary tagsVocabulary : findByC_F(companyId, folksonomy)) {
1167            remove(tagsVocabulary);
1168        }
1169    }
1170
1171    public void removeAll() throws SystemException {
1172        for (TagsVocabulary tagsVocabulary : findAll()) {
1173            remove(tagsVocabulary);
1174        }
1175    }
1176
1177    public int countByG_N(long groupId, String name) throws SystemException {
1178        Object[] finderArgs = new Object[] { groupId, name };
1179
1180        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_N,
1181                finderArgs, this);
1182
1183        if (count == null) {
1184            StringBundler query = new StringBundler(3);
1185
1186            query.append(_SQL_COUNT_TAGSVOCABULARY_WHERE);
1187
1188            query.append(_FINDER_COLUMN_G_N_GROUPID_2);
1189
1190            if (name == null) {
1191                query.append(_FINDER_COLUMN_G_N_NAME_1);
1192            }
1193            else {
1194                if (name.equals(StringPool.BLANK)) {
1195                    query.append(_FINDER_COLUMN_G_N_NAME_3);
1196                }
1197                else {
1198                    query.append(_FINDER_COLUMN_G_N_NAME_2);
1199                }
1200            }
1201
1202            String sql = query.toString();
1203
1204            Session session = null;
1205
1206            try {
1207                session = openSession();
1208
1209                Query q = session.createQuery(sql);
1210
1211                QueryPos qPos = QueryPos.getInstance(q);
1212
1213                qPos.add(groupId);
1214
1215                if (name != null) {
1216                    qPos.add(name);
1217                }
1218
1219                count = (Long)q.uniqueResult();
1220            }
1221            catch (Exception e) {
1222                throw processException(e);
1223            }
1224            finally {
1225                if (count == null) {
1226                    count = Long.valueOf(0);
1227                }
1228
1229                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_N, finderArgs,
1230                    count);
1231
1232                closeSession(session);
1233            }
1234        }
1235
1236        return count.intValue();
1237    }
1238
1239    public int countByG_F(long groupId, boolean folksonomy)
1240        throws SystemException {
1241        Object[] finderArgs = new Object[] { groupId, folksonomy };
1242
1243        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_F,
1244                finderArgs, this);
1245
1246        if (count == null) {
1247            StringBundler query = new StringBundler(3);
1248
1249            query.append(_SQL_COUNT_TAGSVOCABULARY_WHERE);
1250
1251            query.append(_FINDER_COLUMN_G_F_GROUPID_2);
1252
1253            query.append(_FINDER_COLUMN_G_F_FOLKSONOMY_2);
1254
1255            String sql = query.toString();
1256
1257            Session session = null;
1258
1259            try {
1260                session = openSession();
1261
1262                Query q = session.createQuery(sql);
1263
1264                QueryPos qPos = QueryPos.getInstance(q);
1265
1266                qPos.add(groupId);
1267
1268                qPos.add(folksonomy);
1269
1270                count = (Long)q.uniqueResult();
1271            }
1272            catch (Exception e) {
1273                throw processException(e);
1274            }
1275            finally {
1276                if (count == null) {
1277                    count = Long.valueOf(0);
1278                }
1279
1280                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_F, finderArgs,
1281                    count);
1282
1283                closeSession(session);
1284            }
1285        }
1286
1287        return count.intValue();
1288    }
1289
1290    public int countByC_F(long companyId, boolean folksonomy)
1291        throws SystemException {
1292        Object[] finderArgs = new Object[] { companyId, folksonomy };
1293
1294        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_F,
1295                finderArgs, this);
1296
1297        if (count == null) {
1298            StringBundler query = new StringBundler(3);
1299
1300            query.append(_SQL_COUNT_TAGSVOCABULARY_WHERE);
1301
1302            query.append(_FINDER_COLUMN_C_F_COMPANYID_2);
1303
1304            query.append(_FINDER_COLUMN_C_F_FOLKSONOMY_2);
1305
1306            String sql = query.toString();
1307
1308            Session session = null;
1309
1310            try {
1311                session = openSession();
1312
1313                Query q = session.createQuery(sql);
1314
1315                QueryPos qPos = QueryPos.getInstance(q);
1316
1317                qPos.add(companyId);
1318
1319                qPos.add(folksonomy);
1320
1321                count = (Long)q.uniqueResult();
1322            }
1323            catch (Exception e) {
1324                throw processException(e);
1325            }
1326            finally {
1327                if (count == null) {
1328                    count = Long.valueOf(0);
1329                }
1330
1331                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_F, finderArgs,
1332                    count);
1333
1334                closeSession(session);
1335            }
1336        }
1337
1338        return count.intValue();
1339    }
1340
1341    public int countAll() throws SystemException {
1342        Object[] finderArgs = new Object[0];
1343
1344        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1345                finderArgs, this);
1346
1347        if (count == null) {
1348            Session session = null;
1349
1350            try {
1351                session = openSession();
1352
1353                Query q = session.createQuery(_SQL_COUNT_TAGSVOCABULARY);
1354
1355                count = (Long)q.uniqueResult();
1356            }
1357            catch (Exception e) {
1358                throw processException(e);
1359            }
1360            finally {
1361                if (count == null) {
1362                    count = Long.valueOf(0);
1363                }
1364
1365                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1366                    count);
1367
1368                closeSession(session);
1369            }
1370        }
1371
1372        return count.intValue();
1373    }
1374
1375    public void afterPropertiesSet() {
1376        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1377                    com.liferay.portal.util.PropsUtil.get(
1378                        "value.object.listener.com.liferay.portlet.tags.model.TagsVocabulary")));
1379
1380        if (listenerClassNames.length > 0) {
1381            try {
1382                List<ModelListener<TagsVocabulary>> listenersList = new ArrayList<ModelListener<TagsVocabulary>>();
1383
1384                for (String listenerClassName : listenerClassNames) {
1385                    listenersList.add((ModelListener<TagsVocabulary>)InstanceFactory.newInstance(
1386                            listenerClassName));
1387                }
1388
1389                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1390            }
1391            catch (Exception e) {
1392                _log.error(e);
1393            }
1394        }
1395    }
1396
1397    public void destroy() {
1398        EntityCacheUtil.removeCache(TagsVocabularyImpl.class.getName());
1399        FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1400        FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST);
1401    }
1402
1403    @BeanReference(type = TagsAssetPersistence.class)
1404    protected TagsAssetPersistence tagsAssetPersistence;
1405    @BeanReference(type = TagsEntryPersistence.class)
1406    protected TagsEntryPersistence tagsEntryPersistence;
1407    @BeanReference(type = TagsPropertyPersistence.class)
1408    protected TagsPropertyPersistence tagsPropertyPersistence;
1409    @BeanReference(type = TagsSourcePersistence.class)
1410    protected TagsSourcePersistence tagsSourcePersistence;
1411    @BeanReference(type = TagsVocabularyPersistence.class)
1412    protected TagsVocabularyPersistence tagsVocabularyPersistence;
1413    @BeanReference(type = ResourcePersistence.class)
1414    protected ResourcePersistence resourcePersistence;
1415    @BeanReference(type = UserPersistence.class)
1416    protected UserPersistence userPersistence;
1417    private static final String _SQL_SELECT_TAGSVOCABULARY = "SELECT tagsVocabulary FROM TagsVocabulary tagsVocabulary";
1418    private static final String _SQL_SELECT_TAGSVOCABULARY_WHERE = "SELECT tagsVocabulary FROM TagsVocabulary tagsVocabulary WHERE ";
1419    private static final String _SQL_COUNT_TAGSVOCABULARY = "SELECT COUNT(tagsVocabulary) FROM TagsVocabulary tagsVocabulary";
1420    private static final String _SQL_COUNT_TAGSVOCABULARY_WHERE = "SELECT COUNT(tagsVocabulary) FROM TagsVocabulary tagsVocabulary WHERE ";
1421    private static final String _FINDER_COLUMN_G_N_GROUPID_2 = "tagsVocabulary.groupId = ? AND ";
1422    private static final String _FINDER_COLUMN_G_N_NAME_1 = "tagsVocabulary.name IS NULL";
1423    private static final String _FINDER_COLUMN_G_N_NAME_2 = "tagsVocabulary.name = ?";
1424    private static final String _FINDER_COLUMN_G_N_NAME_3 = "(tagsVocabulary.name IS NULL OR tagsVocabulary.name = ?)";
1425    private static final String _FINDER_COLUMN_G_F_GROUPID_2 = "tagsVocabulary.groupId = ? AND ";
1426    private static final String _FINDER_COLUMN_G_F_FOLKSONOMY_2 = "tagsVocabulary.folksonomy = ?";
1427    private static final String _FINDER_COLUMN_C_F_COMPANYID_2 = "tagsVocabulary.companyId = ? AND ";
1428    private static final String _FINDER_COLUMN_C_F_FOLKSONOMY_2 = "tagsVocabulary.folksonomy = ?";
1429    private static final String _ORDER_BY_ENTITY_ALIAS = "tagsVocabulary.";
1430    private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No TagsVocabulary exists with the primary key ";
1431    private static final String _NO_SUCH_ENTITY_WITH_KEY = "No TagsVocabulary exists with the key {";
1432    private static Log _log = LogFactoryUtil.getLog(TagsVocabularyPersistenceImpl.class);
1433}