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