diff options
Diffstat (limited to 'server-core/src/main/java/com/juick/service/BaseJdbcDao.java')
-rw-r--r-- | server-core/src/main/java/com/juick/service/BaseJdbcDao.java | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/server-core/src/main/java/com/juick/service/BaseJdbcDao.java b/server-core/src/main/java/com/juick/service/BaseJdbcDao.java deleted file mode 100644 index 948e6e6b..00000000 --- a/server-core/src/main/java/com/juick/service/BaseJdbcDao.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.juick.service; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import org.springframework.util.Assert; - -import javax.inject.Inject; - -/** - * Created by aalexeev on 11/13/16. - */ -public class BaseJdbcDao implements InitializingBean { - protected final Logger logger = LoggerFactory.getLogger(getClass()); - - private JdbcTemplate jdbcTemplate; - private NamedParameterJdbcTemplate namedParameterJdbcTemplate; - - protected JdbcTemplate getJdbcTemplate() { - return jdbcTemplate; - } - - protected NamedParameterJdbcTemplate getNamedParameterJdbcTemplate() { - return namedParameterJdbcTemplate; - } - - @Override - public void afterPropertiesSet() throws Exception { - logger.debug("Checking required beans"); - - Assert.notNull(jdbcTemplate); - Assert.notNull(namedParameterJdbcTemplate); - } - - @Inject - public void setJdbcTemplate(JdbcTemplate jdbcTemplate) { - this.jdbcTemplate = jdbcTemplate; - namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate); - } -} |