aa
This commit is contained in:
@@ -197,6 +197,17 @@ func UpdateEntity(db *DaoDB, item interface{}, cols ...string) (num int64, err e
|
||||
return num, err
|
||||
}
|
||||
|
||||
func UpdateEntityTx(txDB orm.TxOrmer, item interface{}, cols ...string) (num int64, err error) {
|
||||
if txDB == nil {
|
||||
return
|
||||
}
|
||||
num, err = txDB.Update(item, cols...)
|
||||
if err != nil && !IsDuplicateError(err) {
|
||||
globals.SugarLogger.Errorf("UpdateEntity %s failed with error:%v", reflect.TypeOf(item).Name(), err)
|
||||
}
|
||||
return num, err
|
||||
}
|
||||
|
||||
func CreateEntity(db *DaoDB, item interface{}) (err error) {
|
||||
if db == nil {
|
||||
db = GetDB()
|
||||
|
||||
Reference in New Issue
Block a user