Clover.NET coverage report - Coverage for s2dao.net

Coverage timestamp: 2006年5月18日 15:09:15

File Stats: LOC: 108   Methods: 7
NCLOC: 80 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Dao.Dbms\Standard.cs 100.0% 89.7% 42.9% 84.6%
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.Collections;
21   using System.Text;
22  
23   namespace Seasar.Dao.Dbms
24   {
25   /// <summary>
26   /// Standard の概要の説明です。
27   /// </summary>
28   public class Standard : IDbms
29   {
30   private Hashtable autoSelectFromClauseCache = new Hashtable();
31  
32 36 public Standard()
33   {
34   }
35  
36 0 public virtual string Suffix
37   {
38   get { return ""; }
39   }
40  
41 0 public virtual KindOfDbms Dbms
42   {
43   get { return KindOfDbms.None; }
44   }
45  
46 41 public string GetAutoSelectSql(IBeanMetaData beanMetaData)
47   {
48 41 StringBuilder buf = new StringBuilder(100);
49 41 buf.Append(beanMetaData.AutoSelectList);
50 41 buf.Append(" ");
51 41 string beanName = beanMetaData.BeanType.Name;
52 41 lock(autoSelectFromClauseCache)
53   {
54 41 string fromClause = (string) autoSelectFromClauseCache[beanName];
55 41 if(fromClause == null)
56   {
57 15 fromClause = this.CreateAutoSelectFromClause(beanMetaData);
58 15 autoSelectFromClauseCache[beanName] = fromClause;
59   }
60 41 buf.Append(fromClause);
61   }
62 41 return buf.ToString();
63   }
64  
65 13 protected virtual string CreateAutoSelectFromClause(IBeanMetaData beanMetaData)
66   {
67 13 StringBuilder buf = new StringBuilder(100);
68 13 buf.Append("FROM ");
69 13 string myTableName = beanMetaData.TableName;
70 13 buf.Append(myTableName);
71 20 for(int i = 0; i < beanMetaData.RelationPropertyTypeSize; ++i)
72   {
73 7 IRelationPropertyType rpt = beanMetaData.GetRelationPropertyType(i);
74 7 IBeanMetaData bmd = rpt.BeanMetaData;
75 7 buf.Append(" LEFT OUTER JOIN ");
76 7 buf.Append(bmd.TableName);
77 7 buf.Append(" ");
78 7 string yourAliasName = rpt.PropertyName;
79 7 buf.Append(yourAliasName);
80 7 buf.Append(" ON ");
81 14 for(int j = 0; j < rpt.KeySize; ++j)
82   {
83 7 buf.Append(myTableName);
84 7 buf.Append(".");
85 7 buf.Append(rpt.GetMyKey(j));
86 7 buf.Append(" = ");
87 7 buf.Append(yourAliasName);
88 7 buf.Append(".");
89 7 buf.Append(rpt.GetYourKey(j));
90 7 buf.Append(" AND ");
91   }
92 7 buf.Length = buf.Length - 5;
93   }
94 13 return buf.ToString();
95   }
96  
97 0 public virtual string IdentitySelectString
98   {
99   get { return null; }
100   }
101  
102 0 public virtual string GetSequenceNextValString(string sequenceName)
103   {
104   return null;
105   }
106   }
107   }
108