|
|
@ -7,42 +7,12 @@ namespace SqlSugar |
|
|
|
{ |
|
|
|
public class OracleInsertable<T> : InsertableProvider<T> where T : class, new() |
|
|
|
{ |
|
|
|
public override int ExecuteCommand() |
|
|
|
{ |
|
|
|
InsertBuilder.IsReturnIdentity = false; |
|
|
|
PreToSql(); |
|
|
|
string sql = InsertBuilder.ToSqlString(); |
|
|
|
RestoreMapping(); |
|
|
|
return Ado.ExecuteCommand(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()); |
|
|
|
} |
|
|
|
|
|
|
|
public override KeyValuePair<string, List<SugarParameter>> ToSql() |
|
|
|
{ |
|
|
|
InsertBuilder.IsReturnIdentity = true; |
|
|
|
PreToSql(); |
|
|
|
string sql = InsertBuilder.ToSqlString(); |
|
|
|
RestoreMapping(); |
|
|
|
return new KeyValuePair<string, List<SugarParameter>>(sql, InsertBuilder.Parameters); |
|
|
|
} |
|
|
|
public override int ExecuteReturnIdentity() |
|
|
|
{ |
|
|
|
InsertBuilder.IsReturnIdentity = true; |
|
|
|
PreToSql(); |
|
|
|
string sql = InsertBuilder.ToSqlString(); |
|
|
|
RestoreMapping(); |
|
|
|
return Ado.GetInt(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray()); |
|
|
|
} |
|
|
|
public override long ExecuteReturnBigIdentity() |
|
|
|
{ |
|
|
|
InsertBuilder.IsReturnIdentity = true; |
|
|
|
PreToSql(); |
|
|
|
string sql = InsertBuilder.ToSqlString(); |
|
|
|
RestoreMapping(); |
|
|
|
return Convert.ToInt64(Ado.GetScalar(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray())); |
|
|
|
} |
|
|
|
protected override List<string> GetIdentityKeys() |
|
|
|
{ |
|
|
|
return this.EntityInfo.Columns.Where(it => it.OracleSequenceName.IsValuable()).Select(it => it.DbColumnName).ToList(); |
|
|
|
} |
|
|
|
protected override void PreToSql() { |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|