From c489d0c073f2b60216ecfa37c8e4f12d8d8ac5d5 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 27 Sep 2017 10:23:43 +0800 Subject: [PATCH] - --- .../InsertableProvider/InsertableProvider.cs | 2 +- .../Oracle/Insertable/OracleInsertable.cs | 36 ++----------------- 2 files changed, 4 insertions(+), 34 deletions(-) diff --git a/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs index 7620caa8a..ffae7ba2c 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs @@ -187,7 +187,7 @@ namespace SqlSugar #endregion #region Protected Methods - protected void PreToSql() + protected virtual void PreToSql() { #region Identities if (!IsOffIdentity) diff --git a/Src/Asp.Net/SqlSugar/Realization/Oracle/Insertable/OracleInsertable.cs b/Src/Asp.Net/SqlSugar/Realization/Oracle/Insertable/OracleInsertable.cs index 946a0cd42..195e3eda3 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Oracle/Insertable/OracleInsertable.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Oracle/Insertable/OracleInsertable.cs @@ -7,42 +7,12 @@ namespace SqlSugar { public class OracleInsertable : InsertableProvider 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> ToSql() - { - InsertBuilder.IsReturnIdentity = true; - PreToSql(); - string sql = InsertBuilder.ToSqlString(); - RestoreMapping(); - return new KeyValuePair>(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 GetIdentityKeys() { return this.EntityInfo.Columns.Where(it => it.OracleSequenceName.IsValuable()).Select(it => it.DbColumnName).ToList(); } + protected override void PreToSql() { + + } } }