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.asset.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.asset.kernel.model.AssetTagStats; 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 AssetTagStats. 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 AssetTagStatsLocalServiceUtil 049 * @see com.liferay.portlet.asset.service.base.AssetTagStatsLocalServiceBaseImpl 050 * @see com.liferay.portlet.asset.service.impl.AssetTagStatsLocalServiceImpl 051 * @generated 052 */ 053 @ProviderType 054 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 055 PortalException.class, SystemException.class}) 056 public interface AssetTagStatsLocalService extends BaseLocalService, 057 PersistedModelLocalService { 058 /* 059 * NOTE FOR DEVELOPERS: 060 * 061 * Never modify or reference this interface directly. Always use {@link AssetTagStatsLocalServiceUtil} to access the asset tag stats local service. Add custom service methods to {@link com.liferay.portlet.asset.service.impl.AssetTagStatsLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 062 */ 063 064 /** 065 * Adds the asset tag stats to the database. Also notifies the appropriate model listeners. 066 * 067 * @param assetTagStats the asset tag stats 068 * @return the asset tag stats that was added 069 */ 070 @Indexable(type = IndexableType.REINDEX) 071 public AssetTagStats addAssetTagStats(AssetTagStats assetTagStats); 072 073 /** 074 * Adds an asset tag statistics instance. 075 * 076 * @param tagId the primary key of the tag 077 * @param classNameId the asset entry's class name ID 078 * @return the asset tag statistics instance 079 */ 080 public AssetTagStats addTagStats(long tagId, long classNameId); 081 082 /** 083 * Creates a new asset tag stats with the primary key. Does not add the asset tag stats to the database. 084 * 085 * @param tagStatsId the primary key for the new asset tag stats 086 * @return the new asset tag stats 087 */ 088 public AssetTagStats createAssetTagStats(long tagStatsId); 089 090 /** 091 * Deletes the asset tag stats from the database. Also notifies the appropriate model listeners. 092 * 093 * @param assetTagStats the asset tag stats 094 * @return the asset tag stats that was removed 095 */ 096 @Indexable(type = IndexableType.DELETE) 097 public AssetTagStats deleteAssetTagStats(AssetTagStats assetTagStats); 098 099 /** 100 * Deletes the asset tag stats with the primary key from the database. Also notifies the appropriate model listeners. 101 * 102 * @param tagStatsId the primary key of the asset tag stats 103 * @return the asset tag stats that was removed 104 * @throws PortalException if a asset tag stats with the primary key could not be found 105 */ 106 @Indexable(type = IndexableType.DELETE) 107 public AssetTagStats deleteAssetTagStats(long tagStatsId) 108 throws PortalException; 109 110 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 111 public AssetTagStats fetchAssetTagStats(long tagStatsId); 112 113 /** 114 * Returns the asset tag stats with the primary key. 115 * 116 * @param tagStatsId the primary key of the asset tag stats 117 * @return the asset tag stats 118 * @throws PortalException if a asset tag stats with the primary key could not be found 119 */ 120 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 121 public AssetTagStats getAssetTagStats(long tagStatsId) 122 throws PortalException; 123 124 /** 125 * Returns the asset tag statistics instance with the tag and asset entry 126 * matching the class name ID 127 * 128 * @param tagId the primary key of the tag 129 * @param classNameId the asset entry's class name ID 130 * @return Returns the asset tag statistics instance with the tag and asset 131 entry matching the class name ID 132 */ 133 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 134 public AssetTagStats getTagStats(long tagId, long classNameId); 135 136 /** 137 * Updates the asset tag stats in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 138 * 139 * @param assetTagStats the asset tag stats 140 * @return the asset tag stats that was updated 141 */ 142 @Indexable(type = IndexableType.REINDEX) 143 public AssetTagStats updateAssetTagStats(AssetTagStats assetTagStats); 144 145 /** 146 * Updates the asset tag statistics instance. 147 * 148 * @param tagId the primary key of the tag 149 * @param classNameId the asset entry's class name ID 150 * @return the updated asset tag statistics instance 151 */ 152 public AssetTagStats updateTagStats(long tagId, long classNameId) 153 throws PortalException; 154 155 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 156 public ActionableDynamicQuery getActionableDynamicQuery(); 157 158 public DynamicQuery dynamicQuery(); 159 160 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 161 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 162 163 /** 164 * @throws PortalException 165 */ 166 @Override 167 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 168 throws PortalException; 169 170 @Override 171 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 172 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 173 throws PortalException; 174 175 /** 176 * Returns the number of asset tag statses. 177 * 178 * @return the number of asset tag statses 179 */ 180 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 181 public int getAssetTagStatsesCount(); 182 183 /** 184 * Returns the OSGi service identifier. 185 * 186 * @return the OSGi service identifier 187 */ 188 public java.lang.String getOSGiServiceIdentifier(); 189 190 /** 191 * Performs a dynamic query on the database and returns the matching rows. 192 * 193 * @param dynamicQuery the dynamic query 194 * @return the matching rows 195 */ 196 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 197 198 /** 199 * Performs a dynamic query on the database and returns a range of the matching rows. 200 * 201 * <p> 202 * 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.asset.model.impl.AssetTagStatsModelImpl}. 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. 203 * </p> 204 * 205 * @param dynamicQuery the dynamic query 206 * @param start the lower bound of the range of model instances 207 * @param end the upper bound of the range of model instances (not inclusive) 208 * @return the range of matching rows 209 */ 210 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 211 int end); 212 213 /** 214 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 215 * 216 * <p> 217 * 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.asset.model.impl.AssetTagStatsModelImpl}. 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. 218 * </p> 219 * 220 * @param dynamicQuery the dynamic query 221 * @param start the lower bound of the range of model instances 222 * @param end the upper bound of the range of model instances (not inclusive) 223 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 224 * @return the ordered range of matching rows 225 */ 226 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 227 int end, OrderByComparator<T> orderByComparator); 228 229 /** 230 * Returns a range of all the asset tag statses. 231 * 232 * <p> 233 * 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.asset.model.impl.AssetTagStatsModelImpl}. 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. 234 * </p> 235 * 236 * @param start the lower bound of the range of asset tag statses 237 * @param end the upper bound of the range of asset tag statses (not inclusive) 238 * @return the range of asset tag statses 239 */ 240 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 241 public List<AssetTagStats> getAssetTagStatses(int start, int end); 242 243 /** 244 * Returns a range of all the asset tag statistics instances associated with 245 * the asset entry matching the class name ID. 246 * 247 * <p> 248 * Useful when paginating results. Returns a maximum of <code>end - 249 * start</code> instances. <code>start</code> and <code>end</code> are not 250 * primary keys, they are indexes in the result set. Thus, <code>0</code> 251 * refers to the first result in the set. Setting both <code>start</code> 252 * and <code>end</code> to {@link 253 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 254 * result set. 255 * </p> 256 * 257 * @param classNameId the asset entry's class name ID 258 * @param start the lower bound of the range of results 259 * @param end the upper bound of the range of results (not inclusive) 260 * @return the range of asset tag statistics associated with the asset entry 261 matching the class name ID 262 */ 263 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 264 public List<AssetTagStats> getTagStats(long classNameId, int start, int end); 265 266 /** 267 * Returns the number of rows matching the dynamic query. 268 * 269 * @param dynamicQuery the dynamic query 270 * @return the number of rows matching the dynamic query 271 */ 272 public long dynamicQueryCount(DynamicQuery dynamicQuery); 273 274 /** 275 * Returns the number of rows matching the dynamic query. 276 * 277 * @param dynamicQuery the dynamic query 278 * @param projection the projection to apply to the query 279 * @return the number of rows matching the dynamic query 280 */ 281 public long dynamicQueryCount(DynamicQuery dynamicQuery, 282 Projection projection); 283 284 /** 285 * Deletes the asset tag statistics instance. 286 * 287 * @param tagStats the asset tag statistics instance 288 */ 289 public void deleteTagStats(AssetTagStats tagStats); 290 291 /** 292 * Deletes the asset tag statistics instance matching the tag statistics ID. 293 * 294 * @param tagStatsId the primary key of the asset tag statistics instance 295 */ 296 public void deleteTagStats(long tagStatsId) throws PortalException; 297 298 /** 299 * Deletes all asset tag statistics instances associated with the asset 300 * entry matching the class name ID. 301 * 302 * @param classNameId the asset entry's class name ID 303 */ 304 public void deleteTagStatsByClassNameId(long classNameId); 305 306 /** 307 * Deletes all asset tag statistics instances associated with the tag. 308 * 309 * @param tagId the primary key of the tag 310 */ 311 public void deleteTagStatsByTagId(long tagId); 312 }