Commit 1cb5b280 authored by yanzg's avatar yanzg

修改实体位置

parent d4e8ae9f
......@@ -24,9 +24,14 @@ import java.util.*;
*/
public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
@Override
protected void initExecute(DbExecute db) {
/**
* 构造函数
*/
public BaseDaoImpl() {
}
public BaseDaoImpl(DbExecute db, TableSqlCache table) {
super(db, table);
}
/**
......
......@@ -37,12 +37,8 @@ public abstract class BaseDaoSql {
/**
* 数据库执行类
*/
@Resource
private DbExecute db;
private boolean initSql = false;
/**
* 当前Dao的表结构SQL语句信息
*/
......@@ -53,26 +49,42 @@ public abstract class BaseDaoSql {
*/
protected final static MemoryCache<TableSqlCache> cache = new MemoryCache<>();
/**
* 构造函数
*/
public BaseDaoSql() {
this.initTable();
this.init();
}
/**
* 自己构造
*
* @param db
* @param table
*/
public BaseDaoSql(DbExecute db, TableSqlCache table) {
this.db = db;
this.table = table;
this.init();
}
@Resource
public void setDb(DbExecute db) {
this.db = db;
}
/**
* 获取数据库执行类
*
* @return
*/
protected DbExecute getDb() {
synchronized (this.db) {
if (this.db != null && !this.initSql) {
this.initExecute(this.db);
this.initSql = true;
}
return db;
}
}
/**
* 构造函数
*/
public BaseDaoSql() {
this.initTable();
public void setTable(TableSqlCache table) {
this.table = table;
}
/**
......@@ -86,15 +98,9 @@ public abstract class BaseDaoSql {
if (this.table == null) {
this.table = new TableSqlCache();
cache.put(cls, this.table);
this.init();
}
}
/**
* 初始化执行
*/
protected abstract void initExecute(DbExecute db);
/**
* 注册SQL语句
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment