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.expando.service.persistence;
21  
22  /**
23   * <a href="ExpandoRowUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class ExpandoRowUtil {
29      public static void cacheResult(
30          com.liferay.portlet.expando.model.ExpandoRow expandoRow) {
31          getPersistence().cacheResult(expandoRow);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.expando.model.ExpandoRow> expandoRows) {
36          getPersistence().cacheResult(expandoRows);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.expando.model.ExpandoRow create(
44          long rowId) {
45          return getPersistence().create(rowId);
46      }
47  
48      public static com.liferay.portlet.expando.model.ExpandoRow remove(
49          long rowId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.expando.NoSuchRowException {
52          return getPersistence().remove(rowId);
53      }
54  
55      public static com.liferay.portlet.expando.model.ExpandoRow remove(
56          com.liferay.portlet.expando.model.ExpandoRow expandoRow)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(expandoRow);
59      }
60  
61      /**
62       * @deprecated Use <code>update(ExpandoRow expandoRow, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.expando.model.ExpandoRow update(
65          com.liferay.portlet.expando.model.ExpandoRow expandoRow)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(expandoRow);
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        expandoRow 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 expandoRow 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.expando.model.ExpandoRow update(
84          com.liferay.portlet.expando.model.ExpandoRow expandoRow, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(expandoRow, merge);
87      }
88  
89      public static com.liferay.portlet.expando.model.ExpandoRow updateImpl(
90          com.liferay.portlet.expando.model.ExpandoRow expandoRow, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(expandoRow, merge);
93      }
94  
95      public static com.liferay.portlet.expando.model.ExpandoRow findByPrimaryKey(
96          long rowId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.expando.NoSuchRowException {
99          return getPersistence().findByPrimaryKey(rowId);
100     }
101 
102     public static com.liferay.portlet.expando.model.ExpandoRow fetchByPrimaryKey(
103         long rowId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(rowId);
105     }
106 
107     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId(
108         long tableId) throws com.liferay.portal.SystemException {
109         return getPersistence().findByTableId(tableId);
110     }
111 
112     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId(
113         long tableId, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByTableId(tableId, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId(
119         long tableId, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByTableId(tableId, start, end, obc);
123     }
124 
125     public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_First(
126         long tableId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.SystemException,
128             com.liferay.portlet.expando.NoSuchRowException {
129         return getPersistence().findByTableId_First(tableId, obc);
130     }
131 
132     public static com.liferay.portlet.expando.model.ExpandoRow findByTableId_Last(
133         long tableId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.SystemException,
135             com.liferay.portlet.expando.NoSuchRowException {
136         return getPersistence().findByTableId_Last(tableId, obc);
137     }
138 
139     public static com.liferay.portlet.expando.model.ExpandoRow[] findByTableId_PrevAndNext(
140         long rowId, long tableId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.expando.NoSuchRowException {
144         return getPersistence().findByTableId_PrevAndNext(rowId, tableId, obc);
145     }
146 
147     public static com.liferay.portlet.expando.model.ExpandoRow findByT_C(
148         long tableId, long classPK)
149         throws com.liferay.portal.SystemException,
150             com.liferay.portlet.expando.NoSuchRowException {
151         return getPersistence().findByT_C(tableId, classPK);
152     }
153 
154     public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C(
155         long tableId, long classPK) throws com.liferay.portal.SystemException {
156         return getPersistence().fetchByT_C(tableId, classPK);
157     }
158 
159     public static com.liferay.portlet.expando.model.ExpandoRow fetchByT_C(
160         long tableId, long classPK, boolean retrieveFromCache)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().fetchByT_C(tableId, classPK, retrieveFromCache);
163     }
164 
165     public static java.util.List<Object> findWithDynamicQuery(
166         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167         throws com.liferay.portal.SystemException {
168         return getPersistence().findWithDynamicQuery(dynamicQuery);
169     }
170 
171     public static java.util.List<Object> findWithDynamicQuery(
172         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
173         int end) throws com.liferay.portal.SystemException {
174         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
175     }
176 
177     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll()
178         throws com.liferay.portal.SystemException {
179         return getPersistence().findAll();
180     }
181 
182     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll(
183         int start, int end) throws com.liferay.portal.SystemException {
184         return getPersistence().findAll(start, end);
185     }
186 
187     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll(
188         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
189         throws com.liferay.portal.SystemException {
190         return getPersistence().findAll(start, end, obc);
191     }
192 
193     public static void removeByTableId(long tableId)
194         throws com.liferay.portal.SystemException {
195         getPersistence().removeByTableId(tableId);
196     }
197 
198     public static void removeByT_C(long tableId, long classPK)
199         throws com.liferay.portal.SystemException,
200             com.liferay.portlet.expando.NoSuchRowException {
201         getPersistence().removeByT_C(tableId, classPK);
202     }
203 
204     public static void removeAll() throws com.liferay.portal.SystemException {
205         getPersistence().removeAll();
206     }
207 
208     public static int countByTableId(long tableId)
209         throws com.liferay.portal.SystemException {
210         return getPersistence().countByTableId(tableId);
211     }
212 
213     public static int countByT_C(long tableId, long classPK)
214         throws com.liferay.portal.SystemException {
215         return getPersistence().countByT_C(tableId, classPK);
216     }
217 
218     public static int countAll() throws com.liferay.portal.SystemException {
219         return getPersistence().countAll();
220     }
221 
222     public static ExpandoRowPersistence getPersistence() {
223         return _persistence;
224     }
225 
226     public void setPersistence(ExpandoRowPersistence persistence) {
227         _persistence = persistence;
228     }
229 
230     private static ExpandoRowPersistence _persistence;
231 }