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 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 113 public ExpandoTable fetchDefaultTable(long companyId, 114 java.lang.String className); 115 116 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 117 public ExpandoTable fetchDefaultTable(long companyId, long classNameId); 118 119 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 120 public ExpandoTable fetchExpandoTable(long tableId); 121 122 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 123 public ExpandoTable fetchTable(long companyId, long classNameId, 124 java.lang.String name); 125 126 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 127 public ExpandoTable getDefaultTable(long companyId, 128 java.lang.String className) throws PortalException; 129 130 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 131 public ExpandoTable getDefaultTable(long companyId, long classNameId) 132 throws PortalException; 133 134 /** 135 * Returns the expando table with the primary key. 136 * 137 * @param tableId the primary key of the expando table 138 * @return the expando table 139 * @throws PortalException if a expando table with the primary key could not be found 140 */ 141 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 142 public ExpandoTable getExpandoTable(long tableId) throws PortalException; 143 144 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 145 public ExpandoTable getTable(long companyId, java.lang.String className, 146 java.lang.String name) throws PortalException; 147 148 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 149 public ExpandoTable getTable(long companyId, long classNameId, 150 java.lang.String name) throws PortalException; 151 152 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 153 public ExpandoTable getTable(long tableId) throws PortalException; 154 155 /** 156 * Updates the expando table in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 157 * 158 * @param expandoTable the expando table 159 * @return the expando table that was updated 160 */ 161 @Indexable(type = IndexableType.REINDEX) 162 public ExpandoTable updateExpandoTable(ExpandoTable expandoTable); 163 164 public ExpandoTable updateTable(long tableId, java.lang.String name) 165 throws PortalException; 166 167 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 168 public ActionableDynamicQuery getActionableDynamicQuery(); 169 170 public DynamicQuery dynamicQuery(); 171 172 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 173 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 174 175 /** 176 * @throws PortalException 177 */ 178 @Override 179 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 180 throws PortalException; 181 182 @Override 183 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 184 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 185 throws PortalException; 186 187 /** 188 * Returns the number of expando tables. 189 * 190 * @return the number of expando tables 191 */ 192 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 193 public int getExpandoTablesCount(); 194 195 /** 196 * Returns the OSGi service identifier. 197 * 198 * @return the OSGi service identifier 199 */ 200 public java.lang.String getOSGiServiceIdentifier(); 201 202 /** 203 * Performs a dynamic query on the database and returns the matching rows. 204 * 205 * @param dynamicQuery the dynamic query 206 * @return the matching rows 207 */ 208 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 209 210 /** 211 * Performs a dynamic query on the database and returns a range of the matching rows. 212 * 213 * <p> 214 * 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. 215 * </p> 216 * 217 * @param dynamicQuery the dynamic query 218 * @param start the lower bound of the range of model instances 219 * @param end the upper bound of the range of model instances (not inclusive) 220 * @return the range of matching rows 221 */ 222 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 223 int end); 224 225 /** 226 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 227 * 228 * <p> 229 * 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. 230 * </p> 231 * 232 * @param dynamicQuery the dynamic query 233 * @param start the lower bound of the range of model instances 234 * @param end the upper bound of the range of model instances (not inclusive) 235 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 236 * @return the ordered range of matching rows 237 */ 238 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 239 int end, OrderByComparator<T> orderByComparator); 240 241 /** 242 * Returns a range of all the expando tables. 243 * 244 * <p> 245 * 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. 246 * </p> 247 * 248 * @param start the lower bound of the range of expando tables 249 * @param end the upper bound of the range of expando tables (not inclusive) 250 * @return the range of expando tables 251 */ 252 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 253 public List<ExpandoTable> getExpandoTables(int start, int end); 254 255 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 256 public List<ExpandoTable> getTables(long companyId, 257 java.lang.String className); 258 259 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 260 public List<ExpandoTable> getTables(long companyId, long classNameId); 261 262 /** 263 * Returns the number of rows matching the dynamic query. 264 * 265 * @param dynamicQuery the dynamic query 266 * @return the number of rows matching the dynamic query 267 */ 268 public long dynamicQueryCount(DynamicQuery dynamicQuery); 269 270 /** 271 * Returns the number of rows matching the dynamic query. 272 * 273 * @param dynamicQuery the dynamic query 274 * @param projection the projection to apply to the query 275 * @return the number of rows matching the dynamic query 276 */ 277 public long dynamicQueryCount(DynamicQuery dynamicQuery, 278 Projection projection); 279 280 public void deleteTable(ExpandoTable table); 281 282 public void deleteTable(long companyId, java.lang.String className, 283 java.lang.String name) throws PortalException; 284 285 public void deleteTable(long companyId, long classNameId, 286 java.lang.String name) throws PortalException; 287 288 public void deleteTable(long tableId) throws PortalException; 289 290 public void deleteTables(long companyId, java.lang.String className); 291 292 public void deleteTables(long companyId, long classNameId); 293 }