aa
This commit is contained in:
@@ -207,6 +207,16 @@ func CreateEntity(db *DaoDB, item interface{}) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
func CreateEntityTx(txDB orm.TxOrmer, item interface{}) (err error) {
|
||||
if txDB == nil {
|
||||
return
|
||||
}
|
||||
if _, err = txDB.Insert(item); err != nil && !IsDuplicateError(err) {
|
||||
globals.SugarLogger.Errorf("CreateEntity %s failed with error:%v", reflect.TypeOf(item).Name(), err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// InsertMulti执行成功后ID不会改写成正确的(象Insert一样)
|
||||
func CreateMultiEntities(db *DaoDB, item interface{}) (err error) {
|
||||
if db == nil {
|
||||
|
||||
Reference in New Issue
Block a user