From 024533a558e4827564041bdf5040e51370eece80 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 28 Mar 2018 23:33:44 +0300 Subject: server: refactor event listeners --- .../main/java/com/juick/service/BaseJdbcService.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'juick-server-jdbc') diff --git a/juick-server-jdbc/src/main/java/com/juick/service/BaseJdbcService.java b/juick-server-jdbc/src/main/java/com/juick/service/BaseJdbcService.java index d0bf0195..496a04ba 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/BaseJdbcService.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/BaseJdbcService.java @@ -18,20 +18,24 @@ package com.juick.service; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport; +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; -import javax.annotation.PostConstruct; import javax.inject.Inject; -import javax.sql.DataSource; /** * Created by aalexeev on 11/13/16. */ -public class BaseJdbcService extends NamedParameterJdbcDaoSupport { +public class BaseJdbcService { @Inject JdbcTemplate jdbcTemplate; - @PostConstruct - public void init() { - setJdbcTemplate(jdbcTemplate); + @Inject + NamedParameterJdbcTemplate namedParameterJdbcTemplate; + + public NamedParameterJdbcTemplate getNamedParameterJdbcTemplate() { + return namedParameterJdbcTemplate; + } + + public JdbcTemplate getJdbcTemplate() { + return jdbcTemplate; } } -- cgit v1.2.3