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            /**
088            * Deletes the expando column from the database. Also notifies the appropriate model listeners.
089            *
090            * @param expandoColumn the expando column
091            * @return the expando column that was removed
092            */
093            @Indexable(type = IndexableType.DELETE)
094            public ExpandoColumn deleteExpandoColumn(ExpandoColumn expandoColumn);
095    
096            /**
097            * Deletes the expando column with the primary key from the database. Also notifies the appropriate model listeners.
098            *
099            * @param columnId the primary key of the expando column
100            * @return the expando column that was removed
101            * @throws PortalException if a expando column with the primary key could not be found
102            */
103            @Indexable(type = IndexableType.DELETE)
104            public ExpandoColumn deleteExpandoColumn(long columnId)
105                    throws PortalException;
106    
107            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
108            public ExpandoColumn fetchExpandoColumn(long columnId);
109    
110            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
111            public ExpandoColumn getColumn(long columnId) throws PortalException;
112    
113            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
114            public ExpandoColumn getColumn(long companyId, java.lang.String className,
115                    java.lang.String tableName, java.lang.String name);
116    
117            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
118            public ExpandoColumn getColumn(long companyId, long classNameId,
119                    java.lang.String tableName, java.lang.String name);
120    
121            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
122            public ExpandoColumn getColumn(long tableId, java.lang.String name);
123    
124            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125            public ExpandoColumn getDefaultTableColumn(long companyId,
126                    java.lang.String className, java.lang.String name);
127    
128            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
129            public ExpandoColumn getDefaultTableColumn(long companyId,
130                    long classNameId, java.lang.String name);
131    
132            /**
133            * Returns the expando column with the primary key.
134            *
135            * @param columnId the primary key of the expando column
136            * @return the expando column
137            * @throws PortalException if a expando column with the primary key could not be found
138            */
139            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
140            public ExpandoColumn getExpandoColumn(long columnId)
141                    throws PortalException;
142    
143            public ExpandoColumn updateColumn(long columnId, java.lang.String name,
144                    int type) throws PortalException;
145    
146            public ExpandoColumn updateColumn(long columnId, java.lang.String name,
147                    int type, java.lang.Object defaultData) throws PortalException;
148    
149            /**
150            * Updates the expando column in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
151            *
152            * @param expandoColumn the expando column
153            * @return the expando column that was updated
154            */
155            @Indexable(type = IndexableType.REINDEX)
156            public ExpandoColumn updateExpandoColumn(ExpandoColumn expandoColumn);
157    
158            public ExpandoColumn updateTypeSettings(long columnId,
159                    java.lang.String typeSettings) throws PortalException;
160    
161            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162            public ActionableDynamicQuery getActionableDynamicQuery();
163    
164            public DynamicQuery dynamicQuery();
165    
166            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
168    
169            /**
170            * @throws PortalException
171            */
172            @Override
173            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
174                    throws PortalException;
175    
176            @Override
177            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
179                    throws PortalException;
180    
181            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
182            public int getColumnsCount(long companyId, java.lang.String className,
183                    java.lang.String tableName);
184    
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public int getColumnsCount(long companyId, long classNameId,
187                    java.lang.String tableName);
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public int getColumnsCount(long tableId);
191    
192            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193            public int getDefaultTableColumnsCount(long companyId,
194                    java.lang.String className);
195    
196            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
197            public int getDefaultTableColumnsCount(long companyId, long classNameId);
198    
199            /**
200            * Returns the number of expando columns.
201            *
202            * @return the number of expando columns
203            */
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public int getExpandoColumnsCount();
206    
207            /**
208            * Returns the OSGi service identifier.
209            *
210            * @return the OSGi service identifier
211            */
212            public java.lang.String getOSGiServiceIdentifier();
213    
214            /**
215            * Performs a dynamic query on the database and returns the matching rows.
216            *
217            * @param dynamicQuery the dynamic query
218            * @return the matching rows
219            */
220            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
221    
222            /**
223            * Performs a dynamic query on the database and returns a range of the matching rows.
224            *
225            * <p>
226            * 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.
227            * </p>
228            *
229            * @param dynamicQuery the dynamic query
230            * @param start the lower bound of the range of model instances
231            * @param end the upper bound of the range of model instances (not inclusive)
232            * @return the range of matching rows
233            */
234            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
235                    int end);
236    
237            /**
238            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
239            *
240            * <p>
241            * 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.
242            * </p>
243            *
244            * @param dynamicQuery the dynamic query
245            * @param start the lower bound of the range of model instances
246            * @param end the upper bound of the range of model instances (not inclusive)
247            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
248            * @return the ordered range of matching rows
249            */
250            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
251                    int end, OrderByComparator<T> orderByComparator);
252    
253            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
254            public List<ExpandoColumn> getColumns(long companyId,
255                    java.lang.String className, java.lang.String tableName);
256    
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public List<ExpandoColumn> getColumns(long companyId,
259                    java.lang.String className, java.lang.String tableName,
260                    Collection<java.lang.String> columnNames);
261    
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public List<ExpandoColumn> getColumns(long companyId, long classNameId,
264                    java.lang.String tableName);
265    
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public List<ExpandoColumn> getColumns(long companyId, long classNameId,
268                    java.lang.String tableName, Collection<java.lang.String> names);
269    
270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
271            public List<ExpandoColumn> getColumns(long tableId);
272    
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public List<ExpandoColumn> getColumns(long tableId,
275                    Collection<java.lang.String> names);
276    
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public List<ExpandoColumn> getDefaultTableColumns(long companyId,
279                    java.lang.String className);
280    
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public List<ExpandoColumn> getDefaultTableColumns(long companyId,
283                    long classNameId);
284    
285            /**
286            * Returns a range of all the expando columns.
287            *
288            * <p>
289            * 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.
290            * </p>
291            *
292            * @param start the lower bound of the range of expando columns
293            * @param end the upper bound of the range of expando columns (not inclusive)
294            * @return the range of expando columns
295            */
296            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
297            public List<ExpandoColumn> getExpandoColumns(int start, int end);
298    
299            /**
300            * Returns the number of rows matching the dynamic query.
301            *
302            * @param dynamicQuery the dynamic query
303            * @return the number of rows matching the dynamic query
304            */
305            public long dynamicQueryCount(DynamicQuery dynamicQuery);
306    
307            /**
308            * Returns the number of rows matching the dynamic query.
309            *
310            * @param dynamicQuery the dynamic query
311            * @param projection the projection to apply to the query
312            * @return the number of rows matching the dynamic query
313            */
314            public long dynamicQueryCount(DynamicQuery dynamicQuery,
315                    Projection projection);
316    
317            public void deleteColumn(ExpandoColumn column);
318    
319            public void deleteColumn(long columnId) throws PortalException;
320    
321            public void deleteColumn(long companyId, java.lang.String className,
322                    java.lang.String tableName, java.lang.String name)
323                    throws PortalException;
324    
325            public void deleteColumn(long companyId, long classNameId,
326                    java.lang.String tableName, java.lang.String name)
327                    throws PortalException;
328    
329            public void deleteColumn(long tableId, java.lang.String name);
330    
331            public void deleteColumns(long companyId, java.lang.String className,
332                    java.lang.String tableName) throws PortalException;
333    
334            public void deleteColumns(long companyId, long classNameId,
335                    java.lang.String tableName) throws PortalException;
336    
337            public void deleteColumns(long tableId);
338    }