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.ExpandoColumn;
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.Collection;
040    import java.util.List;
041    
042    /**
043     * Provides the local service interface for ExpandoColumn. Methods of this
044     * service will not have security checks based on the propagated JAAS
045     * credentials because this service can only be accessed from within the same
046     * VM.
047     *
048     * @author Brian Wing Shun Chan
049     * @see ExpandoColumnLocalServiceUtil
050     * @see com.liferay.portlet.expando.service.base.ExpandoColumnLocalServiceBaseImpl
051     * @see com.liferay.portlet.expando.service.impl.ExpandoColumnLocalServiceImpl
052     * @generated
053     */
054    @ProviderType
055    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
056            PortalException.class, SystemException.class})
057    public interface ExpandoColumnLocalService extends BaseLocalService,
058            PersistedModelLocalService {
059            /*
060             * NOTE FOR DEVELOPERS:
061             *
062             * Never modify or reference this interface directly. Always use {@link ExpandoColumnLocalServiceUtil} to access the expando column local service. Add custom service methods to {@link com.liferay.portlet.expando.service.impl.ExpandoColumnLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
063             */
064            public ExpandoColumn addColumn(long tableId, java.lang.String name, int type)
065                    throws PortalException;
066    
067            public ExpandoColumn addColumn(long tableId, java.lang.String name,
068                    int type, java.lang.Object defaultData) throws PortalException;
069    
070            /**
071            * Adds the expando column to the database. Also notifies the appropriate model listeners.
072            *
073            * @param expandoColumn the expando column
074            * @return the expando column that was added
075            */
076            @Indexable(type = IndexableType.REINDEX)
077            public ExpandoColumn addExpandoColumn(ExpandoColumn expandoColumn);
078    
079            /**
080            * Creates a new expando column with the primary key. Does not add the expando column to the database.
081            *
082            * @param columnId the primary key for the new expando column
083            * @return the new expando column
084            */
085            public ExpandoColumn createExpandoColumn(long columnId);
086    
087            public void deleteColumn(ExpandoColumn column);
088    
089            public void deleteColumn(long columnId) throws PortalException;
090    
091            public void deleteColumn(long companyId, java.lang.String className,
092                    java.lang.String tableName, java.lang.String name)
093                    throws PortalException;
094    
095            public void deleteColumn(long companyId, long classNameId,
096                    java.lang.String tableName, java.lang.String name)
097                    throws PortalException;
098    
099            public void deleteColumn(long tableId, java.lang.String name);
100    
101            public void deleteColumns(long companyId, java.lang.String className,
102                    java.lang.String tableName) throws PortalException;
103    
104            public void deleteColumns(long companyId, long classNameId,
105                    java.lang.String tableName) throws PortalException;
106    
107            public void deleteColumns(long tableId);
108    
109            /**
110            * Deletes the expando column with the primary key from the database. Also notifies the appropriate model listeners.
111            *
112            * @param columnId the primary key of the expando column
113            * @return the expando column that was removed
114            * @throws PortalException if a expando column with the primary key could not be found
115            */
116            @Indexable(type = IndexableType.DELETE)
117            public ExpandoColumn deleteExpandoColumn(long columnId)
118                    throws PortalException;
119    
120            /**
121            * Deletes the expando column from the database. Also notifies the appropriate model listeners.
122            *
123            * @param expandoColumn the expando column
124            * @return the expando column that was removed
125            */
126            @Indexable(type = IndexableType.DELETE)
127            public ExpandoColumn deleteExpandoColumn(ExpandoColumn expandoColumn);
128    
129            /**
130            * @throws PortalException
131            */
132            @Override
133            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
134                    throws PortalException;
135    
136            public DynamicQuery dynamicQuery();
137    
138            /**
139            * Performs a dynamic query on the database and returns the matching rows.
140            *
141            * @param dynamicQuery the dynamic query
142            * @return the matching rows
143            */
144            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
145    
146            /**
147            * Performs a dynamic query on the database and returns a range of the matching rows.
148            *
149            * <p>
150            * 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.ExpandoColumnModelImpl}. 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.
151            * </p>
152            *
153            * @param dynamicQuery the dynamic query
154            * @param start the lower bound of the range of model instances
155            * @param end the upper bound of the range of model instances (not inclusive)
156            * @return the range of matching rows
157            */
158            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
159                    int end);
160    
161            /**
162            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
163            *
164            * <p>
165            * 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.ExpandoColumnModelImpl}. 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.
166            * </p>
167            *
168            * @param dynamicQuery the dynamic query
169            * @param start the lower bound of the range of model instances
170            * @param end the upper bound of the range of model instances (not inclusive)
171            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
172            * @return the ordered range of matching rows
173            */
174            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
175                    int end, OrderByComparator<T> orderByComparator);
176    
177            /**
178            * Returns the number of rows matching the dynamic query.
179            *
180            * @param dynamicQuery the dynamic query
181            * @return the number of rows matching the dynamic query
182            */
183            public long dynamicQueryCount(DynamicQuery dynamicQuery);
184    
185            /**
186            * Returns the number of rows matching the dynamic query.
187            *
188            * @param dynamicQuery the dynamic query
189            * @param projection the projection to apply to the query
190            * @return the number of rows matching the dynamic query
191            */
192            public long dynamicQueryCount(DynamicQuery dynamicQuery,
193                    Projection projection);
194    
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public ExpandoColumn fetchExpandoColumn(long columnId);
197    
198            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
199            public ActionableDynamicQuery getActionableDynamicQuery();
200    
201            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
202            public ExpandoColumn getColumn(long columnId) throws PortalException;
203    
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public ExpandoColumn getColumn(long companyId, java.lang.String className,
206                    java.lang.String tableName, java.lang.String name);
207    
208            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209            public ExpandoColumn getColumn(long companyId, long classNameId,
210                    java.lang.String tableName, java.lang.String name);
211    
212            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213            public ExpandoColumn getColumn(long tableId, java.lang.String name);
214    
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public List<ExpandoColumn> getColumns(long companyId,
217                    java.lang.String className, java.lang.String tableName);
218    
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public List<ExpandoColumn> getColumns(long companyId,
221                    java.lang.String className, java.lang.String tableName,
222                    Collection<java.lang.String> columnNames);
223    
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public List<ExpandoColumn> getColumns(long companyId, long classNameId,
226                    java.lang.String tableName);
227    
228            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
229            public List<ExpandoColumn> getColumns(long companyId, long classNameId,
230                    java.lang.String tableName, Collection<java.lang.String> names);
231    
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public List<ExpandoColumn> getColumns(long tableId);
234    
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public List<ExpandoColumn> getColumns(long tableId,
237                    Collection<java.lang.String> names);
238    
239            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240            public int getColumnsCount(long companyId, java.lang.String className,
241                    java.lang.String tableName);
242    
243            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
244            public int getColumnsCount(long companyId, long classNameId,
245                    java.lang.String tableName);
246    
247            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
248            public int getColumnsCount(long tableId);
249    
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public ExpandoColumn getDefaultTableColumn(long companyId,
252                    java.lang.String className, java.lang.String name);
253    
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public ExpandoColumn getDefaultTableColumn(long companyId,
256                    long classNameId, java.lang.String name);
257    
258            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
259            public List<ExpandoColumn> getDefaultTableColumns(long companyId,
260                    java.lang.String className);
261    
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public List<ExpandoColumn> getDefaultTableColumns(long companyId,
264                    long classNameId);
265    
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public int getDefaultTableColumnsCount(long companyId,
268                    java.lang.String className);
269    
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public int getDefaultTableColumnsCount(long companyId, long classNameId);
272    
273            /**
274            * Returns the expando column with the primary key.
275            *
276            * @param columnId the primary key of the expando column
277            * @return the expando column
278            * @throws PortalException if a expando column with the primary key could not be found
279            */
280            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281            public ExpandoColumn getExpandoColumn(long columnId)
282                    throws PortalException;
283    
284            /**
285            * Returns a range of all the expando columns.
286            *
287            * <p>
288            * 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.ExpandoColumnModelImpl}. 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.
289            * </p>
290            *
291            * @param start the lower bound of the range of expando columns
292            * @param end the upper bound of the range of expando columns (not inclusive)
293            * @return the range of expando columns
294            */
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public List<ExpandoColumn> getExpandoColumns(int start, int end);
297    
298            /**
299            * Returns the number of expando columns.
300            *
301            * @return the number of expando columns
302            */
303            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
304            public int getExpandoColumnsCount();
305    
306            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
308    
309            /**
310            * Returns the OSGi service identifier.
311            *
312            * @return the OSGi service identifier
313            */
314            public java.lang.String getOSGiServiceIdentifier();
315    
316            @Override
317            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
318            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
319                    throws PortalException;
320    
321            public ExpandoColumn updateColumn(long columnId, java.lang.String name,
322                    int type) throws PortalException;
323    
324            public ExpandoColumn updateColumn(long columnId, java.lang.String name,
325                    int type, java.lang.Object defaultData) throws PortalException;
326    
327            /**
328            * Updates the expando column in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
329            *
330            * @param expandoColumn the expando column
331            * @return the expando column that was updated
332            */
333            @Indexable(type = IndexableType.REINDEX)
334            public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn);
335    
336            public ExpandoColumn updateTypeSettings(long columnId,
337                    java.lang.String typeSettings) throws PortalException;
338    }