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 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(AccountService accountService) {
086                    this.accountService = accountService;
087            }
088    
089            /**
090             * Returns the account persistence.
091             *
092             * @return the account persistence
093             */
094            public AccountPersistence getAccountPersistence() {
095                    return accountPersistence;
096            }
097    
098            /**
099             * Sets the account persistence.
100             *
101             * @param accountPersistence the account persistence
102             */
103            public void setAccountPersistence(AccountPersistence accountPersistence) {
104                    this.accountPersistence = accountPersistence;
105            }
106    
107            /**
108             * Returns the counter local service.
109             *
110             * @return the counter local service
111             */
112            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
113                    return counterLocalService;
114            }
115    
116            /**
117             * Sets the counter local service.
118             *
119             * @param counterLocalService the counter local service
120             */
121            public void setCounterLocalService(
122                    com.liferay.counter.service.CounterLocalService counterLocalService) {
123                    this.counterLocalService = counterLocalService;
124            }
125    
126            public void afterPropertiesSet() {
127            }
128    
129            public void destroy() {
130            }
131    
132            /**
133             * Returns the Spring bean ID for this bean.
134             *
135             * @return the Spring bean ID for this bean
136             */
137            @Override
138            public String getBeanIdentifier() {
139                    return _beanIdentifier;
140            }
141    
142            /**
143             * Sets the Spring bean ID for this bean.
144             *
145             * @param beanIdentifier the Spring bean ID for this bean
146             */
147            @Override
148            public void setBeanIdentifier(String beanIdentifier) {
149                    _beanIdentifier = beanIdentifier;
150            }
151    
152            protected Class<?> getModelClass() {
153                    return Account.class;
154            }
155    
156            protected String getModelClassName() {
157                    return Account.class.getName();
158            }
159    
160            /**
161             * Performs a SQL query.
162             *
163             * @param sql the sql query
164             */
165            protected void runSQL(String sql) {
166                    try {
167                            DataSource dataSource = accountPersistence.getDataSource();
168    
169                            DB db = DBFactoryUtil.getDB();
170    
171                            sql = db.buildSQL(sql);
172                            sql = PortalUtil.transformSQL(sql);
173    
174                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
175                                            sql, new int[0]);
176    
177                            sqlUpdate.update();
178                    }
179                    catch (Exception e) {
180                            throw new SystemException(e);
181                    }
182            }
183    
184            @BeanReference(type = com.liferay.portal.service.AccountLocalService.class)
185            protected com.liferay.portal.service.AccountLocalService accountLocalService;
186            @BeanReference(type = com.liferay.portal.service.AccountService.class)
187            protected AccountService accountService;
188            @BeanReference(type = AccountPersistence.class)
189            protected AccountPersistence accountPersistence;
190            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
191            protected com.liferay.counter.service.CounterLocalService counterLocalService;
192            private String _beanIdentifier;
193    }