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.journal.service.persistence;
24  
25  /**
26   * <a href="JournalArticleResourceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class JournalArticleResourceUtil {
32      public static com.liferay.portlet.journal.model.JournalArticleResource create(
33          long resourcePrimKey) {
34          return getPersistence().create(resourcePrimKey);
35      }
36  
37      public static com.liferay.portlet.journal.model.JournalArticleResource remove(
38          long resourcePrimKey)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.journal.NoSuchArticleResourceException {
41          return getPersistence().remove(resourcePrimKey);
42      }
43  
44      public static com.liferay.portlet.journal.model.JournalArticleResource remove(
45          com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(journalArticleResource);
48      }
49  
50      /**
51       * @deprecated Use <code>update(JournalArticleResource journalArticleResource, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.journal.model.JournalArticleResource update(
54          com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(journalArticleResource);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        journalArticleResource the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when journalArticleResource is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portlet.journal.model.JournalArticleResource update(
73          com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(journalArticleResource, merge);
76      }
77  
78      public static com.liferay.portlet.journal.model.JournalArticleResource updateImpl(
79          com.liferay.portlet.journal.model.JournalArticleResource journalArticleResource,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(journalArticleResource, merge);
82      }
83  
84      public static com.liferay.portlet.journal.model.JournalArticleResource findByPrimaryKey(
85          long resourcePrimKey)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.journal.NoSuchArticleResourceException {
88          return getPersistence().findByPrimaryKey(resourcePrimKey);
89      }
90  
91      public static com.liferay.portlet.journal.model.JournalArticleResource fetchByPrimaryKey(
92          long resourcePrimKey) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(resourcePrimKey);
94      }
95  
96      public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId(
97          long groupId) throws com.liferay.portal.SystemException {
98          return getPersistence().findByGroupId(groupId);
99      }
100 
101     public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId(
102         long groupId, int begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByGroupId(groupId, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findByGroupId(
108         long groupId, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByGroupId(groupId, begin, end, obc);
112     }
113 
114     public static com.liferay.portlet.journal.model.JournalArticleResource findByGroupId_First(
115         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException,
117             com.liferay.portlet.journal.NoSuchArticleResourceException {
118         return getPersistence().findByGroupId_First(groupId, obc);
119     }
120 
121     public static com.liferay.portlet.journal.model.JournalArticleResource findByGroupId_Last(
122         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portlet.journal.NoSuchArticleResourceException {
125         return getPersistence().findByGroupId_Last(groupId, obc);
126     }
127 
128     public static com.liferay.portlet.journal.model.JournalArticleResource[] findByGroupId_PrevAndNext(
129         long resourcePrimKey, long groupId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portlet.journal.NoSuchArticleResourceException {
133         return getPersistence()
134                    .findByGroupId_PrevAndNext(resourcePrimKey, groupId, obc);
135     }
136 
137     public static com.liferay.portlet.journal.model.JournalArticleResource findByG_A(
138         long groupId, java.lang.String articleId)
139         throws com.liferay.portal.SystemException,
140             com.liferay.portlet.journal.NoSuchArticleResourceException {
141         return getPersistence().findByG_A(groupId, articleId);
142     }
143 
144     public static com.liferay.portlet.journal.model.JournalArticleResource fetchByG_A(
145         long groupId, java.lang.String articleId)
146         throws com.liferay.portal.SystemException {
147         return getPersistence().fetchByG_A(groupId, articleId);
148     }
149 
150     public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findWithDynamicQuery(
151         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findWithDynamicQuery(queryInitializer);
154     }
155 
156     public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findWithDynamicQuery(
157         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
158         int begin, int end) throws com.liferay.portal.SystemException {
159         return getPersistence()
160                    .findWithDynamicQuery(queryInitializer, begin, end);
161     }
162 
163     public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll()
164         throws com.liferay.portal.SystemException {
165         return getPersistence().findAll();
166     }
167 
168     public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll(
169         int begin, int end) throws com.liferay.portal.SystemException {
170         return getPersistence().findAll(begin, end);
171     }
172 
173     public static java.util.List<com.liferay.portlet.journal.model.JournalArticleResource> findAll(
174         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
175         throws com.liferay.portal.SystemException {
176         return getPersistence().findAll(begin, end, obc);
177     }
178 
179     public static void removeByGroupId(long groupId)
180         throws com.liferay.portal.SystemException {
181         getPersistence().removeByGroupId(groupId);
182     }
183 
184     public static void removeByG_A(long groupId, java.lang.String articleId)
185         throws com.liferay.portal.SystemException,
186             com.liferay.portlet.journal.NoSuchArticleResourceException {
187         getPersistence().removeByG_A(groupId, articleId);
188     }
189 
190     public static void removeAll() throws com.liferay.portal.SystemException {
191         getPersistence().removeAll();
192     }
193 
194     public static int countByGroupId(long groupId)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().countByGroupId(groupId);
197     }
198 
199     public static int countByG_A(long groupId, java.lang.String articleId)
200         throws com.liferay.portal.SystemException {
201         return getPersistence().countByG_A(groupId, articleId);
202     }
203 
204     public static int countAll() throws com.liferay.portal.SystemException {
205         return getPersistence().countAll();
206     }
207 
208     public static JournalArticleResourcePersistence getPersistence() {
209         return _getUtil()._persistence;
210     }
211 
212     public void setPersistence(JournalArticleResourcePersistence persistence) {
213         _persistence = persistence;
214     }
215 
216     private static JournalArticleResourceUtil _getUtil() {
217         if (_util == null) {
218             _util = (JournalArticleResourceUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
219         }
220 
221         return _util;
222     }
223 
224     private static final String _UTIL = JournalArticleResourceUtil.class.getName();
225     private static JournalArticleResourceUtil _util;
226     private JournalArticleResourcePersistence _persistence;
227 }