bug fixed for Sql().Find()
This commit is contained in:
parent
c70b4ad8d3
commit
82bdc0ec5a
|
@ -349,8 +349,9 @@ func (session *Session) scanMapIntoStruct(obj interface{}, objMap map[string][]b
|
|||
table := session.Engine.autoMapType(rType(obj))
|
||||
|
||||
for key, data := range objMap {
|
||||
key = strings.ToLower(key)
|
||||
if _, ok := table.Columns[key]; !ok {
|
||||
session.Engine.LogWarn("table %v's has not column %v.", table.Name, key)
|
||||
session.Engine.LogWarn(fmt.Sprintf("table %v's has not column %v. %v", table.Name, key, table.ColumnsSeq))
|
||||
continue
|
||||
}
|
||||
col := table.Columns[key]
|
||||
|
@ -2174,7 +2175,7 @@ func (session *Session) innerInsert(bean interface{}) (int64, error) {
|
|||
}
|
||||
}
|
||||
|
||||
if table.PrimaryKey == "" {
|
||||
if table.PrimaryKey == "" || table.PKColumn().SQLType.IsText() {
|
||||
return res.RowsAffected()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue