|
@@ -12,6 +12,7 @@ import cc.smtweb.framework.core.db.vo.ModelField; |
|
|
import cc.smtweb.framework.core.db.vo.ModelTable; |
|
|
import cc.smtweb.framework.core.db.vo.ModelTable; |
|
|
import cc.smtweb.framework.core.exception.DbException; |
|
|
import cc.smtweb.framework.core.exception.DbException; |
|
|
import cc.smtweb.framework.core.util.DateUtil; |
|
|
import cc.smtweb.framework.core.util.DateUtil; |
|
|
|
|
|
import cc.smtweb.framework.core.util.NumberUtil; |
|
|
import cc.smtweb.framework.core.util.SpringUtil; |
|
|
import cc.smtweb.framework.core.util.SpringUtil; |
|
|
import cc.smtweb.framework.core.util.VariableUtil; |
|
|
import cc.smtweb.framework.core.util.VariableUtil; |
|
|
import com.esotericsoftware.minlog.Log; |
|
|
import com.esotericsoftware.minlog.Log; |
|
@@ -388,7 +389,10 @@ public abstract class AbstractEntityDao<T> { |
|
|
public Long readId(T entity) { |
|
|
public Long readId(T entity) { |
|
|
EntityColumn idColumn = findIdColumn(); |
|
|
EntityColumn idColumn = findIdColumn(); |
|
|
|
|
|
|
|
|
return (Long) idColumn.readValue(entity); |
|
|
|
|
|
|
|
|
Object o = idColumn.readValue(entity); |
|
|
|
|
|
if (o == null) return 0L; |
|
|
|
|
|
if (o instanceof Number) return ((Number) o).longValue(); |
|
|
|
|
|
return NumberUtil.getLongIgnoreErr(o.toString()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public T createBean() { |
|
|
public T createBean() { |
|
|