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 com.liferay.portal.service.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(
067                    com.liferay.portal.service.CountryService countryService) {
068                    this.countryService = countryService;
069            }
070    
071            /**
072             * Returns the country persistence.
073             *
074             * @return the country persistence
075             */
076            public CountryPersistence getCountryPersistence() {
077                    return countryPersistence;
078            }
079    
080            /**
081             * Sets the country persistence.
082             *
083             * @param countryPersistence the country persistence
084             */
085            public void setCountryPersistence(CountryPersistence countryPersistence) {
086                    this.countryPersistence = countryPersistence;
087            }
088    
089            /**
090             * Returns the counter local service.
091             *
092             * @return the counter local service
093             */
094            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
095                    return counterLocalService;
096            }
097    
098            /**
099             * Sets the counter local service.
100             *
101             * @param counterLocalService the counter local service
102             */
103            public void setCounterLocalService(
104                    com.liferay.counter.service.CounterLocalService counterLocalService) {
105                    this.counterLocalService = counterLocalService;
106            }
107    
108            public void afterPropertiesSet() {
109            }
110    
111            public void destroy() {
112            }
113    
114            /**
115             * Returns the Spring bean ID for this bean.
116             *
117             * @return the Spring bean ID for this bean
118             */
119            @Override
120            public String getBeanIdentifier() {
121                    return _beanIdentifier;
122            }
123    
124            /**
125             * Sets the Spring bean ID for this bean.
126             *
127             * @param beanIdentifier the Spring bean ID for this bean
128             */
129            @Override
130            public void setBeanIdentifier(String beanIdentifier) {
131                    _beanIdentifier = beanIdentifier;
132            }
133    
134            protected Class<?> getModelClass() {
135                    return Country.class;
136            }
137    
138            protected String getModelClassName() {
139                    return Country.class.getName();
140            }
141    
142            /**
143             * Performs a SQL query.
144             *
145             * @param sql the sql query
146             */
147            protected void runSQL(String sql) {
148                    try {
149                            DataSource dataSource = countryPersistence.getDataSource();
150    
151                            DB db = DBFactoryUtil.getDB();
152    
153                            sql = db.buildSQL(sql);
154                            sql = PortalUtil.transformSQL(sql);
155    
156                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
157                                            sql, new int[0]);
158    
159                            sqlUpdate.update();
160                    }
161                    catch (Exception e) {
162                            throw new SystemException(e);
163                    }
164            }
165    
166            @BeanReference(type = com.liferay.portal.service.CountryService.class)
167            protected com.liferay.portal.service.CountryService countryService;
168            @BeanReference(type = CountryPersistence.class)
169            protected CountryPersistence countryPersistence;
170            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
171            protected com.liferay.counter.service.CounterLocalService counterLocalService;
172            private String _beanIdentifier;
173    }