001    /**
002     * Copyright (c) 2000-2010 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.asset.service.base;
016    
017    import com.liferay.counter.service.CounterLocalService;
018    
019    import com.liferay.portal.kernel.annotation.BeanReference;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023    import com.liferay.portal.kernel.exception.PortalException;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.util.OrderByComparator;
026    import com.liferay.portal.service.ResourceLocalService;
027    import com.liferay.portal.service.ResourceService;
028    import com.liferay.portal.service.UserLocalService;
029    import com.liferay.portal.service.UserService;
030    import com.liferay.portal.service.persistence.ResourceFinder;
031    import com.liferay.portal.service.persistence.ResourcePersistence;
032    import com.liferay.portal.service.persistence.UserFinder;
033    import com.liferay.portal.service.persistence.UserPersistence;
034    
035    import com.liferay.portlet.asset.model.AssetTagStats;
036    import com.liferay.portlet.asset.service.AssetCategoryLocalService;
037    import com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService;
038    import com.liferay.portlet.asset.service.AssetCategoryPropertyService;
039    import com.liferay.portlet.asset.service.AssetCategoryService;
040    import com.liferay.portlet.asset.service.AssetEntryLocalService;
041    import com.liferay.portlet.asset.service.AssetEntryService;
042    import com.liferay.portlet.asset.service.AssetLinkLocalService;
043    import com.liferay.portlet.asset.service.AssetTagLocalService;
044    import com.liferay.portlet.asset.service.AssetTagPropertyLocalService;
045    import com.liferay.portlet.asset.service.AssetTagPropertyService;
046    import com.liferay.portlet.asset.service.AssetTagService;
047    import com.liferay.portlet.asset.service.AssetTagStatsLocalService;
048    import com.liferay.portlet.asset.service.AssetVocabularyLocalService;
049    import com.liferay.portlet.asset.service.AssetVocabularyService;
050    import com.liferay.portlet.asset.service.persistence.AssetCategoryFinder;
051    import com.liferay.portlet.asset.service.persistence.AssetCategoryPersistence;
052    import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyFinder;
053    import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyPersistence;
054    import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
055    import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
056    import com.liferay.portlet.asset.service.persistence.AssetLinkPersistence;
057    import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
058    import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
059    import com.liferay.portlet.asset.service.persistence.AssetTagPropertyFinder;
060    import com.liferay.portlet.asset.service.persistence.AssetTagPropertyKeyFinder;
061    import com.liferay.portlet.asset.service.persistence.AssetTagPropertyPersistence;
062    import com.liferay.portlet.asset.service.persistence.AssetTagStatsPersistence;
063    import com.liferay.portlet.asset.service.persistence.AssetVocabularyPersistence;
064    
065    import java.util.List;
066    
067    import javax.sql.DataSource;
068    
069    /**
070     * @author Brian Wing Shun Chan
071     */
072    public abstract class AssetTagStatsLocalServiceBaseImpl
073            implements AssetTagStatsLocalService {
074            public AssetTagStats addAssetTagStats(AssetTagStats assetTagStats)
075                    throws SystemException {
076                    assetTagStats.setNew(true);
077    
078                    return assetTagStatsPersistence.update(assetTagStats, false);
079            }
080    
081            public AssetTagStats createAssetTagStats(long tagStatsId) {
082                    return assetTagStatsPersistence.create(tagStatsId);
083            }
084    
085            public void deleteAssetTagStats(long tagStatsId)
086                    throws PortalException, SystemException {
087                    assetTagStatsPersistence.remove(tagStatsId);
088            }
089    
090            public void deleteAssetTagStats(AssetTagStats assetTagStats)
091                    throws SystemException {
092                    assetTagStatsPersistence.remove(assetTagStats);
093            }
094    
095            @SuppressWarnings("unchecked")
096            public List dynamicQuery(DynamicQuery dynamicQuery)
097                    throws SystemException {
098                    return assetTagStatsPersistence.findWithDynamicQuery(dynamicQuery);
099            }
100    
101            @SuppressWarnings("unchecked")
102            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
103                    throws SystemException {
104                    return assetTagStatsPersistence.findWithDynamicQuery(dynamicQuery,
105                            start, end);
106            }
107    
108            @SuppressWarnings("unchecked")
109            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
110                    OrderByComparator orderByComparator) throws SystemException {
111                    return assetTagStatsPersistence.findWithDynamicQuery(dynamicQuery,
112                            start, end, orderByComparator);
113            }
114    
115            public long dynamicQueryCount(DynamicQuery dynamicQuery)
116                    throws SystemException {
117                    return assetTagStatsPersistence.countWithDynamicQuery(dynamicQuery);
118            }
119    
120            public AssetTagStats getAssetTagStats(long tagStatsId)
121                    throws PortalException, SystemException {
122                    return assetTagStatsPersistence.findByPrimaryKey(tagStatsId);
123            }
124    
125            public List<AssetTagStats> getAssetTagStatses(int start, int end)
126                    throws SystemException {
127                    return assetTagStatsPersistence.findAll(start, end);
128            }
129    
130            public int getAssetTagStatsesCount() throws SystemException {
131                    return assetTagStatsPersistence.countAll();
132            }
133    
134            public AssetTagStats updateAssetTagStats(AssetTagStats assetTagStats)
135                    throws SystemException {
136                    assetTagStats.setNew(false);
137    
138                    return assetTagStatsPersistence.update(assetTagStats, true);
139            }
140    
141            public AssetTagStats updateAssetTagStats(AssetTagStats assetTagStats,
142                    boolean merge) throws SystemException {
143                    assetTagStats.setNew(false);
144    
145                    return assetTagStatsPersistence.update(assetTagStats, merge);
146            }
147    
148            public AssetCategoryLocalService getAssetCategoryLocalService() {
149                    return assetCategoryLocalService;
150            }
151    
152            public void setAssetCategoryLocalService(
153                    AssetCategoryLocalService assetCategoryLocalService) {
154                    this.assetCategoryLocalService = assetCategoryLocalService;
155            }
156    
157            public AssetCategoryService getAssetCategoryService() {
158                    return assetCategoryService;
159            }
160    
161            public void setAssetCategoryService(
162                    AssetCategoryService assetCategoryService) {
163                    this.assetCategoryService = assetCategoryService;
164            }
165    
166            public AssetCategoryPersistence getAssetCategoryPersistence() {
167                    return assetCategoryPersistence;
168            }
169    
170            public void setAssetCategoryPersistence(
171                    AssetCategoryPersistence assetCategoryPersistence) {
172                    this.assetCategoryPersistence = assetCategoryPersistence;
173            }
174    
175            public AssetCategoryFinder getAssetCategoryFinder() {
176                    return assetCategoryFinder;
177            }
178    
179            public void setAssetCategoryFinder(AssetCategoryFinder assetCategoryFinder) {
180                    this.assetCategoryFinder = assetCategoryFinder;
181            }
182    
183            public AssetCategoryPropertyLocalService getAssetCategoryPropertyLocalService() {
184                    return assetCategoryPropertyLocalService;
185            }
186    
187            public void setAssetCategoryPropertyLocalService(
188                    AssetCategoryPropertyLocalService assetCategoryPropertyLocalService) {
189                    this.assetCategoryPropertyLocalService = assetCategoryPropertyLocalService;
190            }
191    
192            public AssetCategoryPropertyService getAssetCategoryPropertyService() {
193                    return assetCategoryPropertyService;
194            }
195    
196            public void setAssetCategoryPropertyService(
197                    AssetCategoryPropertyService assetCategoryPropertyService) {
198                    this.assetCategoryPropertyService = assetCategoryPropertyService;
199            }
200    
201            public AssetCategoryPropertyPersistence getAssetCategoryPropertyPersistence() {
202                    return assetCategoryPropertyPersistence;
203            }
204    
205            public void setAssetCategoryPropertyPersistence(
206                    AssetCategoryPropertyPersistence assetCategoryPropertyPersistence) {
207                    this.assetCategoryPropertyPersistence = assetCategoryPropertyPersistence;
208            }
209    
210            public AssetCategoryPropertyFinder getAssetCategoryPropertyFinder() {
211                    return assetCategoryPropertyFinder;
212            }
213    
214            public void setAssetCategoryPropertyFinder(
215                    AssetCategoryPropertyFinder assetCategoryPropertyFinder) {
216                    this.assetCategoryPropertyFinder = assetCategoryPropertyFinder;
217            }
218    
219            public AssetEntryLocalService getAssetEntryLocalService() {
220                    return assetEntryLocalService;
221            }
222    
223            public void setAssetEntryLocalService(
224                    AssetEntryLocalService assetEntryLocalService) {
225                    this.assetEntryLocalService = assetEntryLocalService;
226            }
227    
228            public AssetEntryService getAssetEntryService() {
229                    return assetEntryService;
230            }
231    
232            public void setAssetEntryService(AssetEntryService assetEntryService) {
233                    this.assetEntryService = assetEntryService;
234            }
235    
236            public AssetEntryPersistence getAssetEntryPersistence() {
237                    return assetEntryPersistence;
238            }
239    
240            public void setAssetEntryPersistence(
241                    AssetEntryPersistence assetEntryPersistence) {
242                    this.assetEntryPersistence = assetEntryPersistence;
243            }
244    
245            public AssetEntryFinder getAssetEntryFinder() {
246                    return assetEntryFinder;
247            }
248    
249            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
250                    this.assetEntryFinder = assetEntryFinder;
251            }
252    
253            public AssetLinkLocalService getAssetLinkLocalService() {
254                    return assetLinkLocalService;
255            }
256    
257            public void setAssetLinkLocalService(
258                    AssetLinkLocalService assetLinkLocalService) {
259                    this.assetLinkLocalService = assetLinkLocalService;
260            }
261    
262            public AssetLinkPersistence getAssetLinkPersistence() {
263                    return assetLinkPersistence;
264            }
265    
266            public void setAssetLinkPersistence(
267                    AssetLinkPersistence assetLinkPersistence) {
268                    this.assetLinkPersistence = assetLinkPersistence;
269            }
270    
271            public AssetTagLocalService getAssetTagLocalService() {
272                    return assetTagLocalService;
273            }
274    
275            public void setAssetTagLocalService(
276                    AssetTagLocalService assetTagLocalService) {
277                    this.assetTagLocalService = assetTagLocalService;
278            }
279    
280            public AssetTagService getAssetTagService() {
281                    return assetTagService;
282            }
283    
284            public void setAssetTagService(AssetTagService assetTagService) {
285                    this.assetTagService = assetTagService;
286            }
287    
288            public AssetTagPersistence getAssetTagPersistence() {
289                    return assetTagPersistence;
290            }
291    
292            public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
293                    this.assetTagPersistence = assetTagPersistence;
294            }
295    
296            public AssetTagFinder getAssetTagFinder() {
297                    return assetTagFinder;
298            }
299    
300            public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
301                    this.assetTagFinder = assetTagFinder;
302            }
303    
304            public AssetTagPropertyLocalService getAssetTagPropertyLocalService() {
305                    return assetTagPropertyLocalService;
306            }
307    
308            public void setAssetTagPropertyLocalService(
309                    AssetTagPropertyLocalService assetTagPropertyLocalService) {
310                    this.assetTagPropertyLocalService = assetTagPropertyLocalService;
311            }
312    
313            public AssetTagPropertyService getAssetTagPropertyService() {
314                    return assetTagPropertyService;
315            }
316    
317            public void setAssetTagPropertyService(
318                    AssetTagPropertyService assetTagPropertyService) {
319                    this.assetTagPropertyService = assetTagPropertyService;
320            }
321    
322            public AssetTagPropertyPersistence getAssetTagPropertyPersistence() {
323                    return assetTagPropertyPersistence;
324            }
325    
326            public void setAssetTagPropertyPersistence(
327                    AssetTagPropertyPersistence assetTagPropertyPersistence) {
328                    this.assetTagPropertyPersistence = assetTagPropertyPersistence;
329            }
330    
331            public AssetTagPropertyFinder getAssetTagPropertyFinder() {
332                    return assetTagPropertyFinder;
333            }
334    
335            public void setAssetTagPropertyFinder(
336                    AssetTagPropertyFinder assetTagPropertyFinder) {
337                    this.assetTagPropertyFinder = assetTagPropertyFinder;
338            }
339    
340            public AssetTagPropertyKeyFinder getAssetTagPropertyKeyFinder() {
341                    return assetTagPropertyKeyFinder;
342            }
343    
344            public void setAssetTagPropertyKeyFinder(
345                    AssetTagPropertyKeyFinder assetTagPropertyKeyFinder) {
346                    this.assetTagPropertyKeyFinder = assetTagPropertyKeyFinder;
347            }
348    
349            public AssetTagStatsLocalService getAssetTagStatsLocalService() {
350                    return assetTagStatsLocalService;
351            }
352    
353            public void setAssetTagStatsLocalService(
354                    AssetTagStatsLocalService assetTagStatsLocalService) {
355                    this.assetTagStatsLocalService = assetTagStatsLocalService;
356            }
357    
358            public AssetTagStatsPersistence getAssetTagStatsPersistence() {
359                    return assetTagStatsPersistence;
360            }
361    
362            public void setAssetTagStatsPersistence(
363                    AssetTagStatsPersistence assetTagStatsPersistence) {
364                    this.assetTagStatsPersistence = assetTagStatsPersistence;
365            }
366    
367            public AssetVocabularyLocalService getAssetVocabularyLocalService() {
368                    return assetVocabularyLocalService;
369            }
370    
371            public void setAssetVocabularyLocalService(
372                    AssetVocabularyLocalService assetVocabularyLocalService) {
373                    this.assetVocabularyLocalService = assetVocabularyLocalService;
374            }
375    
376            public AssetVocabularyService getAssetVocabularyService() {
377                    return assetVocabularyService;
378            }
379    
380            public void setAssetVocabularyService(
381                    AssetVocabularyService assetVocabularyService) {
382                    this.assetVocabularyService = assetVocabularyService;
383            }
384    
385            public AssetVocabularyPersistence getAssetVocabularyPersistence() {
386                    return assetVocabularyPersistence;
387            }
388    
389            public void setAssetVocabularyPersistence(
390                    AssetVocabularyPersistence assetVocabularyPersistence) {
391                    this.assetVocabularyPersistence = assetVocabularyPersistence;
392            }
393    
394            public CounterLocalService getCounterLocalService() {
395                    return counterLocalService;
396            }
397    
398            public void setCounterLocalService(CounterLocalService counterLocalService) {
399                    this.counterLocalService = counterLocalService;
400            }
401    
402            public ResourceLocalService getResourceLocalService() {
403                    return resourceLocalService;
404            }
405    
406            public void setResourceLocalService(
407                    ResourceLocalService resourceLocalService) {
408                    this.resourceLocalService = resourceLocalService;
409            }
410    
411            public ResourceService getResourceService() {
412                    return resourceService;
413            }
414    
415            public void setResourceService(ResourceService resourceService) {
416                    this.resourceService = resourceService;
417            }
418    
419            public ResourcePersistence getResourcePersistence() {
420                    return resourcePersistence;
421            }
422    
423            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
424                    this.resourcePersistence = resourcePersistence;
425            }
426    
427            public ResourceFinder getResourceFinder() {
428                    return resourceFinder;
429            }
430    
431            public void setResourceFinder(ResourceFinder resourceFinder) {
432                    this.resourceFinder = resourceFinder;
433            }
434    
435            public UserLocalService getUserLocalService() {
436                    return userLocalService;
437            }
438    
439            public void setUserLocalService(UserLocalService userLocalService) {
440                    this.userLocalService = userLocalService;
441            }
442    
443            public UserService getUserService() {
444                    return userService;
445            }
446    
447            public void setUserService(UserService userService) {
448                    this.userService = userService;
449            }
450    
451            public UserPersistence getUserPersistence() {
452                    return userPersistence;
453            }
454    
455            public void setUserPersistence(UserPersistence userPersistence) {
456                    this.userPersistence = userPersistence;
457            }
458    
459            public UserFinder getUserFinder() {
460                    return userFinder;
461            }
462    
463            public void setUserFinder(UserFinder userFinder) {
464                    this.userFinder = userFinder;
465            }
466    
467            protected void runSQL(String sql) throws SystemException {
468                    try {
469                            DataSource dataSource = assetTagStatsPersistence.getDataSource();
470    
471                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
472                                            sql, new int[0]);
473    
474                            sqlUpdate.update();
475                    }
476                    catch (Exception e) {
477                            throw new SystemException(e);
478                    }
479            }
480    
481            @BeanReference(type = AssetCategoryLocalService.class)
482            protected AssetCategoryLocalService assetCategoryLocalService;
483            @BeanReference(type = AssetCategoryService.class)
484            protected AssetCategoryService assetCategoryService;
485            @BeanReference(type = AssetCategoryPersistence.class)
486            protected AssetCategoryPersistence assetCategoryPersistence;
487            @BeanReference(type = AssetCategoryFinder.class)
488            protected AssetCategoryFinder assetCategoryFinder;
489            @BeanReference(type = AssetCategoryPropertyLocalService.class)
490            protected AssetCategoryPropertyLocalService assetCategoryPropertyLocalService;
491            @BeanReference(type = AssetCategoryPropertyService.class)
492            protected AssetCategoryPropertyService assetCategoryPropertyService;
493            @BeanReference(type = AssetCategoryPropertyPersistence.class)
494            protected AssetCategoryPropertyPersistence assetCategoryPropertyPersistence;
495            @BeanReference(type = AssetCategoryPropertyFinder.class)
496            protected AssetCategoryPropertyFinder assetCategoryPropertyFinder;
497            @BeanReference(type = AssetEntryLocalService.class)
498            protected AssetEntryLocalService assetEntryLocalService;
499            @BeanReference(type = AssetEntryService.class)
500            protected AssetEntryService assetEntryService;
501            @BeanReference(type = AssetEntryPersistence.class)
502            protected AssetEntryPersistence assetEntryPersistence;
503            @BeanReference(type = AssetEntryFinder.class)
504            protected AssetEntryFinder assetEntryFinder;
505            @BeanReference(type = AssetLinkLocalService.class)
506            protected AssetLinkLocalService assetLinkLocalService;
507            @BeanReference(type = AssetLinkPersistence.class)
508            protected AssetLinkPersistence assetLinkPersistence;
509            @BeanReference(type = AssetTagLocalService.class)
510            protected AssetTagLocalService assetTagLocalService;
511            @BeanReference(type = AssetTagService.class)
512            protected AssetTagService assetTagService;
513            @BeanReference(type = AssetTagPersistence.class)
514            protected AssetTagPersistence assetTagPersistence;
515            @BeanReference(type = AssetTagFinder.class)
516            protected AssetTagFinder assetTagFinder;
517            @BeanReference(type = AssetTagPropertyLocalService.class)
518            protected AssetTagPropertyLocalService assetTagPropertyLocalService;
519            @BeanReference(type = AssetTagPropertyService.class)
520            protected AssetTagPropertyService assetTagPropertyService;
521            @BeanReference(type = AssetTagPropertyPersistence.class)
522            protected AssetTagPropertyPersistence assetTagPropertyPersistence;
523            @BeanReference(type = AssetTagPropertyFinder.class)
524            protected AssetTagPropertyFinder assetTagPropertyFinder;
525            @BeanReference(type = AssetTagPropertyKeyFinder.class)
526            protected AssetTagPropertyKeyFinder assetTagPropertyKeyFinder;
527            @BeanReference(type = AssetTagStatsLocalService.class)
528            protected AssetTagStatsLocalService assetTagStatsLocalService;
529            @BeanReference(type = AssetTagStatsPersistence.class)
530            protected AssetTagStatsPersistence assetTagStatsPersistence;
531            @BeanReference(type = AssetVocabularyLocalService.class)
532            protected AssetVocabularyLocalService assetVocabularyLocalService;
533            @BeanReference(type = AssetVocabularyService.class)
534            protected AssetVocabularyService assetVocabularyService;
535            @BeanReference(type = AssetVocabularyPersistence.class)
536            protected AssetVocabularyPersistence assetVocabularyPersistence;
537            @BeanReference(type = CounterLocalService.class)
538            protected CounterLocalService counterLocalService;
539            @BeanReference(type = ResourceLocalService.class)
540            protected ResourceLocalService resourceLocalService;
541            @BeanReference(type = ResourceService.class)
542            protected ResourceService resourceService;
543            @BeanReference(type = ResourcePersistence.class)
544            protected ResourcePersistence resourcePersistence;
545            @BeanReference(type = ResourceFinder.class)
546            protected ResourceFinder resourceFinder;
547            @BeanReference(type = UserLocalService.class)
548            protected UserLocalService userLocalService;
549            @BeanReference(type = UserService.class)
550            protected UserService userService;
551            @BeanReference(type = UserPersistence.class)
552            protected UserPersistence userPersistence;
553            @BeanReference(type = UserFinder.class)
554            protected UserFinder userFinder;
555    }