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.ExpandoRow;
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 ExpandoRow. 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 ExpandoRowLocalServiceUtil
049     * @see com.liferay.portlet.expando.service.base.ExpandoRowLocalServiceBaseImpl
050     * @see com.liferay.portlet.expando.service.impl.ExpandoRowLocalServiceImpl
051     * @generated
052     */
053    @ProviderType
054    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
055            PortalException.class, SystemException.class})
056    public interface ExpandoRowLocalService extends BaseLocalService,
057            PersistedModelLocalService {
058            /*
059             * NOTE FOR DEVELOPERS:
060             *
061             * Never modify or reference this interface directly. Always use {@link ExpandoRowLocalServiceUtil} to access the expando row local service. Add custom service methods to {@link com.liferay.portlet.expando.service.impl.ExpandoRowLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
062             */
063    
064            /**
065            * Adds the expando row to the database. Also notifies the appropriate model listeners.
066            *
067            * @param expandoRow the expando row
068            * @return the expando row that was added
069            */
070            @Indexable(type = IndexableType.REINDEX)
071            public ExpandoRow addExpandoRow(ExpandoRow expandoRow);
072    
073            public ExpandoRow addRow(long tableId, long classPK)
074                    throws PortalException;
075    
076            /**
077            * Creates a new expando row with the primary key. Does not add the expando row to the database.
078            *
079            * @param rowId the primary key for the new expando row
080            * @return the new expando row
081            */
082            public ExpandoRow createExpandoRow(long rowId);
083    
084            /**
085            * Deletes the expando row from the database. Also notifies the appropriate model listeners.
086            *
087            * @param expandoRow the expando row
088            * @return the expando row that was removed
089            */
090            @Indexable(type = IndexableType.DELETE)
091            public ExpandoRow deleteExpandoRow(ExpandoRow expandoRow);
092    
093            /**
094            * Deletes the expando row with the primary key from the database. Also notifies the appropriate model listeners.
095            *
096            * @param rowId the primary key of the expando row
097            * @return the expando row that was removed
098            * @throws PortalException if a expando row with the primary key could not be found
099            */
100            @Indexable(type = IndexableType.DELETE)
101            public ExpandoRow deleteExpandoRow(long rowId) throws PortalException;
102    
103            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
104            public ExpandoRow fetchExpandoRow(long rowId);
105    
106            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
107            public ExpandoRow fetchRow(long tableId, long classPK);
108    
109            /**
110            * Returns the expando row with the primary key.
111            *
112            * @param rowId the primary key of the expando row
113            * @return the expando row
114            * @throws PortalException if a expando row with the primary key could not be found
115            */
116            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
117            public ExpandoRow getExpandoRow(long rowId) throws PortalException;
118    
119            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
120            public ExpandoRow getRow(long companyId, java.lang.String className,
121                    java.lang.String tableName, long classPK);
122    
123            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
124            public ExpandoRow getRow(long companyId, long classNameId,
125                    java.lang.String tableName, long classPK);
126    
127            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
128            public ExpandoRow getRow(long rowId) throws PortalException;
129    
130            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
131            public ExpandoRow getRow(long tableId, long classPK)
132                    throws PortalException;
133    
134            /**
135            * Updates the expando row in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
136            *
137            * @param expandoRow the expando row
138            * @return the expando row that was updated
139            */
140            @Indexable(type = IndexableType.REINDEX)
141            public ExpandoRow updateExpandoRow(ExpandoRow expandoRow);
142    
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public ActionableDynamicQuery getActionableDynamicQuery();
145    
146            public DynamicQuery dynamicQuery();
147    
148            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
149            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
150    
151            /**
152            * @throws PortalException
153            */
154            @Override
155            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
156                    throws PortalException;
157    
158            @Override
159            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
161                    throws PortalException;
162    
163            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
164            public int getDefaultTableRowsCount(long companyId,
165                    java.lang.String className);
166    
167            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
168            public int getDefaultTableRowsCount(long companyId, long classNameId);
169    
170            /**
171            * Returns the number of expando rows.
172            *
173            * @return the number of expando rows
174            */
175            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176            public int getExpandoRowsCount();
177    
178            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179            public int getRowsCount(long companyId, java.lang.String className,
180                    java.lang.String tableName);
181    
182            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
183            public int getRowsCount(long companyId, long classNameId,
184                    java.lang.String tableName);
185    
186            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
187            public int getRowsCount(long tableId);
188    
189            /**
190            * Returns the OSGi service identifier.
191            *
192            * @return the OSGi service identifier
193            */
194            public java.lang.String getOSGiServiceIdentifier();
195    
196            /**
197            * Performs a dynamic query on the database and returns the matching rows.
198            *
199            * @param dynamicQuery the dynamic query
200            * @return the matching rows
201            */
202            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
203    
204            /**
205            * Performs a dynamic query on the database and returns a range of the matching rows.
206            *
207            * <p>
208            * 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.ExpandoRowModelImpl}. 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.
209            * </p>
210            *
211            * @param dynamicQuery the dynamic query
212            * @param start the lower bound of the range of model instances
213            * @param end the upper bound of the range of model instances (not inclusive)
214            * @return the range of matching rows
215            */
216            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
217                    int end);
218    
219            /**
220            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
221            *
222            * <p>
223            * 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.ExpandoRowModelImpl}. 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.
224            * </p>
225            *
226            * @param dynamicQuery the dynamic query
227            * @param start the lower bound of the range of model instances
228            * @param end the upper bound of the range of model instances (not inclusive)
229            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
230            * @return the ordered range of matching rows
231            */
232            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
233                    int end, OrderByComparator<T> orderByComparator);
234    
235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
236            public List<ExpandoRow> getDefaultTableRows(long companyId,
237                    java.lang.String className, int start, int end);
238    
239            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240            public List<ExpandoRow> getDefaultTableRows(long companyId,
241                    long classNameId, int start, int end);
242    
243            /**
244            * Returns a range of all the expando rows.
245            *
246            * <p>
247            * 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.ExpandoRowModelImpl}. 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.
248            * </p>
249            *
250            * @param start the lower bound of the range of expando rows
251            * @param end the upper bound of the range of expando rows (not inclusive)
252            * @return the range of expando rows
253            */
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public List<ExpandoRow> getExpandoRows(int start, int end);
256    
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public List<ExpandoRow> getRows(long companyId, java.lang.String className,
259                    java.lang.String tableName, int start, int end);
260    
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public List<ExpandoRow> getRows(long companyId, long classNameId,
263                    java.lang.String tableName, int start, int end);
264    
265            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266            public List<ExpandoRow> getRows(long tableId, int start, int end);
267    
268            /**
269            * Returns the number of rows matching the dynamic query.
270            *
271            * @param dynamicQuery the dynamic query
272            * @return the number of rows matching the dynamic query
273            */
274            public long dynamicQueryCount(DynamicQuery dynamicQuery);
275    
276            /**
277            * Returns the number of rows matching the dynamic query.
278            *
279            * @param dynamicQuery the dynamic query
280            * @param projection the projection to apply to the query
281            * @return the number of rows matching the dynamic query
282            */
283            public long dynamicQueryCount(DynamicQuery dynamicQuery,
284                    Projection projection);
285    
286            public void deleteRow(ExpandoRow row);
287    
288            public void deleteRow(long companyId, java.lang.String className,
289                    java.lang.String tableName, long classPK) throws PortalException;
290    
291            public void deleteRow(long companyId, long classNameId,
292                    java.lang.String tableName, long classPK) throws PortalException;
293    
294            public void deleteRow(long rowId) throws PortalException;
295    
296            public void deleteRow(long tableId, long classPK) throws PortalException;
297    
298            public void deleteRows(long classPK);
299    }