1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.tags.service.persistence;
21  
22  /**
23   * <a href="TagsSourceUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class TagsSourceUtil {
29      public static void cacheResult(
30          com.liferay.portlet.tags.model.TagsSource tagsSource) {
31          getPersistence().cacheResult(tagsSource);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.tags.model.TagsSource> tagsSources) {
36          getPersistence().cacheResult(tagsSources);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.tags.model.TagsSource create(
44          long sourceId) {
45          return getPersistence().create(sourceId);
46      }
47  
48      public static com.liferay.portlet.tags.model.TagsSource remove(
49          long sourceId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.tags.NoSuchSourceException {
52          return getPersistence().remove(sourceId);
53      }
54  
55      public static com.liferay.portlet.tags.model.TagsSource remove(
56          com.liferay.portlet.tags.model.TagsSource tagsSource)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(tagsSource);
59      }
60  
61      /**
62       * @deprecated Use <code>update(TagsSource tagsSource, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.tags.model.TagsSource update(
65          com.liferay.portlet.tags.model.TagsSource tagsSource)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(tagsSource);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        tagsSource the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when tagsSource is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portlet.tags.model.TagsSource update(
84          com.liferay.portlet.tags.model.TagsSource tagsSource, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(tagsSource, merge);
87      }
88  
89      public static com.liferay.portlet.tags.model.TagsSource updateImpl(
90          com.liferay.portlet.tags.model.TagsSource tagsSource, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(tagsSource, merge);
93      }
94  
95      public static com.liferay.portlet.tags.model.TagsSource findByPrimaryKey(
96          long sourceId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.tags.NoSuchSourceException {
99          return getPersistence().findByPrimaryKey(sourceId);
100     }
101 
102     public static com.liferay.portlet.tags.model.TagsSource fetchByPrimaryKey(
103         long sourceId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(sourceId);
105     }
106 
107     public static java.util.List<Object> findWithDynamicQuery(
108         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().findWithDynamicQuery(dynamicQuery);
111     }
112 
113     public static java.util.List<Object> findWithDynamicQuery(
114         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
115         int end) throws com.liferay.portal.SystemException {
116         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
117     }
118 
119     public static java.util.List<com.liferay.portlet.tags.model.TagsSource> findAll()
120         throws com.liferay.portal.SystemException {
121         return getPersistence().findAll();
122     }
123 
124     public static java.util.List<com.liferay.portlet.tags.model.TagsSource> findAll(
125         int start, int end) throws com.liferay.portal.SystemException {
126         return getPersistence().findAll(start, end);
127     }
128 
129     public static java.util.List<com.liferay.portlet.tags.model.TagsSource> findAll(
130         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException {
132         return getPersistence().findAll(start, end, obc);
133     }
134 
135     public static void removeAll() throws com.liferay.portal.SystemException {
136         getPersistence().removeAll();
137     }
138 
139     public static int countAll() throws com.liferay.portal.SystemException {
140         return getPersistence().countAll();
141     }
142 
143     public static TagsSourcePersistence getPersistence() {
144         return _persistence;
145     }
146 
147     public void setPersistence(TagsSourcePersistence persistence) {
148         _persistence = persistence;
149     }
150 
151     private static TagsSourcePersistence _persistence;
152 }