Clover.NET coverage report - Coverage for s2container.net

Coverage timestamp: 2006年5月30日 11:21:29

File Stats: LOC: 88   Methods: 6
NCLOC: 62 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Extension.ADO\Impl\BasicUpdateHandler.cs 50.0% 100.0% 66.7% 86.4%
coverage coverage
1   #region Copyright
2   /*
3   * Copyright 2005 the Seasar Foundation and the Others.
4   *
5   * Licensed under the Apache License, Version 2.0 (the "License");
6   * you may not use this file except in compliance with the License.
7   * You may obtain a copy of the License at
8   *
9   * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14   * either express or implied. See the License for the specific language
15   * governing permissions and limitations under the License.
16   */
17   #endregion
18  
19   using System;
20   using System.Data;
21   using Seasar.Extension.ADO;
22   using Seasar.Framework.Log;
23   using Seasar.Framework.Util;
24  
25   namespace Seasar.Extension.ADO.Impl
26   {
27   public class BasicUpdateHandler : BasicHandler, IUpdateHandler
28   {
29   private static Logger logger = Logger.GetLogger(typeof(BasicUpdateHandler));
30  
31 0 public BasicUpdateHandler()
32   {
33   }
34  
35 10 public BasicUpdateHandler(IDataSource dataSource, string sql)
36   : base(dataSource, sql)
37   {
38   }
39  
40 0 public BasicUpdateHandler(IDataSource dataSource, string sql,
41   ICommandFactory commandFactory)
42   : base(dataSource, sql, commandFactory)
43   {
44   }
45  
46   #region IUpdateHandler メンバ
47  
48 4 public int Execute(object[] args)
49   {
50 4 Type[] argTypes = GetArgTypes(args);
51 4 string[] argNames = GetArgNames();
52 4 return Execute(args, argTypes, argNames);
53   }
54  
55 10 public int Execute(object[] args, Type[] argTypes, string[] argNames)
56   {
57 10 if(logger.IsDebugEnabled)
58 10 logger.Debug(GetCompleteSql(args));
59 10 IDbConnection connection = Connection;
60 10 try
61   {
62 10 return Execute(connection, args, argTypes, argNames);
63   }
64   finally
65   {
66 10 DataSourceUtil.CloseConnection(this.DataSource, connection);
67   }
68   }
69  
70 10 protected int Execute(IDbConnection connection, object[] args, Type[] argTypes,
71   string[] argNames)
72   {
73 10 IDbCommand cmd = this.Command(connection);
74 10 try
75   {
76 10 BindArgs(cmd, args, argTypes, argNames);
77 10 return CommandUtil.ExecuteNonQuery(this.DataSource, cmd);
78   }
79   finally
80   {
81 10 CommandUtil.Close(cmd);
82   }
83   }
84  
85   #endregion
86   }
87   }
88