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.portlet.expando.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.Projection;
023    import com.liferay.portal.kernel.exception.PortalException;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.search.Indexable;
026    import com.liferay.portal.kernel.search.IndexableType;
027    import com.liferay.portal.kernel.transaction.Isolation;
028    import com.liferay.portal.kernel.transaction.Propagation;
029    import com.liferay.portal.kernel.transaction.Transactional;
030    import com.liferay.portal.kernel.util.OrderByComparator;
031    import com.liferay.portal.model.PersistedModel;
032    import com.liferay.portal.service.BaseLocalService;
033    import com.liferay.portal.service.PersistedModelLocalService;
034    
035    import com.liferay.portlet.expando.model.ExpandoRow;
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            /**
104            * @throws PortalException
105            */
106            @Override
107            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
108                    throws PortalException;
109    
110            public void deleteRow(long companyId, java.lang.String className,
111                    java.lang.String tableName, long classPK) throws PortalException;
112    
113            public void deleteRow(long companyId, long classNameId,
114                    java.lang.String tableName, long classPK) throws PortalException;
115    
116            public void deleteRow(ExpandoRow row);
117    
118            public void deleteRow(long rowId) throws PortalException;
119    
120            public void deleteRow(long tableId, long classPK) throws PortalException;
121    
122            public void deleteRows(long classPK);
123    
124            public DynamicQuery dynamicQuery();
125    
126            /**
127            * Performs a dynamic query on the database and returns the matching rows.
128            *
129            * @param dynamicQuery the dynamic query
130            * @return the matching rows
131            */
132            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
133    
134            /**
135            * Performs a dynamic query on the database and returns a range of the matching rows.
136            *
137            * <p>
138            * 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @return the range of matching rows
145            */
146            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
147                    int end);
148    
149            /**
150            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
151            *
152            * <p>
153            * 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.
154            * </p>
155            *
156            * @param dynamicQuery the dynamic query
157            * @param start the lower bound of the range of model instances
158            * @param end the upper bound of the range of model instances (not inclusive)
159            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
160            * @return the ordered range of matching rows
161            */
162            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
163                    int end, OrderByComparator<T> orderByComparator);
164    
165            /**
166            * Returns the number of rows matching the dynamic query.
167            *
168            * @param dynamicQuery the dynamic query
169            * @return the number of rows matching the dynamic query
170            */
171            public long dynamicQueryCount(DynamicQuery dynamicQuery);
172    
173            /**
174            * Returns the number of rows matching the dynamic query.
175            *
176            * @param dynamicQuery the dynamic query
177            * @param projection the projection to apply to the query
178            * @return the number of rows matching the dynamic query
179            */
180            public long dynamicQueryCount(DynamicQuery dynamicQuery,
181                    Projection projection);
182    
183            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184            public ExpandoRow fetchExpandoRow(long rowId);
185    
186            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
187            public ExpandoRow fetchRow(long tableId, long classPK);
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public ActionableDynamicQuery getActionableDynamicQuery();
191    
192            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193            public List<ExpandoRow> getDefaultTableRows(long companyId,
194                    java.lang.String className, int start, int end);
195    
196            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
197            public List<ExpandoRow> getDefaultTableRows(long companyId,
198                    long classNameId, int start, int end);
199    
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public int getDefaultTableRowsCount(long companyId,
202                    java.lang.String className);
203    
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public int getDefaultTableRowsCount(long companyId, long classNameId);
206    
207            /**
208            * Returns the expando row with the primary key.
209            *
210            * @param rowId the primary key of the expando row
211            * @return the expando row
212            * @throws PortalException if a expando row with the primary key could not be found
213            */
214            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
215            public ExpandoRow getExpandoRow(long rowId) throws PortalException;
216    
217            /**
218            * Returns a range of all the expando rows.
219            *
220            * <p>
221            * 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.
222            * </p>
223            *
224            * @param start the lower bound of the range of expando rows
225            * @param end the upper bound of the range of expando rows (not inclusive)
226            * @return the range of expando rows
227            */
228            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
229            public List<ExpandoRow> getExpandoRows(int start, int end);
230    
231            /**
232            * Returns the number of expando rows.
233            *
234            * @return the number of expando rows
235            */
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public int getExpandoRowsCount();
238    
239            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
240            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
241    
242            /**
243            * Returns the OSGi service identifier.
244            *
245            * @return the OSGi service identifier
246            */
247            public java.lang.String getOSGiServiceIdentifier();
248    
249            @Override
250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
251            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
252                    throws PortalException;
253    
254            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
255            public ExpandoRow getRow(long companyId, java.lang.String className,
256                    java.lang.String tableName, long classPK);
257    
258            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
259            public ExpandoRow getRow(long companyId, long classNameId,
260                    java.lang.String tableName, long classPK);
261    
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public ExpandoRow getRow(long rowId) throws PortalException;
264    
265            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
266            public ExpandoRow getRow(long tableId, long classPK)
267                    throws PortalException;
268    
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public List<ExpandoRow> getRows(long companyId, java.lang.String className,
271                    java.lang.String tableName, int start, int end);
272    
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public List<ExpandoRow> getRows(long companyId, long classNameId,
275                    java.lang.String tableName, int start, int end);
276    
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public List<ExpandoRow> getRows(long tableId, int start, int end);
279    
280            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281            public int getRowsCount(long companyId, java.lang.String className,
282                    java.lang.String tableName);
283    
284            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
285            public int getRowsCount(long companyId, long classNameId,
286                    java.lang.String tableName);
287    
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public int getRowsCount(long tableId);
290    
291            /**
292            * Updates the expando row in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
293            *
294            * @param expandoRow the expando row
295            * @return the expando row that was updated
296            */
297            @Indexable(type = IndexableType.REINDEX)
298            public ExpandoRow updateExpandoRow(ExpandoRow expandoRow);
299    }