001
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
044 public abstract class AccountServiceBaseImpl extends BaseServiceImpl
045 implements AccountService, IdentifiableBean {
046
051
052
057 public com.liferay.portal.service.AccountLocalService getAccountLocalService() {
058 return accountLocalService;
059 }
060
061
066 public void setAccountLocalService(
067 com.liferay.portal.service.AccountLocalService accountLocalService) {
068 this.accountLocalService = accountLocalService;
069 }
070
071
076 public AccountService getAccountService() {
077 return accountService;
078 }
079
080
085 public void setAccountService(AccountService accountService) {
086 this.accountService = accountService;
087 }
088
089
094 public AccountPersistence getAccountPersistence() {
095 return accountPersistence;
096 }
097
098
103 public void setAccountPersistence(AccountPersistence accountPersistence) {
104 this.accountPersistence = accountPersistence;
105 }
106
107
112 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
113 return counterLocalService;
114 }
115
116
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
137 @Override
138 public String getBeanIdentifier() {
139 return _beanIdentifier;
140 }
141
142
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
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 = 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 }