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