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