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