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.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for AnnouncementsFlag. This utility wraps 024 * {@link com.liferay.portlet.announcements.service.impl.AnnouncementsFlagLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see AnnouncementsFlagLocalService 032 * @see com.liferay.portlet.announcements.service.base.AnnouncementsFlagLocalServiceBaseImpl 033 * @see com.liferay.portlet.announcements.service.impl.AnnouncementsFlagLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class AnnouncementsFlagLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsFlagLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the announcements flag to the database. Also notifies the appropriate model listeners. 046 * 047 * @param announcementsFlag the announcements flag 048 * @return the announcements flag that was added 049 */ 050 public static com.liferay.announcements.kernel.model.AnnouncementsFlag addAnnouncementsFlag( 051 com.liferay.announcements.kernel.model.AnnouncementsFlag announcementsFlag) { 052 return getService().addAnnouncementsFlag(announcementsFlag); 053 } 054 055 public static com.liferay.announcements.kernel.model.AnnouncementsFlag addFlag( 056 long userId, long entryId, int value) { 057 return getService().addFlag(userId, entryId, value); 058 } 059 060 /** 061 * Creates a new announcements flag with the primary key. Does not add the announcements flag to the database. 062 * 063 * @param flagId the primary key for the new announcements flag 064 * @return the new announcements flag 065 */ 066 public static com.liferay.announcements.kernel.model.AnnouncementsFlag createAnnouncementsFlag( 067 long flagId) { 068 return getService().createAnnouncementsFlag(flagId); 069 } 070 071 /** 072 * Deletes the announcements flag from the database. Also notifies the appropriate model listeners. 073 * 074 * @param announcementsFlag the announcements flag 075 * @return the announcements flag that was removed 076 */ 077 public static com.liferay.announcements.kernel.model.AnnouncementsFlag deleteAnnouncementsFlag( 078 com.liferay.announcements.kernel.model.AnnouncementsFlag announcementsFlag) { 079 return getService().deleteAnnouncementsFlag(announcementsFlag); 080 } 081 082 /** 083 * Deletes the announcements flag with the primary key from the database. Also notifies the appropriate model listeners. 084 * 085 * @param flagId the primary key of the announcements flag 086 * @return the announcements flag that was removed 087 * @throws PortalException if a announcements flag with the primary key could not be found 088 */ 089 public static com.liferay.announcements.kernel.model.AnnouncementsFlag deleteAnnouncementsFlag( 090 long flagId) throws com.liferay.portal.kernel.exception.PortalException { 091 return getService().deleteAnnouncementsFlag(flagId); 092 } 093 094 public static com.liferay.announcements.kernel.model.AnnouncementsFlag fetchAnnouncementsFlag( 095 long flagId) { 096 return getService().fetchAnnouncementsFlag(flagId); 097 } 098 099 /** 100 * Returns the announcements flag with the primary key. 101 * 102 * @param flagId the primary key of the announcements flag 103 * @return the announcements flag 104 * @throws PortalException if a announcements flag with the primary key could not be found 105 */ 106 public static com.liferay.announcements.kernel.model.AnnouncementsFlag getAnnouncementsFlag( 107 long flagId) throws com.liferay.portal.kernel.exception.PortalException { 108 return getService().getAnnouncementsFlag(flagId); 109 } 110 111 public static com.liferay.announcements.kernel.model.AnnouncementsFlag getFlag( 112 long userId, long entryId, int value) 113 throws com.liferay.portal.kernel.exception.PortalException { 114 return getService().getFlag(userId, entryId, value); 115 } 116 117 /** 118 * Updates the announcements flag in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 119 * 120 * @param announcementsFlag the announcements flag 121 * @return the announcements flag that was updated 122 */ 123 public static com.liferay.announcements.kernel.model.AnnouncementsFlag updateAnnouncementsFlag( 124 com.liferay.announcements.kernel.model.AnnouncementsFlag announcementsFlag) { 125 return getService().updateAnnouncementsFlag(announcementsFlag); 126 } 127 128 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 129 return getService().getActionableDynamicQuery(); 130 } 131 132 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 133 return getService().dynamicQuery(); 134 } 135 136 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 137 return getService().getIndexableActionableDynamicQuery(); 138 } 139 140 /** 141 * @throws PortalException 142 */ 143 public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel( 144 com.liferay.portal.kernel.model.PersistedModel persistedModel) 145 throws com.liferay.portal.kernel.exception.PortalException { 146 return getService().deletePersistedModel(persistedModel); 147 } 148 149 public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel( 150 java.io.Serializable primaryKeyObj) 151 throws com.liferay.portal.kernel.exception.PortalException { 152 return getService().getPersistedModel(primaryKeyObj); 153 } 154 155 /** 156 * Returns the number of announcements flags. 157 * 158 * @return the number of announcements flags 159 */ 160 public static int getAnnouncementsFlagsCount() { 161 return getService().getAnnouncementsFlagsCount(); 162 } 163 164 /** 165 * Returns the OSGi service identifier. 166 * 167 * @return the OSGi service identifier 168 */ 169 public static java.lang.String getOSGiServiceIdentifier() { 170 return getService().getOSGiServiceIdentifier(); 171 } 172 173 /** 174 * Performs a dynamic query on the database and returns the matching rows. 175 * 176 * @param dynamicQuery the dynamic query 177 * @return the matching rows 178 */ 179 public static <T> java.util.List<T> dynamicQuery( 180 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 181 return getService().dynamicQuery(dynamicQuery); 182 } 183 184 /** 185 * Performs a dynamic query on the database and returns a range of the matching rows. 186 * 187 * <p> 188 * 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. 189 * </p> 190 * 191 * @param dynamicQuery the dynamic query 192 * @param start the lower bound of the range of model instances 193 * @param end the upper bound of the range of model instances (not inclusive) 194 * @return the range of matching rows 195 */ 196 public static <T> java.util.List<T> dynamicQuery( 197 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 198 int end) { 199 return getService().dynamicQuery(dynamicQuery, start, end); 200 } 201 202 /** 203 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 204 * 205 * <p> 206 * 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. 207 * </p> 208 * 209 * @param dynamicQuery the dynamic query 210 * @param start the lower bound of the range of model instances 211 * @param end the upper bound of the range of model instances (not inclusive) 212 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 213 * @return the ordered range of matching rows 214 */ 215 public static <T> java.util.List<T> dynamicQuery( 216 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 217 int end, 218 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 219 return getService() 220 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 221 } 222 223 /** 224 * Returns a range of all the announcements flags. 225 * 226 * <p> 227 * 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. 228 * </p> 229 * 230 * @param start the lower bound of the range of announcements flags 231 * @param end the upper bound of the range of announcements flags (not inclusive) 232 * @return the range of announcements flags 233 */ 234 public static java.util.List<com.liferay.announcements.kernel.model.AnnouncementsFlag> getAnnouncementsFlags( 235 int start, int end) { 236 return getService().getAnnouncementsFlags(start, end); 237 } 238 239 /** 240 * Returns the number of rows matching the dynamic query. 241 * 242 * @param dynamicQuery the dynamic query 243 * @return the number of rows matching the dynamic query 244 */ 245 public static long dynamicQueryCount( 246 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 247 return getService().dynamicQueryCount(dynamicQuery); 248 } 249 250 /** 251 * Returns the number of rows matching the dynamic query. 252 * 253 * @param dynamicQuery the dynamic query 254 * @param projection the projection to apply to the query 255 * @return the number of rows matching the dynamic query 256 */ 257 public static long dynamicQueryCount( 258 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 259 com.liferay.portal.kernel.dao.orm.Projection projection) { 260 return getService().dynamicQueryCount(dynamicQuery, projection); 261 } 262 263 public static void deleteFlag( 264 com.liferay.announcements.kernel.model.AnnouncementsFlag flag) { 265 getService().deleteFlag(flag); 266 } 267 268 public static void deleteFlag(long flagId) 269 throws com.liferay.portal.kernel.exception.PortalException { 270 getService().deleteFlag(flagId); 271 } 272 273 public static void deleteFlags(long entryId) { 274 getService().deleteFlags(entryId); 275 } 276 277 public static AnnouncementsFlagLocalService getService() { 278 if (_service == null) { 279 _service = (AnnouncementsFlagLocalService)PortalBeanLocatorUtil.locate(AnnouncementsFlagLocalService.class.getName()); 280 281 ReferenceRegistry.registerReference(AnnouncementsFlagLocalServiceUtil.class, 282 "_service"); 283 } 284 285 return _service; 286 } 287 288 private static AnnouncementsFlagLocalService _service; 289 }