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.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 begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByTableId(tableId, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findByTableId(
108         long tableId, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByTableId(tableId, begin, 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 java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findWithDynamicQuery(
137         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
138         throws com.liferay.portal.SystemException {
139         return getPersistence().findWithDynamicQuery(queryInitializer);
140     }
141 
142     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findWithDynamicQuery(
143         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
144         int begin, int end) throws com.liferay.portal.SystemException {
145         return getPersistence()
146                    .findWithDynamicQuery(queryInitializer, begin, end);
147     }
148 
149     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll()
150         throws com.liferay.portal.SystemException {
151         return getPersistence().findAll();
152     }
153 
154     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll(
155         int begin, int end) throws com.liferay.portal.SystemException {
156         return getPersistence().findAll(begin, end);
157     }
158 
159     public static java.util.List<com.liferay.portlet.expando.model.ExpandoRow> findAll(
160         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().findAll(begin, end, obc);
163     }
164 
165     public static void removeByTableId(long tableId)
166         throws com.liferay.portal.SystemException {
167         getPersistence().removeByTableId(tableId);
168     }
169 
170     public static void removeAll() throws com.liferay.portal.SystemException {
171         getPersistence().removeAll();
172     }
173 
174     public static int countByTableId(long tableId)
175         throws com.liferay.portal.SystemException {
176         return getPersistence().countByTableId(tableId);
177     }
178 
179     public static int countAll() throws com.liferay.portal.SystemException {
180         return getPersistence().countAll();
181     }
182 
183     public static ExpandoRowPersistence getPersistence() {
184         return _getUtil()._persistence;
185     }
186 
187     public void setPersistence(ExpandoRowPersistence persistence) {
188         _persistence = persistence;
189     }
190 
191     private static ExpandoRowUtil _getUtil() {
192         if (_util == null) {
193             _util = (ExpandoRowUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
194         }
195 
196         return _util;
197     }
198 
199     private static final String _UTIL = ExpandoRowUtil.class.getName();
200     private static ExpandoRowUtil _util;
201     private ExpandoRowPersistence _persistence;
202 }