using SqlSugar;
using System.Collections.Generic;
using System.Threading.Tasks;
using VolPro.Core.EFDbContext;
using VolPro.Core.Extensions.AutofacManager;
using VolPro.Core.UserManager;
using VolPro.Entity.DomainModels;
namespace VolPro.Core.Generic
{
///
/// Oracle 通用 CRUD 实现
///
public class GenericOracleProvider : GenericDbProviderBase
{
protected override string LeftQuote => "\"";
protected override string RightQuote => "\"";
public GenericOracleProvider() : base()
{
}
///
/// Oracle 12c+ 使用 RETURNING col INTO :outParam 获取自增/序列主键
/// 批量插入时 Oracle 需 BULK COLLECT,暂不支持返回多行 id,返回 null
///
protected override string BuildIdentitySql(TableColumnField keyColumn, bool batch = false)
{
if (batch)
{
return null;
}
return $"RETURNING {LeftQuote}{keyColumn.ColumnName}{RightQuote} INTO :newId";
}
///
/// Oracle 使用输出参数获取 RETURNING 值,需 Execute 后读取参数
///
protected override async Task