瀏覽代碼

添加数据库访问依赖

suxiaoyang 6 年之前
父節點
當前提交
f420a320b2
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      mysql-starter/src/main/java/com/yihu/mysql/query/BaseJpaService.java

+ 4 - 0
mysql-starter/src/main/java/com/yihu/mysql/query/BaseJpaService.java

@ -4,9 +4,11 @@ import com.yihu.utils.context.SpringContextUtils;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
@ -44,6 +46,8 @@ public abstract class BaseJpaService<T, R extends CrudRepository> {
    @PersistenceContext
    protected EntityManager entityManager;
    @Autowired
    protected JdbcTemplate jdbcTemplate;
    public BaseJpaService() {
        Type genType = getClass().getGenericSuperclass();