コード例 #1
0
        protected override void SetupInheritanceSpecifics()
        {
            SuperClassDef superClassDef = new SuperClassDef(Shape.GetClassDef(), ORMapping.ClassTableInheritance);

            CircleNoPrimaryKey.GetClassDef().SuperClassDef = superClassDef;
            superClassDef.ID = "";
        }
コード例 #2
0
 protected override void SetupInheritanceSpecifics()
 {
     Shape.GetClassDef().PropDefcol.Add(new PropDef("ShapeType_field", typeof(string), PropReadWriteRule.WriteOnce, "ShapeType_field", null));
     CircleNoPrimaryKey.GetClassDef().SuperClassDef =
         new SuperClassDef(Shape.GetClassDef(), ORMapping.SingleTableInheritance);
     CircleNoPrimaryKey.GetClassDef().SuperClassDef.Discriminator = "ShapeType_field";
 }
コード例 #3
0
 protected override void SetupInheritanceSpecifics()
 {
     CircleNoPrimaryKey.GetClassDef().SuperClassDef =
         new SuperClassDef(Shape.GetClassDef(), ORMapping.SingleTableInheritance);
     CircleNoPrimaryKey.GetClassDef().SuperClassDef.Discriminator = "ShapeType_field";
     FilledCircleInheritsCircleNoPK.GetClassDef().SuperClassDef =
         new SuperClassDef(CircleNoPrimaryKey.GetClassDef(), ORMapping.ClassTableInheritance);
 }
コード例 #4
0
        public void TestSuperClassKey()
        {
            IBOKey msuperKey = BOPrimaryKey.GetSuperClassKey((ClassDef)CircleNoPrimaryKey.GetClassDef(), objCircle);

            Assert.IsTrue(msuperKey.Contains("ShapeID"), "Super class key should contain the ShapeID property");
            Assert.AreEqual(1, msuperKey.Count, "Super class key should only have one prop");
            Assert.AreEqual(msuperKey["ShapeID"].Value, objCircle.ID["ShapeID"].Value,
                            "ShapeID in parent and child should be the same");
        }
コード例 #5
0
ファイル: BOWithIntID_Child.cs プロジェクト: SaberZA/habanero
 protected void SetupInheritanceSpecifics()
 {
     ClassDef.ClassDefs.Clear();
     _classDefShape = Shape.GetClassDef();
     _classDefCircleNoPrimaryKey = CircleNoPrimaryKey.GetClassDef();
     _classDefCircleNoPrimaryKey.SuperClassDef = new SuperClassDef(_classDefShape,
                                                                   ORMapping.SingleTableInheritance);
     _classDefCircleNoPrimaryKey.SuperClassDef.Discriminator = "ShapeType_field";
     _classDefFilledCircleNoPrimaryKey = FilledCircleNoPrimaryKey.GetClassDef();
     _classDefFilledCircleNoPrimaryKey.SuperClassDef = new SuperClassDef(_classDefCircleNoPrimaryKey,
                                                                         ORMapping.SingleTableInheritance);
     _classDefFilledCircleNoPrimaryKey.SuperClassDef.Discriminator = "ShapeType_field";
 }
コード例 #6
0
        public void TestFindAll_ClassDef_WhenIsSubType()
        {
            //---------------Set up test pack-------------------
            ClassDef.ClassDefs.Clear();
            CircleNoPrimaryKey.GetClassDef().SuperClassDef =
                new SuperClassDef(Shape.GetClassDef(), ORMapping.SingleTableInheritance);
            CircleNoPrimaryKey.GetClassDef().SuperClassDef.Discriminator = "ShapeType_field";
            Shape.GetClassDef().PropDefcol.Add(new PropDef("ShapeType_field", typeof(string), PropReadWriteRule.WriteOnce, "ShapeType_field", null));

            DataStoreInMemory  dataStore          = new DataStoreInMemory();
            CircleNoPrimaryKey circleNoPrimaryKey = new CircleNoPrimaryKey();

            dataStore.Add(circleNoPrimaryKey);
            //---------------Execute Test ----------------------
            IBusinessObjectCollection col = dataStore.FindAll(ClassDef.Get <Shape>(), null);

            //---------------Test Result -----------------------
            Assert.AreEqual(1, col.Count);
            Assert.Contains(circleNoPrimaryKey, col);
            Assert.IsNull(col.SelectQuery.Criteria);
        }
コード例 #7
0
 public void TestFilledCircleIsUsingCorrectInheritance()
 {
     Assert.AreEqual(ORMapping.SingleTableInheritance, CircleNoPrimaryKey.GetClassDef().SuperClassDef.ORMapping);
     Assert.AreEqual(ORMapping.ClassTableInheritance,
                     FilledCircleInheritsCircleNoPK.GetClassDef().SuperClassDef.ORMapping);
 }
コード例 #8
0
 public void TestCircleIsUsingClassTableInheritance()
 {
     Assert.AreEqual(ORMapping.ClassTableInheritance, CircleNoPrimaryKey.GetClassDef().SuperClassDef.ORMapping);
 }