Clover.NET coverage report - Coverage for s2dao.net

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

File Stats: LOC: 109   Methods: 8
NCLOC: 77 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Seasar.Dao.Impl\RelationPropertyTypeImpl.cs 30.0% 65.0% 75.0% 57.9%
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.Reflection;
21   using Seasar.Extension.ADO;
22   using Seasar.Extension.ADO.Impl;
23  
24   namespace Seasar.Dao.Impl
25   {
26   public class RelationPropertyTypeImpl
27   : PropertyTypeImpl, IRelationPropertyType
28   {
29   protected int relationNo;
30   protected string[] myKeys;
31   protected string[] yourKeys;
32   protected IBeanMetaData beanMetaData;
33  
34 0 public RelationPropertyTypeImpl(PropertyInfo propertyInfo)
35   : base(propertyInfo)
36   {
37   }
38  
39 20 public RelationPropertyTypeImpl(PropertyInfo propertyInfo, int relationNo,
40   string[] myKeys, string[] yourKeys, IDatabaseMetaData dbMetaData, IDbms dbms)
41   : base(propertyInfo)
42   {
43 20 this.relationNo = relationNo;
44 20 this.myKeys = myKeys;
45 20 this.yourKeys = yourKeys;
46 20 Type beanType = propertyInfo.PropertyType;
47 20 beanMetaData = new BeanMetaDataImpl(beanType, dbMetaData, dbms);
48   }
49  
50   #region IRelationPropertyType メンバ
51  
52   public int RelationNo
53   {
54 172 get
55   {
56 172 return relationNo;
57   }
58   }
59  
60   public int KeySize
61   {
62 122 get
63   {
64 122 if(myKeys.Length > 0)
65 0 return myKeys.Length;
66   else
67 122 return beanMetaData.PrimaryKeySize;
68   }
69   }
70  
71 61 public string GetMyKey(int index)
72   {
73 61 if(myKeys.Length > 0)
74 0 return myKeys[index];
75   else
76 61 return beanMetaData.GetPrimaryKey(index);
77   }
78  
79 15 public string GetYourKey(int index)
80   {
81 15 if(yourKeys.Length > 0)
82 0 return yourKeys[index];
83   else
84 15 return beanMetaData.GetPrimaryKey(index);
85   }
86  
87 0 public bool IsYourKey(string columnName)
88   {
89   for(int i = 0; i < KeySize; ++i)
90   {
91   if(string.Compare(columnName, GetYourKey(i), true) == 0)
92   return true;
93   }
94   return false;
95   }
96  
97   public IBeanMetaData BeanMetaData
98   {
99 74 get
100   {
101 74 return beanMetaData;
102   }
103   }
104  
105   #endregion
106  
107   }
108   }
109