1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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.tags.service.persistence;
24  
25  /**
26   * <a href="TagsEntryUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class TagsEntryUtil {
32      public static com.liferay.portlet.tags.model.TagsEntry create(long entryId) {
33          return getPersistence().create(entryId);
34      }
35  
36      public static com.liferay.portlet.tags.model.TagsEntry remove(long entryId)
37          throws com.liferay.portal.SystemException,
38              com.liferay.portlet.tags.NoSuchEntryException {
39          return getPersistence().remove(entryId);
40      }
41  
42      public static com.liferay.portlet.tags.model.TagsEntry remove(
43          com.liferay.portlet.tags.model.TagsEntry tagsEntry)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(tagsEntry);
46      }
47  
48      /**
49       * @deprecated Use <code>update(TagsEntry tagsEntry, boolean merge)</code>.
50       */
51      public static com.liferay.portlet.tags.model.TagsEntry update(
52          com.liferay.portlet.tags.model.TagsEntry tagsEntry)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(tagsEntry);
55      }
56  
57      /**
58       * Add, update, or merge, the entity. This method also calls the model
59       * listeners to trigger the proper events associated with adding, deleting,
60       * or updating an entity.
61       *
62       * @param        tagsEntry the entity to add, update, or merge
63       * @param        merge boolean value for whether to merge the entity. The
64       *                default value is false. Setting merge to true is more
65       *                expensive and should only be true when tagsEntry is
66       *                transient. See LEP-5473 for a detailed discussion of this
67       *                method.
68       * @return        true if the portlet can be displayed via Ajax
69       */
70      public static com.liferay.portlet.tags.model.TagsEntry update(
71          com.liferay.portlet.tags.model.TagsEntry tagsEntry, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(tagsEntry, merge);
74      }
75  
76      public static com.liferay.portlet.tags.model.TagsEntry updateImpl(
77          com.liferay.portlet.tags.model.TagsEntry tagsEntry, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(tagsEntry, merge);
80      }
81  
82      public static com.liferay.portlet.tags.model.TagsEntry findByPrimaryKey(
83          long entryId)
84          throws com.liferay.portal.SystemException,
85              com.liferay.portlet.tags.NoSuchEntryException {
86          return getPersistence().findByPrimaryKey(entryId);
87      }
88  
89      public static com.liferay.portlet.tags.model.TagsEntry fetchByPrimaryKey(
90          long entryId) throws com.liferay.portal.SystemException {
91          return getPersistence().fetchByPrimaryKey(entryId);
92      }
93  
94      public static com.liferay.portlet.tags.model.TagsEntry findByC_N(
95          long companyId, java.lang.String name)
96          throws com.liferay.portal.SystemException,
97              com.liferay.portlet.tags.NoSuchEntryException {
98          return getPersistence().findByC_N(companyId, name);
99      }
100 
101     public static com.liferay.portlet.tags.model.TagsEntry fetchByC_N(
102         long companyId, java.lang.String name)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByC_N(companyId, name);
105     }
106 
107     public static java.util.List<com.liferay.portlet.tags.model.TagsEntry> findWithDynamicQuery(
108         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().findWithDynamicQuery(queryInitializer);
111     }
112 
113     public static java.util.List<com.liferay.portlet.tags.model.TagsEntry> findWithDynamicQuery(
114         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
115         int begin, int end) throws com.liferay.portal.SystemException {
116         return getPersistence()
117                    .findWithDynamicQuery(queryInitializer, begin, end);
118     }
119 
120     public static java.util.List<com.liferay.portlet.tags.model.TagsEntry> findAll()
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findAll();
123     }
124 
125     public static java.util.List<com.liferay.portlet.tags.model.TagsEntry> findAll(
126         int begin, int end) throws com.liferay.portal.SystemException {
127         return getPersistence().findAll(begin, end);
128     }
129 
130     public static java.util.List<com.liferay.portlet.tags.model.TagsEntry> findAll(
131         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.SystemException {
133         return getPersistence().findAll(begin, end, obc);
134     }
135 
136     public static void removeByC_N(long companyId, java.lang.String name)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.tags.NoSuchEntryException {
139         getPersistence().removeByC_N(companyId, name);
140     }
141 
142     public static void removeAll() throws com.liferay.portal.SystemException {
143         getPersistence().removeAll();
144     }
145 
146     public static int countByC_N(long companyId, java.lang.String name)
147         throws com.liferay.portal.SystemException {
148         return getPersistence().countByC_N(companyId, name);
149     }
150 
151     public static int countAll() throws com.liferay.portal.SystemException {
152         return getPersistence().countAll();
153     }
154 
155     public static java.util.List<com.liferay.portlet.tags.model.TagsAsset> getTagsAssets(
156         long pk)
157         throws com.liferay.portal.SystemException,
158             com.liferay.portlet.tags.NoSuchEntryException {
159         return getPersistence().getTagsAssets(pk);
160     }
161 
162     public static java.util.List<com.liferay.portlet.tags.model.TagsAsset> getTagsAssets(
163         long pk, int begin, int end)
164         throws com.liferay.portal.SystemException,
165             com.liferay.portlet.tags.NoSuchEntryException {
166         return getPersistence().getTagsAssets(pk, begin, end);
167     }
168 
169     public static java.util.List<com.liferay.portlet.tags.model.TagsAsset> getTagsAssets(
170         long pk, int begin, int end,
171         com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portlet.tags.NoSuchEntryException {
174         return getPersistence().getTagsAssets(pk, begin, end, obc);
175     }
176 
177     public static int getTagsAssetsSize(long pk)
178         throws com.liferay.portal.SystemException {
179         return getPersistence().getTagsAssetsSize(pk);
180     }
181 
182     public static boolean containsTagsAsset(long pk, long tagsAssetPK)
183         throws com.liferay.portal.SystemException {
184         return getPersistence().containsTagsAsset(pk, tagsAssetPK);
185     }
186 
187     public static boolean containsTagsAssets(long pk)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().containsTagsAssets(pk);
190     }
191 
192     public static void addTagsAsset(long pk, long tagsAssetPK)
193         throws com.liferay.portal.SystemException,
194             com.liferay.portlet.tags.NoSuchAssetException,
195             com.liferay.portlet.tags.NoSuchEntryException {
196         getPersistence().addTagsAsset(pk, tagsAssetPK);
197     }
198 
199     public static void addTagsAsset(long pk,
200         com.liferay.portlet.tags.model.TagsAsset tagsAsset)
201         throws com.liferay.portal.SystemException,
202             com.liferay.portlet.tags.NoSuchAssetException,
203             com.liferay.portlet.tags.NoSuchEntryException {
204         getPersistence().addTagsAsset(pk, tagsAsset);
205     }
206 
207     public static void addTagsAssets(long pk, long[] tagsAssetPKs)
208         throws com.liferay.portal.SystemException,
209             com.liferay.portlet.tags.NoSuchAssetException,
210             com.liferay.portlet.tags.NoSuchEntryException {
211         getPersistence().addTagsAssets(pk, tagsAssetPKs);
212     }
213 
214     public static void addTagsAssets(long pk,
215         java.util.List<com.liferay.portlet.tags.model.TagsAsset> tagsAssets)
216         throws com.liferay.portal.SystemException,
217             com.liferay.portlet.tags.NoSuchAssetException,
218             com.liferay.portlet.tags.NoSuchEntryException {
219         getPersistence().addTagsAssets(pk, tagsAssets);
220     }
221 
222     public static void clearTagsAssets(long pk)
223         throws com.liferay.portal.SystemException,
224             com.liferay.portlet.tags.NoSuchEntryException {
225         getPersistence().clearTagsAssets(pk);
226     }
227 
228     public static void removeTagsAsset(long pk, long tagsAssetPK)
229         throws com.liferay.portal.SystemException,
230             com.liferay.portlet.tags.NoSuchAssetException,
231             com.liferay.portlet.tags.NoSuchEntryException {
232         getPersistence().removeTagsAsset(pk, tagsAssetPK);
233     }
234 
235     public static void removeTagsAsset(long pk,
236         com.liferay.portlet.tags.model.TagsAsset tagsAsset)
237         throws com.liferay.portal.SystemException,
238             com.liferay.portlet.tags.NoSuchAssetException,
239             com.liferay.portlet.tags.NoSuchEntryException {
240         getPersistence().removeTagsAsset(pk, tagsAsset);
241     }
242 
243     public static void removeTagsAssets(long pk, long[] tagsAssetPKs)
244         throws com.liferay.portal.SystemException,
245             com.liferay.portlet.tags.NoSuchAssetException,
246             com.liferay.portlet.tags.NoSuchEntryException {
247         getPersistence().removeTagsAssets(pk, tagsAssetPKs);
248     }
249 
250     public static void removeTagsAssets(long pk,
251         java.util.List<com.liferay.portlet.tags.model.TagsAsset> tagsAssets)
252         throws com.liferay.portal.SystemException,
253             com.liferay.portlet.tags.NoSuchAssetException,
254             com.liferay.portlet.tags.NoSuchEntryException {
255         getPersistence().removeTagsAssets(pk, tagsAssets);
256     }
257 
258     public static void setTagsAssets(long pk, long[] tagsAssetPKs)
259         throws com.liferay.portal.SystemException,
260             com.liferay.portlet.tags.NoSuchAssetException,
261             com.liferay.portlet.tags.NoSuchEntryException {
262         getPersistence().setTagsAssets(pk, tagsAssetPKs);
263     }
264 
265     public static void setTagsAssets(long pk,
266         java.util.List<com.liferay.portlet.tags.model.TagsAsset> tagsAssets)
267         throws com.liferay.portal.SystemException,
268             com.liferay.portlet.tags.NoSuchAssetException,
269             com.liferay.portlet.tags.NoSuchEntryException {
270         getPersistence().setTagsAssets(pk, tagsAssets);
271     }
272 
273     public static TagsEntryPersistence getPersistence() {
274         return _getUtil()._persistence;
275     }
276 
277     public void setPersistence(TagsEntryPersistence persistence) {
278         _persistence = persistence;
279     }
280 
281     private static TagsEntryUtil _getUtil() {
282         if (_util == null) {
283             _util = (TagsEntryUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
284         }
285 
286         return _util;
287     }
288 
289     private static final String _UTIL = TagsEntryUtil.class.getName();
290     private static TagsEntryUtil _util;
291     private TagsEntryPersistence _persistence;
292 }