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