001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.expando.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the expando table local service. This utility wraps {@link com.liferay.portlet.expando.service.impl.ExpandoTableLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see ExpandoTableLocalService
030     * @see com.liferay.portlet.expando.service.base.ExpandoTableLocalServiceBaseImpl
031     * @see com.liferay.portlet.expando.service.impl.ExpandoTableLocalServiceImpl
032     * @generated
033     */
034    public class ExpandoTableLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.expando.service.impl.ExpandoTableLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the expando table to the database. Also notifies the appropriate model listeners.
043            *
044            * @param expandoTable the expando table
045            * @return the expando table that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.expando.model.ExpandoTable addExpandoTable(
049                    com.liferay.portlet.expando.model.ExpandoTable expandoTable)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addExpandoTable(expandoTable);
052            }
053    
054            /**
055            * Creates a new expando table with the primary key. Does not add the expando table to the database.
056            *
057            * @param tableId the primary key for the new expando table
058            * @return the new expando table
059            */
060            public static com.liferay.portlet.expando.model.ExpandoTable createExpandoTable(
061                    long tableId) {
062                    return getService().createExpandoTable(tableId);
063            }
064    
065            /**
066            * Deletes the expando table with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param tableId the primary key of the expando table
069            * @throws PortalException if a expando table with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteExpandoTable(long tableId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteExpandoTable(tableId);
076            }
077    
078            /**
079            * Deletes the expando table from the database. Also notifies the appropriate model listeners.
080            *
081            * @param expandoTable the expando table
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteExpandoTable(
085                    com.liferay.portlet.expando.model.ExpandoTable expandoTable)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteExpandoTable(expandoTable);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            /**
162            * Returns the expando table with the primary key.
163            *
164            * @param tableId the primary key of the expando table
165            * @return the expando table
166            * @throws PortalException if a expando table with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.expando.model.ExpandoTable getExpandoTable(
170                    long tableId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getExpandoTable(tableId);
174            }
175    
176            public static com.liferay.portal.model.PersistedModel getPersistedModel(
177                    java.io.Serializable primaryKeyObj)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    return getService().getPersistedModel(primaryKeyObj);
181            }
182    
183            /**
184            * Returns a range of all the expando tables.
185            *
186            * <p>
187            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
188            * </p>
189            *
190            * @param start the lower bound of the range of expando tables
191            * @param end the upper bound of the range of expando tables (not inclusive)
192            * @return the range of expando tables
193            * @throws SystemException if a system exception occurred
194            */
195            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> getExpandoTables(
196                    int start, int end)
197                    throws com.liferay.portal.kernel.exception.SystemException {
198                    return getService().getExpandoTables(start, end);
199            }
200    
201            /**
202            * Returns the number of expando tables.
203            *
204            * @return the number of expando tables
205            * @throws SystemException if a system exception occurred
206            */
207            public static int getExpandoTablesCount()
208                    throws com.liferay.portal.kernel.exception.SystemException {
209                    return getService().getExpandoTablesCount();
210            }
211    
212            /**
213            * Updates the expando table in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
214            *
215            * @param expandoTable the expando table
216            * @return the expando table that was updated
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portlet.expando.model.ExpandoTable updateExpandoTable(
220                    com.liferay.portlet.expando.model.ExpandoTable expandoTable)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getService().updateExpandoTable(expandoTable);
223            }
224    
225            /**
226            * Updates the expando table in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
227            *
228            * @param expandoTable the expando table
229            * @param merge whether to merge the expando table with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
230            * @return the expando table that was updated
231            * @throws SystemException if a system exception occurred
232            */
233            public static com.liferay.portlet.expando.model.ExpandoTable updateExpandoTable(
234                    com.liferay.portlet.expando.model.ExpandoTable expandoTable,
235                    boolean merge)
236                    throws com.liferay.portal.kernel.exception.SystemException {
237                    return getService().updateExpandoTable(expandoTable, merge);
238            }
239    
240            /**
241            * Returns the Spring bean ID for this bean.
242            *
243            * @return the Spring bean ID for this bean
244            */
245            public static java.lang.String getBeanIdentifier() {
246                    return getService().getBeanIdentifier();
247            }
248    
249            /**
250            * Sets the Spring bean ID for this bean.
251            *
252            * @param beanIdentifier the Spring bean ID for this bean
253            */
254            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
255                    getService().setBeanIdentifier(beanIdentifier);
256            }
257    
258            public static com.liferay.portlet.expando.model.ExpandoTable addDefaultTable(
259                    long companyId, long classNameId)
260                    throws com.liferay.portal.kernel.exception.PortalException,
261                            com.liferay.portal.kernel.exception.SystemException {
262                    return getService().addDefaultTable(companyId, classNameId);
263            }
264    
265            public static com.liferay.portlet.expando.model.ExpandoTable addDefaultTable(
266                    long companyId, java.lang.String className)
267                    throws com.liferay.portal.kernel.exception.PortalException,
268                            com.liferay.portal.kernel.exception.SystemException {
269                    return getService().addDefaultTable(companyId, className);
270            }
271    
272            public static com.liferay.portlet.expando.model.ExpandoTable addTable(
273                    long companyId, long classNameId, java.lang.String name)
274                    throws com.liferay.portal.kernel.exception.PortalException,
275                            com.liferay.portal.kernel.exception.SystemException {
276                    return getService().addTable(companyId, classNameId, name);
277            }
278    
279            /**
280            * @deprecated {@link #addTable(long, long, String)}
281            */
282            public static com.liferay.portlet.expando.model.ExpandoTable addTable(
283                    long classNameId, java.lang.String name)
284                    throws com.liferay.portal.kernel.exception.PortalException,
285                            com.liferay.portal.kernel.exception.SystemException {
286                    return getService().addTable(classNameId, name);
287            }
288    
289            public static com.liferay.portlet.expando.model.ExpandoTable addTable(
290                    long companyId, java.lang.String className, java.lang.String name)
291                    throws com.liferay.portal.kernel.exception.PortalException,
292                            com.liferay.portal.kernel.exception.SystemException {
293                    return getService().addTable(companyId, className, name);
294            }
295    
296            /**
297            * @deprecated {@link #addTable(long, String, String)}
298            */
299            public static com.liferay.portlet.expando.model.ExpandoTable addTable(
300                    java.lang.String className, java.lang.String name)
301                    throws com.liferay.portal.kernel.exception.PortalException,
302                            com.liferay.portal.kernel.exception.SystemException {
303                    return getService().addTable(className, name);
304            }
305    
306            public static void deleteTable(
307                    com.liferay.portlet.expando.model.ExpandoTable table)
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    getService().deleteTable(table);
310            }
311    
312            public static void deleteTable(long tableId)
313                    throws com.liferay.portal.kernel.exception.PortalException,
314                            com.liferay.portal.kernel.exception.SystemException {
315                    getService().deleteTable(tableId);
316            }
317    
318            public static void deleteTable(long companyId, long classNameId,
319                    java.lang.String name)
320                    throws com.liferay.portal.kernel.exception.PortalException,
321                            com.liferay.portal.kernel.exception.SystemException {
322                    getService().deleteTable(companyId, classNameId, name);
323            }
324    
325            public static void deleteTable(long companyId, java.lang.String className,
326                    java.lang.String name)
327                    throws com.liferay.portal.kernel.exception.PortalException,
328                            com.liferay.portal.kernel.exception.SystemException {
329                    getService().deleteTable(companyId, className, name);
330            }
331    
332            public static void deleteTables(long companyId, long classNameId)
333                    throws com.liferay.portal.kernel.exception.SystemException {
334                    getService().deleteTables(companyId, classNameId);
335            }
336    
337            public static void deleteTables(long companyId, java.lang.String className)
338                    throws com.liferay.portal.kernel.exception.SystemException {
339                    getService().deleteTables(companyId, className);
340            }
341    
342            public static com.liferay.portlet.expando.model.ExpandoTable fetchDefaultTable(
343                    long companyId, long classNameId)
344                    throws com.liferay.portal.kernel.exception.SystemException {
345                    return getService().fetchDefaultTable(companyId, classNameId);
346            }
347    
348            public static com.liferay.portlet.expando.model.ExpandoTable fetchDefaultTable(
349                    long companyId, java.lang.String className)
350                    throws com.liferay.portal.kernel.exception.SystemException {
351                    return getService().fetchDefaultTable(companyId, className);
352            }
353    
354            public static com.liferay.portlet.expando.model.ExpandoTable fetchTable(
355                    long companyId, long classNameId, java.lang.String name)
356                    throws com.liferay.portal.kernel.exception.SystemException {
357                    return getService().fetchTable(companyId, classNameId, name);
358            }
359    
360            public static com.liferay.portlet.expando.model.ExpandoTable getDefaultTable(
361                    long companyId, long classNameId)
362                    throws com.liferay.portal.kernel.exception.PortalException,
363                            com.liferay.portal.kernel.exception.SystemException {
364                    return getService().getDefaultTable(companyId, classNameId);
365            }
366    
367            public static com.liferay.portlet.expando.model.ExpandoTable getDefaultTable(
368                    long companyId, java.lang.String className)
369                    throws com.liferay.portal.kernel.exception.PortalException,
370                            com.liferay.portal.kernel.exception.SystemException {
371                    return getService().getDefaultTable(companyId, className);
372            }
373    
374            public static com.liferay.portlet.expando.model.ExpandoTable getTable(
375                    long tableId)
376                    throws com.liferay.portal.kernel.exception.PortalException,
377                            com.liferay.portal.kernel.exception.SystemException {
378                    return getService().getTable(tableId);
379            }
380    
381            public static com.liferay.portlet.expando.model.ExpandoTable getTable(
382                    long companyId, long classNameId, java.lang.String name)
383                    throws com.liferay.portal.kernel.exception.PortalException,
384                            com.liferay.portal.kernel.exception.SystemException {
385                    return getService().getTable(companyId, classNameId, name);
386            }
387    
388            /**
389            * @deprecated {@link #getTable(long, long, String)}
390            */
391            public static com.liferay.portlet.expando.model.ExpandoTable getTable(
392                    long classNameId, java.lang.String name)
393                    throws com.liferay.portal.kernel.exception.PortalException,
394                            com.liferay.portal.kernel.exception.SystemException {
395                    return getService().getTable(classNameId, name);
396            }
397    
398            public static com.liferay.portlet.expando.model.ExpandoTable getTable(
399                    long companyId, java.lang.String className, java.lang.String name)
400                    throws com.liferay.portal.kernel.exception.PortalException,
401                            com.liferay.portal.kernel.exception.SystemException {
402                    return getService().getTable(companyId, className, name);
403            }
404    
405            /**
406            * @deprecated {@link #getTable(long, String, String)}
407            */
408            public static com.liferay.portlet.expando.model.ExpandoTable getTable(
409                    java.lang.String className, java.lang.String name)
410                    throws com.liferay.portal.kernel.exception.PortalException,
411                            com.liferay.portal.kernel.exception.SystemException {
412                    return getService().getTable(className, name);
413            }
414    
415            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> getTables(
416                    long companyId, long classNameId)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getService().getTables(companyId, classNameId);
419            }
420    
421            public static java.util.List<com.liferay.portlet.expando.model.ExpandoTable> getTables(
422                    long companyId, java.lang.String className)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getService().getTables(companyId, className);
425            }
426    
427            public static com.liferay.portlet.expando.model.ExpandoTable updateTable(
428                    long tableId, java.lang.String name)
429                    throws com.liferay.portal.kernel.exception.PortalException,
430                            com.liferay.portal.kernel.exception.SystemException {
431                    return getService().updateTable(tableId, name);
432            }
433    
434            public static ExpandoTableLocalService getService() {
435                    if (_service == null) {
436                            _service = (ExpandoTableLocalService)PortalBeanLocatorUtil.locate(ExpandoTableLocalService.class.getName());
437    
438                            ReferenceRegistry.registerReference(ExpandoTableLocalServiceUtil.class,
439                                    "_service");
440                            MethodCache.remove(ExpandoTableLocalService.class);
441                    }
442    
443                    return _service;
444            }
445    
446            public void setService(ExpandoTableLocalService service) {
447                    MethodCache.remove(ExpandoTableLocalService.class);
448    
449                    _service = service;
450    
451                    ReferenceRegistry.registerReference(ExpandoTableLocalServiceUtil.class,
452                            "_service");
453                    MethodCache.remove(ExpandoTableLocalService.class);
454            }
455    
456            private static ExpandoTableLocalService _service;
457    }