001    /**
002     * Copyright (c) 2000-present 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.expando.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoTable;
020    
021    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
024    import com.liferay.portal.kernel.dao.orm.Projection;
025    import com.liferay.portal.kernel.exception.PortalException;
026    import com.liferay.portal.kernel.exception.SystemException;
027    import com.liferay.portal.kernel.model.PersistedModel;
028    import com.liferay.portal.kernel.search.Indexable;
029    import com.liferay.portal.kernel.search.IndexableType;
030    import com.liferay.portal.kernel.service.BaseLocalService;
031    import com.liferay.portal.kernel.service.PersistedModelLocalService;
032    import com.liferay.portal.kernel.transaction.Isolation;
033    import com.liferay.portal.kernel.transaction.Propagation;
034    import com.liferay.portal.kernel.transaction.Transactional;
035    import com.liferay.portal.kernel.util.OrderByComparator;
036    
037    import java.io.Serializable;
038    
039    import java.util.List;
040    
041    /**
042     * Provides the local service interface for ExpandoTable. Methods of this
043     * service will not have security checks based on the propagated JAAS
044     * credentials because this service can only be accessed from within the same
045     * VM.
046     *
047     * @author Brian Wing Shun Chan
048     * @see ExpandoTableLocalServiceUtil
049     * @see com.liferay.portlet.expando.service.base.ExpandoTableLocalServiceBaseImpl
050     * @see com.liferay.portlet.expando.service.impl.ExpandoTableLocalServiceImpl
051     * @generated
052     */
053    @ProviderType
054    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
055            PortalException.class, SystemException.class})
056    public interface ExpandoTableLocalService extends BaseLocalService,
057            PersistedModelLocalService {
058            /*
059             * NOTE FOR DEVELOPERS:
060             *
061             * Never modify or reference this interface directly. Always use {@link ExpandoTableLocalServiceUtil} to access the expando table local service. Add custom service methods to {@link com.liferay.portlet.expando.service.impl.ExpandoTableLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
062             */
063            public ExpandoTable addDefaultTable(long companyId,
064                    java.lang.String className) throws PortalException;
065    
066            public ExpandoTable addDefaultTable(long companyId, long classNameId)
067                    throws PortalException;
068    
069            /**
070            * Adds the expando table to the database. Also notifies the appropriate model listeners.
071            *
072            * @param expandoTable the expando table
073            * @return the expando table that was added
074            */
075            @Indexable(type = IndexableType.REINDEX)
076            public ExpandoTable addExpandoTable(ExpandoTable expandoTable);
077    
078            public ExpandoTable addTable(long companyId, java.lang.String className,
079                    java.lang.String name) throws PortalException;
080    
081            public ExpandoTable addTable(long companyId, long classNameId,
082                    java.lang.String name) throws PortalException;
083    
084            /**
085            * Creates a new expando table with the primary key. Does not add the expando table to the database.
086            *
087            * @param tableId the primary key for the new expando table
088            * @return the new expando table
089            */
090            public ExpandoTable createExpandoTable(long tableId);
091    
092            /**
093            * Deletes the expando table from the database. Also notifies the appropriate model listeners.
094            *
095            * @param expandoTable the expando table
096            * @return the expando table that was removed
097            */
098            @Indexable(type = IndexableType.DELETE)
099            public ExpandoTable deleteExpandoTable(ExpandoTable expandoTable);
100    
101            /**
102            * Deletes the expando table with the primary key from the database. Also notifies the appropriate model listeners.
103            *
104            * @param tableId the primary key of the expando table
105            * @return the expando table that was removed
106            * @throws PortalException if a expando table with the primary key could not be found
107            */
108            @Indexable(type = IndexableType.DELETE)
109            public ExpandoTable deleteExpandoTable(long tableId)
110                    throws PortalException;
111    
112            /**
113            * @throws PortalException
114            */
115            @Override
116            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
117                    throws PortalException;
118    
119            public void deleteTable(long companyId, java.lang.String className,
120                    java.lang.String name) throws PortalException;
121    
122            public void deleteTable(long companyId, long classNameId,
123                    java.lang.String name) throws PortalException;
124    
125            public void deleteTable(ExpandoTable table);
126    
127            public void deleteTable(long tableId) throws PortalException;
128    
129            public void deleteTables(long companyId, java.lang.String className);
130    
131            public void deleteTables(long companyId, long classNameId);
132    
133            public DynamicQuery dynamicQuery();
134    
135            /**
136            * Performs a dynamic query on the database and returns the matching rows.
137            *
138            * @param dynamicQuery the dynamic query
139            * @return the matching rows
140            */
141            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
142    
143            /**
144            * Performs a dynamic query on the database and returns a range of the matching rows.
145            *
146            * <p>
147            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoTableModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
148            * </p>
149            *
150            * @param dynamicQuery the dynamic query
151            * @param start the lower bound of the range of model instances
152            * @param end the upper bound of the range of model instances (not inclusive)
153            * @return the range of matching rows
154            */
155            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
156                    int end);
157    
158            /**
159            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
160            *
161            * <p>
162            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoTableModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
163            * </p>
164            *
165            * @param dynamicQuery the dynamic query
166            * @param start the lower bound of the range of model instances
167            * @param end the upper bound of the range of model instances (not inclusive)
168            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
169            * @return the ordered range of matching rows
170            */
171            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
172                    int end, OrderByComparator<T> orderByComparator);
173    
174            /**
175            * Returns the number of rows matching the dynamic query.
176            *
177            * @param dynamicQuery the dynamic query
178            * @return the number of rows matching the dynamic query
179            */
180            public long dynamicQueryCount(DynamicQuery dynamicQuery);
181    
182            /**
183            * Returns the number of rows matching the dynamic query.
184            *
185            * @param dynamicQuery the dynamic query
186            * @param projection the projection to apply to the query
187            * @return the number of rows matching the dynamic query
188            */
189            public long dynamicQueryCount(DynamicQuery dynamicQuery,
190                    Projection projection);
191    
192            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193            public ExpandoTable fetchDefaultTable(long companyId,
194                    java.lang.String className);
195    
196            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
197            public ExpandoTable fetchDefaultTable(long companyId, long classNameId);
198    
199            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200            public ExpandoTable fetchExpandoTable(long tableId);
201    
202            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
203            public ExpandoTable fetchTable(long companyId, long classNameId,
204                    java.lang.String name);
205    
206            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
207            public ActionableDynamicQuery getActionableDynamicQuery();
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public ExpandoTable getDefaultTable(long companyId,
211                    java.lang.String className) throws PortalException;
212    
213            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214            public ExpandoTable getDefaultTable(long companyId, long classNameId)
215                    throws PortalException;
216    
217            /**
218            * Returns the expando table with the primary key.
219            *
220            * @param tableId the primary key of the expando table
221            * @return the expando table
222            * @throws PortalException if a expando table with the primary key could not be found
223            */
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public ExpandoTable getExpandoTable(long tableId) throws PortalException;
226    
227            /**
228            * Returns a range of all the expando tables.
229            *
230            * <p>
231            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.expando.model.impl.ExpandoTableModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
232            * </p>
233            *
234            * @param start the lower bound of the range of expando tables
235            * @param end the upper bound of the range of expando tables (not inclusive)
236            * @return the range of expando tables
237            */
238            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
239            public List<ExpandoTable> getExpandoTables(int start, int end);
240    
241            /**
242            * Returns the number of expando tables.
243            *
244            * @return the number of expando tables
245            */
246            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247            public int getExpandoTablesCount();
248    
249            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
250            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
251    
252            /**
253            * Returns the OSGi service identifier.
254            *
255            * @return the OSGi service identifier
256            */
257            public java.lang.String getOSGiServiceIdentifier();
258    
259            @Override
260            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
261            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
262                    throws PortalException;
263    
264            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265            public ExpandoTable getTable(long companyId, java.lang.String className,
266                    java.lang.String name) throws PortalException;
267    
268            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
269            public ExpandoTable getTable(long companyId, long classNameId,
270                    java.lang.String name) throws PortalException;
271    
272            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
273            public ExpandoTable getTable(long tableId) throws PortalException;
274    
275            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
276            public List<ExpandoTable> getTables(long companyId,
277                    java.lang.String className);
278    
279            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
280            public List<ExpandoTable> getTables(long companyId, long classNameId);
281    
282            /**
283            * Updates the expando table in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
284            *
285            * @param expandoTable the expando table
286            * @return the expando table that was updated
287            */
288            @Indexable(type = IndexableType.REINDEX)
289            public ExpandoTable updateExpandoTable(ExpandoTable expandoTable);
290    
291            public ExpandoTable updateTable(long tableId, java.lang.String name)
292                    throws PortalException;
293    }