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 com.liferay.portal.service.AccountService getAccountService() {
077 return accountService;
078 }
079
080
085 public void setAccountService(
086 com.liferay.portal.service.AccountService accountService) {
087 this.accountService = accountService;
088 }
089
090
095 public AccountPersistence getAccountPersistence() {
096 return accountPersistence;
097 }
098
099
104 public void setAccountPersistence(AccountPersistence accountPersistence) {
105 this.accountPersistence = accountPersistence;
106 }
107
108
113 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
114 return counterLocalService;
115 }
116
117
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
138 @Override
139 public String getBeanIdentifier() {
140 return _beanIdentifier;
141 }
142
143
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
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 }