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.portal.service.base;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029    import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery;
030    import com.liferay.portal.kernel.dao.orm.Projection;
031    import com.liferay.portal.kernel.dao.orm.Property;
032    import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
033    import com.liferay.portal.kernel.exception.PortalException;
034    import com.liferay.portal.kernel.exception.SystemException;
035    import com.liferay.portal.kernel.search.Indexable;
036    import com.liferay.portal.kernel.search.IndexableType;
037    import com.liferay.portal.kernel.util.OrderByComparator;
038    import com.liferay.portal.model.PersistedModel;
039    import com.liferay.portal.model.Website;
040    import com.liferay.portal.service.BaseLocalServiceImpl;
041    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
042    import com.liferay.portal.service.WebsiteLocalService;
043    import com.liferay.portal.service.persistence.ClassNamePersistence;
044    import com.liferay.portal.service.persistence.ListTypePersistence;
045    import com.liferay.portal.service.persistence.UserFinder;
046    import com.liferay.portal.service.persistence.UserPersistence;
047    import com.liferay.portal.service.persistence.WebsitePersistence;
048    import com.liferay.portal.util.PortalUtil;
049    
050    import com.liferay.portlet.exportimport.lar.ExportImportHelperUtil;
051    import com.liferay.portlet.exportimport.lar.ManifestSummary;
052    import com.liferay.portlet.exportimport.lar.PortletDataContext;
053    import com.liferay.portlet.exportimport.lar.StagedModelDataHandlerUtil;
054    import com.liferay.portlet.exportimport.lar.StagedModelType;
055    
056    import java.io.Serializable;
057    
058    import java.util.List;
059    
060    import javax.sql.DataSource;
061    
062    /**
063     * Provides the base implementation for the website local service.
064     *
065     * <p>
066     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portal.service.impl.WebsiteLocalServiceImpl}.
067     * </p>
068     *
069     * @author Brian Wing Shun Chan
070     * @see com.liferay.portal.service.impl.WebsiteLocalServiceImpl
071     * @see com.liferay.portal.service.WebsiteLocalServiceUtil
072     * @generated
073     */
074    @ProviderType
075    public abstract class WebsiteLocalServiceBaseImpl extends BaseLocalServiceImpl
076            implements WebsiteLocalService, IdentifiableBean {
077            /*
078             * NOTE FOR DEVELOPERS:
079             *
080             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.WebsiteLocalServiceUtil} to access the website local service.
081             */
082    
083            /**
084             * Adds the website to the database. Also notifies the appropriate model listeners.
085             *
086             * @param website the website
087             * @return the website that was added
088             */
089            @Indexable(type = IndexableType.REINDEX)
090            @Override
091            public Website addWebsite(Website website) {
092                    website.setNew(true);
093    
094                    return websitePersistence.update(website);
095            }
096    
097            /**
098             * Creates a new website with the primary key. Does not add the website to the database.
099             *
100             * @param websiteId the primary key for the new website
101             * @return the new website
102             */
103            @Override
104            public Website createWebsite(long websiteId) {
105                    return websitePersistence.create(websiteId);
106            }
107    
108            /**
109             * Deletes the website with the primary key from the database. Also notifies the appropriate model listeners.
110             *
111             * @param websiteId the primary key of the website
112             * @return the website that was removed
113             * @throws PortalException if a website with the primary key could not be found
114             */
115            @Indexable(type = IndexableType.DELETE)
116            @Override
117            public Website deleteWebsite(long websiteId) throws PortalException {
118                    return websitePersistence.remove(websiteId);
119            }
120    
121            /**
122             * Deletes the website from the database. Also notifies the appropriate model listeners.
123             *
124             * @param website the website
125             * @return the website that was removed
126             */
127            @Indexable(type = IndexableType.DELETE)
128            @Override
129            public Website deleteWebsite(Website website) {
130                    return websitePersistence.remove(website);
131            }
132    
133            @Override
134            public DynamicQuery dynamicQuery() {
135                    Class<?> clazz = getClass();
136    
137                    return DynamicQueryFactoryUtil.forClass(Website.class,
138                            clazz.getClassLoader());
139            }
140    
141            /**
142             * Performs a dynamic query on the database and returns the matching rows.
143             *
144             * @param dynamicQuery the dynamic query
145             * @return the matching rows
146             */
147            @Override
148            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
149                    return websitePersistence.findWithDynamicQuery(dynamicQuery);
150            }
151    
152            /**
153             * Performs a dynamic query on the database and returns a range of the matching rows.
154             *
155             * <p>
156             * 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.portal.model.impl.WebsiteModelImpl}. 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.
157             * </p>
158             *
159             * @param dynamicQuery the dynamic query
160             * @param start the lower bound of the range of model instances
161             * @param end the upper bound of the range of model instances (not inclusive)
162             * @return the range of matching rows
163             */
164            @Override
165            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
166                    int end) {
167                    return websitePersistence.findWithDynamicQuery(dynamicQuery, start, end);
168            }
169    
170            /**
171             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
172             *
173             * <p>
174             * 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.portal.model.impl.WebsiteModelImpl}. 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.
175             * </p>
176             *
177             * @param dynamicQuery the dynamic query
178             * @param start the lower bound of the range of model instances
179             * @param end the upper bound of the range of model instances (not inclusive)
180             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
181             * @return the ordered range of matching rows
182             */
183            @Override
184            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
185                    int end, OrderByComparator<T> orderByComparator) {
186                    return websitePersistence.findWithDynamicQuery(dynamicQuery, start,
187                            end, orderByComparator);
188            }
189    
190            /**
191             * Returns the number of rows matching the dynamic query.
192             *
193             * @param dynamicQuery the dynamic query
194             * @return the number of rows matching the dynamic query
195             */
196            @Override
197            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
198                    return websitePersistence.countWithDynamicQuery(dynamicQuery);
199            }
200    
201            /**
202             * Returns the number of rows matching the dynamic query.
203             *
204             * @param dynamicQuery the dynamic query
205             * @param projection the projection to apply to the query
206             * @return the number of rows matching the dynamic query
207             */
208            @Override
209            public long dynamicQueryCount(DynamicQuery dynamicQuery,
210                    Projection projection) {
211                    return websitePersistence.countWithDynamicQuery(dynamicQuery, projection);
212            }
213    
214            @Override
215            public Website fetchWebsite(long websiteId) {
216                    return websitePersistence.fetchByPrimaryKey(websiteId);
217            }
218    
219            /**
220             * Returns the website with the matching UUID and company.
221             *
222             * @param uuid the website's UUID
223             * @param companyId the primary key of the company
224             * @return the matching website, or <code>null</code> if a matching website could not be found
225             */
226            @Override
227            public Website fetchWebsiteByUuidAndCompanyId(String uuid, long companyId) {
228                    return websitePersistence.fetchByUuid_C_First(uuid, companyId, null);
229            }
230    
231            /**
232             * Returns the website with the primary key.
233             *
234             * @param websiteId the primary key of the website
235             * @return the website
236             * @throws PortalException if a website with the primary key could not be found
237             */
238            @Override
239            public Website getWebsite(long websiteId) throws PortalException {
240                    return websitePersistence.findByPrimaryKey(websiteId);
241            }
242    
243            @Override
244            public ActionableDynamicQuery getActionableDynamicQuery() {
245                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
246    
247                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.WebsiteLocalServiceUtil.getService());
248                    actionableDynamicQuery.setClass(Website.class);
249                    actionableDynamicQuery.setClassLoader(getClassLoader());
250    
251                    actionableDynamicQuery.setPrimaryKeyPropertyName("websiteId");
252    
253                    return actionableDynamicQuery;
254            }
255    
256            protected void initActionableDynamicQuery(
257                    ActionableDynamicQuery actionableDynamicQuery) {
258                    actionableDynamicQuery.setBaseLocalService(com.liferay.portal.service.WebsiteLocalServiceUtil.getService());
259                    actionableDynamicQuery.setClass(Website.class);
260                    actionableDynamicQuery.setClassLoader(getClassLoader());
261    
262                    actionableDynamicQuery.setPrimaryKeyPropertyName("websiteId");
263            }
264    
265            @Override
266            public ExportActionableDynamicQuery getExportActionableDynamicQuery(
267                    final PortletDataContext portletDataContext) {
268                    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {
269                                    @Override
270                                    public long performCount() throws PortalException {
271                                            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
272    
273                                            StagedModelType stagedModelType = getStagedModelType();
274    
275                                            long modelAdditionCount = super.performCount();
276    
277                                            manifestSummary.addModelAdditionCount(stagedModelType,
278                                                    modelAdditionCount);
279    
280                                            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext,
281                                                            stagedModelType);
282    
283                                            manifestSummary.addModelDeletionCount(stagedModelType,
284                                                    modelDeletionCount);
285    
286                                            return modelAdditionCount;
287                                    }
288                            };
289    
290                    initActionableDynamicQuery(exportActionableDynamicQuery);
291    
292                    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {
293                                    @Override
294                                    public void addCriteria(DynamicQuery dynamicQuery) {
295                                            portletDataContext.addDateRangeCriteria(dynamicQuery,
296                                                    "modifiedDate");
297    
298                                            StagedModelType stagedModelType = exportActionableDynamicQuery.getStagedModelType();
299    
300                                            long referrerClassNameId = stagedModelType.getReferrerClassNameId();
301    
302                                            Property classNameIdProperty = PropertyFactoryUtil.forName(
303                                                            "classNameId");
304    
305                                            if ((referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ALL) &&
306                                                            (referrerClassNameId != StagedModelType.REFERRER_CLASS_NAME_ID_ANY)) {
307                                                    dynamicQuery.add(classNameIdProperty.eq(
308                                                                    stagedModelType.getReferrerClassNameId()));
309                                            }
310                                            else if (referrerClassNameId == StagedModelType.REFERRER_CLASS_NAME_ID_ANY) {
311                                                    dynamicQuery.add(classNameIdProperty.isNotNull());
312                                            }
313                                    }
314                            });
315    
316                    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
317    
318                    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Website>() {
319                                    @Override
320                                    public void performAction(Website website)
321                                            throws PortalException {
322                                            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext,
323                                                    website);
324                                    }
325                            });
326                    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(
327                                    PortalUtil.getClassNameId(Website.class.getName()),
328                                    StagedModelType.REFERRER_CLASS_NAME_ID_ALL));
329    
330                    return exportActionableDynamicQuery;
331            }
332    
333            /**
334             * @throws PortalException
335             */
336            @Override
337            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
338                    throws PortalException {
339                    return websiteLocalService.deleteWebsite((Website)persistedModel);
340            }
341    
342            @Override
343            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
344                    throws PortalException {
345                    return websitePersistence.findByPrimaryKey(primaryKeyObj);
346            }
347    
348            /**
349             * Returns the website with the matching UUID and company.
350             *
351             * @param uuid the website's UUID
352             * @param companyId the primary key of the company
353             * @return the matching website
354             * @throws PortalException if a matching website could not be found
355             */
356            @Override
357            public Website getWebsiteByUuidAndCompanyId(String uuid, long companyId)
358                    throws PortalException {
359                    return websitePersistence.findByUuid_C_First(uuid, companyId, null);
360            }
361    
362            /**
363             * Returns a range of all the websites.
364             *
365             * <p>
366             * 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.portal.model.impl.WebsiteModelImpl}. 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.
367             * </p>
368             *
369             * @param start the lower bound of the range of websites
370             * @param end the upper bound of the range of websites (not inclusive)
371             * @return the range of websites
372             */
373            @Override
374            public List<Website> getWebsites(int start, int end) {
375                    return websitePersistence.findAll(start, end);
376            }
377    
378            /**
379             * Returns the number of websites.
380             *
381             * @return the number of websites
382             */
383            @Override
384            public int getWebsitesCount() {
385                    return websitePersistence.countAll();
386            }
387    
388            /**
389             * Updates the website in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
390             *
391             * @param website the website
392             * @return the website that was updated
393             */
394            @Indexable(type = IndexableType.REINDEX)
395            @Override
396            public Website updateWebsite(Website website) {
397                    return websitePersistence.update(website);
398            }
399    
400            /**
401             * Returns the website local service.
402             *
403             * @return the website local service
404             */
405            public WebsiteLocalService getWebsiteLocalService() {
406                    return websiteLocalService;
407            }
408    
409            /**
410             * Sets the website local service.
411             *
412             * @param websiteLocalService the website local service
413             */
414            public void setWebsiteLocalService(WebsiteLocalService websiteLocalService) {
415                    this.websiteLocalService = websiteLocalService;
416            }
417    
418            /**
419             * Returns the website remote service.
420             *
421             * @return the website remote service
422             */
423            public com.liferay.portal.service.WebsiteService getWebsiteService() {
424                    return websiteService;
425            }
426    
427            /**
428             * Sets the website remote service.
429             *
430             * @param websiteService the website remote service
431             */
432            public void setWebsiteService(
433                    com.liferay.portal.service.WebsiteService websiteService) {
434                    this.websiteService = websiteService;
435            }
436    
437            /**
438             * Returns the website persistence.
439             *
440             * @return the website persistence
441             */
442            public WebsitePersistence getWebsitePersistence() {
443                    return websitePersistence;
444            }
445    
446            /**
447             * Sets the website persistence.
448             *
449             * @param websitePersistence the website persistence
450             */
451            public void setWebsitePersistence(WebsitePersistence websitePersistence) {
452                    this.websitePersistence = websitePersistence;
453            }
454    
455            /**
456             * Returns the counter local service.
457             *
458             * @return the counter local service
459             */
460            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
461                    return counterLocalService;
462            }
463    
464            /**
465             * Sets the counter local service.
466             *
467             * @param counterLocalService the counter local service
468             */
469            public void setCounterLocalService(
470                    com.liferay.counter.service.CounterLocalService counterLocalService) {
471                    this.counterLocalService = counterLocalService;
472            }
473    
474            /**
475             * Returns the class name local service.
476             *
477             * @return the class name local service
478             */
479            public com.liferay.portal.service.ClassNameLocalService getClassNameLocalService() {
480                    return classNameLocalService;
481            }
482    
483            /**
484             * Sets the class name local service.
485             *
486             * @param classNameLocalService the class name local service
487             */
488            public void setClassNameLocalService(
489                    com.liferay.portal.service.ClassNameLocalService classNameLocalService) {
490                    this.classNameLocalService = classNameLocalService;
491            }
492    
493            /**
494             * Returns the class name remote service.
495             *
496             * @return the class name remote service
497             */
498            public com.liferay.portal.service.ClassNameService getClassNameService() {
499                    return classNameService;
500            }
501    
502            /**
503             * Sets the class name remote service.
504             *
505             * @param classNameService the class name remote service
506             */
507            public void setClassNameService(
508                    com.liferay.portal.service.ClassNameService classNameService) {
509                    this.classNameService = classNameService;
510            }
511    
512            /**
513             * Returns the class name persistence.
514             *
515             * @return the class name persistence
516             */
517            public ClassNamePersistence getClassNamePersistence() {
518                    return classNamePersistence;
519            }
520    
521            /**
522             * Sets the class name persistence.
523             *
524             * @param classNamePersistence the class name persistence
525             */
526            public void setClassNamePersistence(
527                    ClassNamePersistence classNamePersistence) {
528                    this.classNamePersistence = classNamePersistence;
529            }
530    
531            /**
532             * Returns the list type local service.
533             *
534             * @return the list type local service
535             */
536            public com.liferay.portal.service.ListTypeLocalService getListTypeLocalService() {
537                    return listTypeLocalService;
538            }
539    
540            /**
541             * Sets the list type local service.
542             *
543             * @param listTypeLocalService the list type local service
544             */
545            public void setListTypeLocalService(
546                    com.liferay.portal.service.ListTypeLocalService listTypeLocalService) {
547                    this.listTypeLocalService = listTypeLocalService;
548            }
549    
550            /**
551             * Returns the list type remote service.
552             *
553             * @return the list type remote service
554             */
555            public com.liferay.portal.service.ListTypeService getListTypeService() {
556                    return listTypeService;
557            }
558    
559            /**
560             * Sets the list type remote service.
561             *
562             * @param listTypeService the list type remote service
563             */
564            public void setListTypeService(
565                    com.liferay.portal.service.ListTypeService listTypeService) {
566                    this.listTypeService = listTypeService;
567            }
568    
569            /**
570             * Returns the list type persistence.
571             *
572             * @return the list type persistence
573             */
574            public ListTypePersistence getListTypePersistence() {
575                    return listTypePersistence;
576            }
577    
578            /**
579             * Sets the list type persistence.
580             *
581             * @param listTypePersistence the list type persistence
582             */
583            public void setListTypePersistence(ListTypePersistence listTypePersistence) {
584                    this.listTypePersistence = listTypePersistence;
585            }
586    
587            /**
588             * Returns the user local service.
589             *
590             * @return the user local service
591             */
592            public com.liferay.portal.service.UserLocalService getUserLocalService() {
593                    return userLocalService;
594            }
595    
596            /**
597             * Sets the user local service.
598             *
599             * @param userLocalService the user local service
600             */
601            public void setUserLocalService(
602                    com.liferay.portal.service.UserLocalService userLocalService) {
603                    this.userLocalService = userLocalService;
604            }
605    
606            /**
607             * Returns the user remote service.
608             *
609             * @return the user remote service
610             */
611            public com.liferay.portal.service.UserService getUserService() {
612                    return userService;
613            }
614    
615            /**
616             * Sets the user remote service.
617             *
618             * @param userService the user remote service
619             */
620            public void setUserService(
621                    com.liferay.portal.service.UserService userService) {
622                    this.userService = userService;
623            }
624    
625            /**
626             * Returns the user persistence.
627             *
628             * @return the user persistence
629             */
630            public UserPersistence getUserPersistence() {
631                    return userPersistence;
632            }
633    
634            /**
635             * Sets the user persistence.
636             *
637             * @param userPersistence the user persistence
638             */
639            public void setUserPersistence(UserPersistence userPersistence) {
640                    this.userPersistence = userPersistence;
641            }
642    
643            /**
644             * Returns the user finder.
645             *
646             * @return the user finder
647             */
648            public UserFinder getUserFinder() {
649                    return userFinder;
650            }
651    
652            /**
653             * Sets the user finder.
654             *
655             * @param userFinder the user finder
656             */
657            public void setUserFinder(UserFinder userFinder) {
658                    this.userFinder = userFinder;
659            }
660    
661            public void afterPropertiesSet() {
662                    persistedModelLocalServiceRegistry.register("com.liferay.portal.model.Website",
663                            websiteLocalService);
664            }
665    
666            public void destroy() {
667                    persistedModelLocalServiceRegistry.unregister(
668                            "com.liferay.portal.model.Website");
669            }
670    
671            /**
672             * Returns the Spring bean ID for this bean.
673             *
674             * @return the Spring bean ID for this bean
675             */
676            @Override
677            public String getBeanIdentifier() {
678                    return _beanIdentifier;
679            }
680    
681            /**
682             * Sets the Spring bean ID for this bean.
683             *
684             * @param beanIdentifier the Spring bean ID for this bean
685             */
686            @Override
687            public void setBeanIdentifier(String beanIdentifier) {
688                    _beanIdentifier = beanIdentifier;
689            }
690    
691            protected Class<?> getModelClass() {
692                    return Website.class;
693            }
694    
695            protected String getModelClassName() {
696                    return Website.class.getName();
697            }
698    
699            /**
700             * Performs a SQL query.
701             *
702             * @param sql the sql query
703             */
704            protected void runSQL(String sql) {
705                    try {
706                            DataSource dataSource = websitePersistence.getDataSource();
707    
708                            DB db = DBFactoryUtil.getDB();
709    
710                            sql = db.buildSQL(sql);
711                            sql = PortalUtil.transformSQL(sql);
712    
713                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
714                                            sql, new int[0]);
715    
716                            sqlUpdate.update();
717                    }
718                    catch (Exception e) {
719                            throw new SystemException(e);
720                    }
721            }
722    
723            @BeanReference(type = com.liferay.portal.service.WebsiteLocalService.class)
724            protected WebsiteLocalService websiteLocalService;
725            @BeanReference(type = com.liferay.portal.service.WebsiteService.class)
726            protected com.liferay.portal.service.WebsiteService websiteService;
727            @BeanReference(type = WebsitePersistence.class)
728            protected WebsitePersistence websitePersistence;
729            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
730            protected com.liferay.counter.service.CounterLocalService counterLocalService;
731            @BeanReference(type = com.liferay.portal.service.ClassNameLocalService.class)
732            protected com.liferay.portal.service.ClassNameLocalService classNameLocalService;
733            @BeanReference(type = com.liferay.portal.service.ClassNameService.class)
734            protected com.liferay.portal.service.ClassNameService classNameService;
735            @BeanReference(type = ClassNamePersistence.class)
736            protected ClassNamePersistence classNamePersistence;
737            @BeanReference(type = com.liferay.portal.service.ListTypeLocalService.class)
738            protected com.liferay.portal.service.ListTypeLocalService listTypeLocalService;
739            @BeanReference(type = com.liferay.portal.service.ListTypeService.class)
740            protected com.liferay.portal.service.ListTypeService listTypeService;
741            @BeanReference(type = ListTypePersistence.class)
742            protected ListTypePersistence listTypePersistence;
743            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
744            protected com.liferay.portal.service.UserLocalService userLocalService;
745            @BeanReference(type = com.liferay.portal.service.UserService.class)
746            protected com.liferay.portal.service.UserService userService;
747            @BeanReference(type = UserPersistence.class)
748            protected UserPersistence userPersistence;
749            @BeanReference(type = UserFinder.class)
750            protected UserFinder userFinder;
751            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
752            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
753            private String _beanIdentifier;
754    }