mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Update Core
This commit is contained in:
parent
1800053c30
commit
af7ec9c0e9
@ -222,32 +222,6 @@ namespace SqlSugar
|
||||
After(sql, result);
|
||||
return result;
|
||||
}
|
||||
public OracleBlukCopy UseOracle()
|
||||
|
||||
{
|
||||
|
||||
PreToSql();
|
||||
|
||||
var currentType = this.Context.CurrentConnectionConfig.DbType;
|
||||
|
||||
Check.Exception(currentType != DbType.Oracle, "UseSqlServer no support " + currentType);
|
||||
|
||||
OracleBlukCopy result = new OracleBlukCopy();
|
||||
|
||||
result.DbColumnInfoList = this.InsertBuilder.DbColumnInfoList.GroupBy(it => it.TableId).ToList();
|
||||
|
||||
result.InsertBuilder = this.InsertBuilder;
|
||||
|
||||
result.Builder = this.SqlBuilder;
|
||||
|
||||
result.Context = this.Context;
|
||||
|
||||
result.Inserts = this.InsertObjs;
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@ -353,6 +327,34 @@ namespace SqlSugar
|
||||
result.Inserts=this.InsertObjs;
|
||||
return result;
|
||||
}
|
||||
public OracleBlukCopy UseOracle()
|
||||
|
||||
{
|
||||
|
||||
PreToSql();
|
||||
|
||||
var currentType = this.Context.CurrentConnectionConfig.DbType;
|
||||
|
||||
Check.Exception(currentType != DbType.Oracle, "UseSqlServer no support " + currentType);
|
||||
|
||||
OracleBlukCopy result = new OracleBlukCopy();
|
||||
|
||||
result.DbColumnInfoList = this.InsertBuilder.DbColumnInfoList.GroupBy(it => it.TableId).ToList();
|
||||
|
||||
result.InsertBuilder = this.InsertBuilder;
|
||||
|
||||
result.Builder = this.SqlBuilder;
|
||||
|
||||
result.Context = this.Context;
|
||||
|
||||
result.Inserts = this.InsertObjs;
|
||||
InsertBuilder.IsBlukCopy = true;
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public IInsertable<T> EnableDiffLogEvent(object businessData = null)
|
||||
{
|
||||
|
@ -29,6 +29,7 @@ namespace SqlSugar
|
||||
public bool IsReturnIdentity { get; set; }
|
||||
public EntityInfo EntityInfo { get; set; }
|
||||
public Dictionary<string, int> OracleSeqInfoList { get; set; }
|
||||
public bool IsBlukCopy { get; set; }
|
||||
#endregion
|
||||
|
||||
#region SqlTemplate
|
||||
|
@ -122,7 +122,7 @@ namespace SqlSugar
|
||||
var identities = GetSeqNames();
|
||||
var insertCount = InsertObjs.Count();
|
||||
InsertBuilder.OracleSeqInfoList = new Dictionary<string, int>();
|
||||
if (identities.HasValue() && insertCount > 1)
|
||||
if ((identities.HasValue() && insertCount > 1)|| InsertBuilder.IsBlukCopy)
|
||||
{
|
||||
Check.Exception(identities.Count != identities.Distinct().Count(), "The field sequence needs to be unique");
|
||||
foreach (var seqName in identities)
|
||||
|
Loading…
Reference in New Issue
Block a user