Clover.NET coverage report - Coverage

Coverage timestamp: Friday, May 20, 2005 9:17:00 PM

File Stats: LOC: 109   Methods: 3
NCLOC: 52 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Configuration\Sql\Static\ProcedureSql.cs 75.0 % 100.0 % 100.0 % 95.0 %
coverage coverage
1  
2   #region Apache Notice
3   /*****************************************************************************
4   * $Header: $
5   * $Revision: $
6   * $Date: $
7   *
8   * iBATIS.NET Data Mapper
9   * Copyright (C) 2004 - Gilles Bayon
10   *
11   *
12   * Licensed under the Apache License, Version 2.0 (the "License");
13   * you may not use this file except in compliance with the License.
14   * You may obtain a copy of the License at
15   *
16   * http://www.apache.org/licenses/LICENSE-2.0
17   *
18   * Unless required by applicable law or agreed to in writing, software
19   * distributed under the License is distributed on an "AS IS" BASIS,
20   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21   * See the License for the specific language governing permissions and
22   * limitations under the License.
23   *
24   ********************************************************************************/
25   #endregion
26  
27   #region Imports
28   using System;
29  
30   using IBatisNet.Common;
31   using IBatisNet.DataMapper.Configuration.Statements;
32   using IBatisNet.DataMapper.Scope;
33   #endregion
34  
35  
36   namespace IBatisNet.DataMapper.Configuration.Sql.Static
37   {
38   /// <summary>
39   /// Summary description for ProcedureSql.
40   /// </summary>
41   public class ProcedureSql : ISql
42   {
43   #region Fields
44  
45   private IStatement _statement = null ;
46   private PreparedStatement _preparedStatement = null ;
47   private string _sqlStatement = string.Empty;
48   private object _synRoot = new Object();
49  
50   #endregion
51  
52   #region Constructor (s) / Destructor
53   /// <summary>
54   /// Constructor
55   /// </summary>
56   /// <param name="statement">The statement.</param>
57   /// <param name="sqlStatement"></param>
58 680 public ProcedureSql(string sqlStatement, IStatement statement)
59   {
60 680 _sqlStatement = sqlStatement;
61 680 _statement = statement;
62   }
63   #endregion
64  
65   #region ISql Members
66  
67   /// <summary>
68   ///
69   /// </summary>
70   /// <param name="parameterObject"></param>
71   /// <param name="session"></param>
72   /// <returns></returns>
73 7 public RequestScope GetRequestScope(object parameterObject, IDalSession session)
74   {
75 7 RequestScope request = new RequestScope();
76  
77 7 request.ParameterMap = _statement.ParameterMap;
78 7 request.ResultMap = _statement.ResultMap;
79 7 request.PreparedStatement = BuildPreparedStatement(session, request, _sqlStatement);
80  
81 7 return request;
82   }
83  
84   /// <summary>
85   /// Build the PreparedStatement
86   /// </summary>
87   /// <param name="session"></param>
88   /// <param name="commandText"></param>
89   /// <param name="request"></param>
90 7 public PreparedStatement BuildPreparedStatement(IDalSession session, RequestScope request, string commandText)
91   {
92 7 if ( _preparedStatement == null )
93   {
94 6 lock(_synRoot)
95   {
96 6 if (_preparedStatement==null)
97   {
98 6 PreparedStatementFactory factory = new PreparedStatementFactory( session, request, _statement, commandText);
99 6 _preparedStatement = factory.Prepare();
100   }
101   }
102   }
103 7 return _preparedStatement;
104   }
105  
106   #endregion
107   }
108   }
109