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.dao.db.DB;
019    import com.liferay.portal.kernel.dao.db.DBManagerUtil;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.exception.SystemException;
023    import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
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, IdentifiableOSGiService {
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 OSGi service identifier.
134             *
135             * @return the OSGi service identifier
136             */
137            @Override
138            public String getOSGiServiceIdentifier() {
139                    return AccountService.class.getName();
140            }
141    
142            protected Class<?> getModelClass() {
143                    return Account.class;
144            }
145    
146            protected String getModelClassName() {
147                    return Account.class.getName();
148            }
149    
150            /**
151             * Performs a SQL query.
152             *
153             * @param sql the sql query
154             */
155            protected void runSQL(String sql) {
156                    try {
157                            DataSource dataSource = accountPersistence.getDataSource();
158    
159                            DB db = DBManagerUtil.getDB();
160    
161                            sql = db.buildSQL(sql);
162                            sql = PortalUtil.transformSQL(sql);
163    
164                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
165                                            sql, new int[0]);
166    
167                            sqlUpdate.update();
168                    }
169                    catch (Exception e) {
170                            throw new SystemException(e);
171                    }
172            }
173    
174            @BeanReference(type = com.liferay.portal.service.AccountLocalService.class)
175            protected com.liferay.portal.service.AccountLocalService accountLocalService;
176            @BeanReference(type = com.liferay.portal.service.AccountService.class)
177            protected AccountService accountService;
178            @BeanReference(type = AccountPersistence.class)
179            protected AccountPersistence accountPersistence;
180            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
181            protected com.liferay.counter.service.CounterLocalService counterLocalService;
182    }