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.announcements.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.announcements.kernel.model.AnnouncementsFlag; 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 AnnouncementsFlag. 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 AnnouncementsFlagLocalServiceUtil 049 * @see com.liferay.portlet.announcements.service.base.AnnouncementsFlagLocalServiceBaseImpl 050 * @see com.liferay.portlet.announcements.service.impl.AnnouncementsFlagLocalServiceImpl 051 * @generated 052 */ 053 @ProviderType 054 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 055 PortalException.class, SystemException.class}) 056 public interface AnnouncementsFlagLocalService extends BaseLocalService, 057 PersistedModelLocalService { 058 /* 059 * NOTE FOR DEVELOPERS: 060 * 061 * Never modify or reference this interface directly. Always use {@link AnnouncementsFlagLocalServiceUtil} to access the announcements flag local service. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsFlagLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 062 */ 063 064 /** 065 * Adds the announcements flag to the database. Also notifies the appropriate model listeners. 066 * 067 * @param announcementsFlag the announcements flag 068 * @return the announcements flag that was added 069 */ 070 @Indexable(type = IndexableType.REINDEX) 071 public AnnouncementsFlag addAnnouncementsFlag( 072 AnnouncementsFlag announcementsFlag); 073 074 public AnnouncementsFlag addFlag(long userId, long entryId, int value); 075 076 /** 077 * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database. 078 * 079 * @param flagId the primary key for the new announcements flag 080 * @return the new announcements flag 081 */ 082 public AnnouncementsFlag createAnnouncementsFlag(long flagId); 083 084 /** 085 * Deletes the announcements flag from the database. Also notifies the appropriate model listeners. 086 * 087 * @param announcementsFlag the announcements flag 088 * @return the announcements flag that was removed 089 */ 090 @Indexable(type = IndexableType.DELETE) 091 public AnnouncementsFlag deleteAnnouncementsFlag( 092 AnnouncementsFlag announcementsFlag); 093 094 /** 095 * Deletes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners. 096 * 097 * @param flagId the primary key of the announcements flag 098 * @return the announcements flag that was removed 099 * @throws PortalException if a announcements flag with the primary key could not be found 100 */ 101 @Indexable(type = IndexableType.DELETE) 102 public AnnouncementsFlag deleteAnnouncementsFlag(long flagId) 103 throws PortalException; 104 105 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 106 public AnnouncementsFlag fetchAnnouncementsFlag(long flagId); 107 108 /** 109 * Returns the announcements flag with the primary key. 110 * 111 * @param flagId the primary key of the announcements flag 112 * @return the announcements flag 113 * @throws PortalException if a announcements flag with the primary key could not be found 114 */ 115 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 116 public AnnouncementsFlag getAnnouncementsFlag(long flagId) 117 throws PortalException; 118 119 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 120 public AnnouncementsFlag getFlag(long userId, long entryId, int value) 121 throws PortalException; 122 123 /** 124 * Updates the announcements flag in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 125 * 126 * @param announcementsFlag the announcements flag 127 * @return the announcements flag that was updated 128 */ 129 @Indexable(type = IndexableType.REINDEX) 130 public AnnouncementsFlag updateAnnouncementsFlag( 131 AnnouncementsFlag announcementsFlag); 132 133 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 134 public ActionableDynamicQuery getActionableDynamicQuery(); 135 136 public DynamicQuery dynamicQuery(); 137 138 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 139 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 140 141 /** 142 * @throws PortalException 143 */ 144 @Override 145 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 146 throws PortalException; 147 148 @Override 149 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 150 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 151 throws PortalException; 152 153 /** 154 * Returns the number of announcements flags. 155 * 156 * @return the number of announcements flags 157 */ 158 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 159 public int getAnnouncementsFlagsCount(); 160 161 /** 162 * Returns the OSGi service identifier. 163 * 164 * @return the OSGi service identifier 165 */ 166 public java.lang.String getOSGiServiceIdentifier(); 167 168 /** 169 * Performs a dynamic query on the database and returns the matching rows. 170 * 171 * @param dynamicQuery the dynamic query 172 * @return the matching rows 173 */ 174 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 175 176 /** 177 * Performs a dynamic query on the database and returns a range of the matching rows. 178 * 179 * <p> 180 * 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.announcements.model.impl.AnnouncementsFlagModelImpl}. 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. 181 * </p> 182 * 183 * @param dynamicQuery the dynamic query 184 * @param start the lower bound of the range of model instances 185 * @param end the upper bound of the range of model instances (not inclusive) 186 * @return the range of matching rows 187 */ 188 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 189 int end); 190 191 /** 192 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 193 * 194 * <p> 195 * 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.announcements.model.impl.AnnouncementsFlagModelImpl}. 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. 196 * </p> 197 * 198 * @param dynamicQuery the dynamic query 199 * @param start the lower bound of the range of model instances 200 * @param end the upper bound of the range of model instances (not inclusive) 201 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 202 * @return the ordered range of matching rows 203 */ 204 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 205 int end, OrderByComparator<T> orderByComparator); 206 207 /** 208 * Returns a range of all the announcements flags. 209 * 210 * <p> 211 * 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.announcements.model.impl.AnnouncementsFlagModelImpl}. 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. 212 * </p> 213 * 214 * @param start the lower bound of the range of announcements flags 215 * @param end the upper bound of the range of announcements flags (not inclusive) 216 * @return the range of announcements flags 217 */ 218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 219 public List<AnnouncementsFlag> getAnnouncementsFlags(int start, int end); 220 221 /** 222 * Returns the number of rows matching the dynamic query. 223 * 224 * @param dynamicQuery the dynamic query 225 * @return the number of rows matching the dynamic query 226 */ 227 public long dynamicQueryCount(DynamicQuery dynamicQuery); 228 229 /** 230 * Returns the number of rows matching the dynamic query. 231 * 232 * @param dynamicQuery the dynamic query 233 * @param projection the projection to apply to the query 234 * @return the number of rows matching the dynamic query 235 */ 236 public long dynamicQueryCount(DynamicQuery dynamicQuery, 237 Projection projection); 238 239 public void deleteFlag(AnnouncementsFlag flag); 240 241 public void deleteFlag(long flagId) throws PortalException; 242 243 public void deleteFlags(long entryId); 244 }