From 9cca0bc546a07b8e4afe748b2b4ddd04296e9810 Mon Sep 17 00:00:00 2001 From: "yn.wang" Date: Tue, 11 Oct 2016 10:30:05 +0800 Subject: [PATCH] Fixed BullInsert API for csharp issue. --- .../templates/csharp/dao/standard/IDAO.cs.tpl | 4 +- .../csharp/dao/standard/method.BulkInsert.tpl | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/IDAO.cs.tpl b/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/IDAO.cs.tpl index ee3615c71..ef50bbd19 100644 --- a/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/IDAO.cs.tpl +++ b/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/IDAO.cs.tpl @@ -101,14 +101,12 @@ namespace ${host.getNameSpace()}.Interface.IDao long Count(); #end #if($host.generateAPI(54)) -#if($host.isHasSptI() && $host.getDatabaseCategory().name()!="MySql" ) /// /// 批量插入${host.getClassName()} /// /// ${host.getClassName()}实体对象列表 /// 状态代码 - int BulkInsert${host.getClassName()}(IList<${host.getClassName()}> ${WordUtils.uncapitalize(${host.getClassName()})}List); -#end + bool BulkInsert${host.getClassName()}(IList<${host.getClassName()}> ${WordUtils.uncapitalize(${host.getClassName()})}List); #end #if($host.generateAPI(74)) #if($host.getDatabaseCategory().name() == "MySql") diff --git a/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/method.BulkInsert.tpl b/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/method.BulkInsert.tpl index e69de29bb..a1c5d3776 100644 --- a/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/method.BulkInsert.tpl +++ b/dal-dao-gen/src/main/resources/velocity/templates/csharp/dao/standard/method.BulkInsert.tpl @@ -0,0 +1,39 @@ +#if($host.generateAPI(54)) + /// + /// 批量插入${host.getClassName()} + /// + /// ${host.getClassName()}实体对象列表 + /// 状态代码 + public bool BulkInsert${host.getClassName()}(IList<${host.getClassName()}> ${WordUtils.uncapitalize(${host.getClassName()})}List) + { + try + { + return baseDao.BulkInsert<${host.getClassName()}>(${WordUtils.uncapitalize(${host.getClassName()})}List); + } + catch (Exception ex) + { + throw new DalException("调用${host.getClassName()}Dao时,访问BulkInsert时出错", ex); + } + } +#end +#if($host.generateAPI(74)) +#if($host.getDatabaseCategory().name() == "MySql" ) + /// + /// 批量插入${host.getClassName()} + /// + /// ${host.getClassName()}实体对象列表 + /// 状态代码 + public bool BulkInsert${host.getClassName()}(IList<${host.getClassName()}> ${WordUtils.uncapitalize(${host.getClassName()})}List) + { + try + { + return baseDao.BulkInsert<${host.getClassName()}>(${WordUtils.uncapitalize(${host.getClassName()})}List); + } + catch (Exception ex) + { + throw new DalException("调用${host.getClassName()}Dao时,访问BulkInsert时出错", ex); + } + } +#end +#end +