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 com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.exception.SystemException;
024    import com.liferay.portal.model.Country;
025    import com.liferay.portal.service.BaseServiceImpl;
026    import com.liferay.portal.service.CountryService;
027    import com.liferay.portal.service.persistence.CountryPersistence;
028    import com.liferay.portal.util.PortalUtil;
029    
030    import javax.sql.DataSource;
031    
032    /**
033     * Provides the base implementation for the country remote service.
034     *
035     * <p>
036     * 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.CountryServiceImpl}.
037     * </p>
038     *
039     * @author Brian Wing Shun Chan
040     * @see com.liferay.portal.service.impl.CountryServiceImpl
041     * @see com.liferay.portal.service.CountryServiceUtil
042     * @generated
043     */
044    public abstract class CountryServiceBaseImpl extends BaseServiceImpl
045            implements CountryService, IdentifiableBean {
046            /*
047             * NOTE FOR DEVELOPERS:
048             *
049             * Never modify or reference this class directly. Always use {@link com.liferay.portal.service.CountryServiceUtil} to access the country remote service.
050             */
051    
052            /**
053             * Returns the country remote service.
054             *
055             * @return the country remote service
056             */
057            public CountryService getCountryService() {
058                    return countryService;
059            }
060    
061            /**
062             * Sets the country remote service.
063             *
064             * @param countryService the country remote service
065             */
066            public void setCountryService(CountryService countryService) {
067                    this.countryService = countryService;
068            }
069    
070            /**
071             * Returns the country persistence.
072             *
073             * @return the country persistence
074             */
075            public CountryPersistence getCountryPersistence() {
076                    return countryPersistence;
077            }
078    
079            /**
080             * Sets the country persistence.
081             *
082             * @param countryPersistence the country persistence
083             */
084            public void setCountryPersistence(CountryPersistence countryPersistence) {
085                    this.countryPersistence = countryPersistence;
086            }
087    
088            /**
089             * Returns the counter local service.
090             *
091             * @return the counter local service
092             */
093            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
094                    return counterLocalService;
095            }
096    
097            /**
098             * Sets the counter local service.
099             *
100             * @param counterLocalService the counter local service
101             */
102            public void setCounterLocalService(
103                    com.liferay.counter.service.CounterLocalService counterLocalService) {
104                    this.counterLocalService = counterLocalService;
105            }
106    
107            public void afterPropertiesSet() {
108            }
109    
110            public void destroy() {
111            }
112    
113            /**
114             * Returns the Spring bean ID for this bean.
115             *
116             * @return the Spring bean ID for this bean
117             */
118            @Override
119            public String getBeanIdentifier() {
120                    return _beanIdentifier;
121            }
122    
123            /**
124             * Sets the Spring bean ID for this bean.
125             *
126             * @param beanIdentifier the Spring bean ID for this bean
127             */
128            @Override
129            public void setBeanIdentifier(String beanIdentifier) {
130                    _beanIdentifier = beanIdentifier;
131            }
132    
133            protected Class<?> getModelClass() {
134                    return Country.class;
135            }
136    
137            protected String getModelClassName() {
138                    return Country.class.getName();
139            }
140    
141            /**
142             * Performs a SQL query.
143             *
144             * @param sql the sql query
145             */
146            protected void runSQL(String sql) {
147                    try {
148                            DataSource dataSource = countryPersistence.getDataSource();
149    
150                            DB db = DBFactoryUtil.getDB();
151    
152                            sql = db.buildSQL(sql);
153                            sql = PortalUtil.transformSQL(sql);
154    
155                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
156                                            sql, new int[0]);
157    
158                            sqlUpdate.update();
159                    }
160                    catch (Exception e) {
161                            throw new SystemException(e);
162                    }
163            }
164    
165            @BeanReference(type = com.liferay.portal.service.CountryService.class)
166            protected CountryService countryService;
167            @BeanReference(type = CountryPersistence.class)
168            protected CountryPersistence countryPersistence;
169            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
170            protected com.liferay.counter.service.CounterLocalService counterLocalService;
171            private String _beanIdentifier;
172    }