Clover.NET coverage report - Coverage for s2dao.net

Coverage timestamp: 2006年5月30日 11:48:56

File Stats: LOC: 90   Methods: 4
NCLOC: 63 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Dao.Dbms\Oracle.cs 33.3% 25.8% 25.0% 26.8%
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.Text;
21  
22   namespace Seasar.Dao.Dbms
23   {
24   /// <summary>
25   /// Oracle
26   /// </summary>
27   public class Oracle : Standard
28   {
29 0 public override string Suffix
30   {
31   get
32   {
33   return "_oracle";
34   }
35   }
36  
37 0 public override string GetSequenceNextValString(string sequenceName)
38   {
39   return "select " + sequenceName + ".nextval from dual";
40   }
41  
42 0 public override KindOfDbms Dbms
43   {
44   get
45   {
46   return KindOfDbms.Oracle;
47   }
48   }
49  
50  
51 2 protected override string CreateAutoSelectFromClause(IBeanMetaData beanMetaData)
52   {
53 2 StringBuilder buf = new StringBuilder(100);
54 2 buf.Append("FROM ");
55 2 string myTableName = beanMetaData.TableName;
56 2 buf.Append(myTableName);
57 2 StringBuilder whereBuf = new StringBuilder(100);
58 2 for(int i = 0; i < beanMetaData.RelationPropertyTypeSize; ++i)
59   {
60 0 IRelationPropertyType rpt = beanMetaData.GetRelationPropertyType(i);
61 0 IBeanMetaData bmd = rpt.BeanMetaData;
62 0 buf.Append(", ");
63 0 buf.Append(bmd.TableName);
64 0 buf.Append(" ");
65 0 string yourAliasName = rpt.PropertyName;
66 0 buf.Append(yourAliasName);
67 0 for(int j = 0; j < rpt.KeySize; ++j)
68   {
69   whereBuf.Append(myTableName);
70   whereBuf.Append(".");
71   whereBuf.Append(rpt.GetMyKey(j));
72   whereBuf.Append("=");
73   whereBuf.Append(yourAliasName);
74   whereBuf.Append(".");
75   whereBuf.Append(rpt.GetYourKey(j));
76   whereBuf.Append("(+)");
77   whereBuf.Append(" AND ");
78   }
79   }
80 2 if(whereBuf.Length > 0)
81   {
82 0 whereBuf.Length = whereBuf.Length - 5;
83 0 buf.Append(" WHERE ");
84 0 buf.Append(whereBuf);
85   }
86 2 return buf.ToString();
87   }
88   }
89   }
90