Esempio n. 1
0
        private new static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef propDef =
                new PropDef("Radius", typeof(int), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);
            //propDef = new PropDef("ContactPersonID", typeof(Guid), PropReadWriteRule.WriteOnce, "ContactPersonID", null);
            //lPropDefCol.Add(propDef);

            KeyDefCol keysCol = new KeyDefCol();
            RelationshipDefCol relDefCol = new RelationshipDefCol();

            //RelKeyDef relKeyDef = new RelKeyDef();
            //IPropDef relPropDef = lPropDefCol["ContactPersonID"];
            //RelPropDef lRelPropDef = new RelPropDef(relPropDef, "ContactPersonID");
            //relKeyDef.Add(lRelPropDef);
            //RelationshipDef relDef = new SingleRelationshipDef("ContactPerson", typeof(ContactPerson), relKeyDef, false, DeleteParentAction.DoNothing);
            //relDefCol.Add(relDef);

            ClassDef lClassDef = new ClassDef(typeof(CircleNoPrimaryKey), null, "circle_table", lPropDefCol, keysCol, relDefCol, null);
            //ClassDef lClassDef = new ClassDef(typeof(CircleNoPrimaryKey), null, lPropDefCol, keysCol, relDefCol);
            
            lClassDef.SuperClassDef = new SuperClassDef(Shape.GetClassDef(), ORMapping.ClassTableInheritance);
            ClassDef.ClassDefs.Add(lClassDef);
            return lClassDef;
        }
Esempio n. 2
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef    propDef     =
                new PropDef("TransactionSequenceNo", typeof(int), PropReadWriteRule.ReadWrite, null);

            lPropDefCol.Add(propDef);

            propDef = new PropDef("DateTimeUpdated", typeof(DateTime), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("WindowsUser", typeof(String), PropReadWriteRule.WriteOnce, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("LogonUser", typeof(String), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("BusinessObjectTypeName", typeof(string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("CRUDAction", typeof(string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("DirtyXML", typeof(string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("MachineName", typeof(string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);
            return(lPropDefCol);
        }
Esempio n. 3
0
        public void TestEqualsNull()
        {
            PropDefCol propDefCol1 = new PropDefCol();
            PropDefCol propDefCol2 = null;

            Assert.AreNotEqual(propDefCol1, propDefCol2);
        }
Esempio n. 4
0
        private static ClassDef GetClassDef()
        {
            PropDef       propDefPK     = new PropDef(ENUM_PKPROP_NAME, typeof(Guid), PropReadWriteRule.WriteNew, null);
            PropDef       propDef       = new PropDef(ENUM_PROP_NAME, typeof(TestEnum), PropReadWriteRule.ReadWrite, TestEnum.Option1);
            PropDef       propDef2      = new PropDef(ENUM_PROP_NAME_EMPTY, typeof(TestEnumEmpty), PropReadWriteRule.ReadWrite, null);
            PropDef       propDef3      = new PropDef(ENUM_PROP_NAME_PASCAL, typeof(TestEnumPascalCase), PropReadWriteRule.ReadWrite, null);
            PrimaryKeyDef primaryKeyDef = new PrimaryKeyDef {
                propDefPK
            };
            PropDefCol propDefCol = new PropDefCol {
                propDefPK, propDef, propDef2, propDef3
            };

            UIFormField uiFormField = new UIFormField(TestUtil.GetRandomString(), propDef.PropertyName,
                                                      typeof(IComboBox), "EnumComboBoxMapper", "Habanero.Faces.Base", true, null, null, LayoutStyle.Label);
            UIFormColumn uiFormColumn = new UIFormColumn {
                uiFormField
            };
            UIFormTab uiFormTab = new UIFormTab {
                uiFormColumn
            };
            UIForm uiForm = new UIForm {
                uiFormTab
            };
            UIDef    uiDef    = new UIDef("default", uiForm, null);
            UIDefCol uiDefCol = new UIDefCol {
                uiDef
            };

            ClassDef classDef = new ClassDef(typeof(EnumBO), primaryKeyDef, propDefCol, new KeyDefCol(), null, uiDefCol);

            return(classDef);
        }
Esempio n. 5
0
        private static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = CreateBOPropDef();

            KeyDef lKeyDef = new KeyDef();

            lKeyDef.IgnoreIfNull = true;
            lKeyDef.Add(lPropDefCol["PK2Prop1"]);
            lKeyDef.Add(lPropDefCol["PK2Prop2"]);
            KeyDefCol keysCol = new KeyDefCol();

            keysCol.Add(lKeyDef);

            lKeyDef = new KeyDef();
            lKeyDef.IgnoreIfNull = false;

            lKeyDef.Add(lPropDefCol["PK3Prop"]);
            keysCol.Add(lKeyDef);

            PrimaryKeyDef primaryKey = new PrimaryKeyDef();

            primaryKey.IsGuidObjectID = true;
            primaryKey.Add(lPropDefCol["ContactPersonID"]);


            //Releationships
            RelationshipDefCol relDefs = CreateRelationshipDefCol(lPropDefCol);

            ClassDef lClassDef = new ClassDef(typeof(ContactPerson), primaryKey, "contact_person", lPropDefCol, keysCol, relDefs);

            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
Esempio n. 6
0
 public void init()
 {
     PropDef propDef = new PropDef("Prop", typeof(string), PropReadWriteRule.ReadWrite, null);
     _relPropDef = new RelPropDef(propDef, "PropName");
     _propDefCol = new PropDefCol();
     _propDefCol.Add(propDef);
 }
Esempio n. 7
0
        private new static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef    propDef     =
                new PropDef("Radius", typeof(int), PropReadWriteRule.ReadWrite, null);

            lPropDefCol.Add(propDef);
            //propDef = new PropDef("ContactPersonID", typeof(Guid), PropReadWriteRule.WriteOnce, "ContactPersonID", null);
            //lPropDefCol.Add(propDef);

            KeyDefCol          keysCol   = new KeyDefCol();
            RelationshipDefCol relDefCol = new RelationshipDefCol();

            //RelKeyDef relKeyDef = new RelKeyDef();
            //IPropDef relPropDef = lPropDefCol["ContactPersonID"];
            //RelPropDef lRelPropDef = new RelPropDef(relPropDef, "ContactPersonID");
            //relKeyDef.Add(lRelPropDef);
            //RelationshipDef relDef = new SingleRelationshipDef("ContactPerson", typeof(ContactPerson), relKeyDef, false, DeleteParentAction.DoNothing);
            //relDefCol.Add(relDef);

            ClassDef lClassDef = new ClassDef(typeof(CircleNoPrimaryKey), null, "circle_table", lPropDefCol, keysCol, relDefCol, null);

            //ClassDef lClassDef = new ClassDef(typeof(CircleNoPrimaryKey), null, lPropDefCol, keysCol, relDefCol);

            lClassDef.SuperClassDef = new SuperClassDef(Shape.GetClassDef(), ORMapping.ClassTableInheritance);
            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
Esempio n. 8
0
        protected static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef    propDef     = new PropDef("Surname", typeof(String), PropReadWriteRule.ReadWrite, null);

            propDef.AddPropRule(new PropRuleString("ContactPerson-" + propDef.PropertyName, "", 2, 50, null));
            lPropDefCol.Add(propDef);

            propDef = new PropDef("FirstName", typeof(String), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("DateOfBirth", typeof(DateTime), PropReadWriteRule.WriteOnce, null);
            lPropDefCol.Add(propDef);

            //Create concurrency control properties
            propDef = new PropDef("DateLastUpdated", typeof(DateTime), PropReadWriteRule.ReadWrite, DateTime.Now);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("UserLastUpdated", typeof(string), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("MachineLastUpdated", typeof(string), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("VersionNumber", typeof(int), PropReadWriteRule.ReadWrite, 1);
            lPropDefCol.Add(propDef);

            propDef = new PropDef(PK1_PROP1_NAME, typeof(string), PropReadWriteRule.ReadWrite, "PK1_Prop1", null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef(PK1_PROP2_NAME, typeof(string), PropReadWriteRule.ReadWrite, "PK1_Prop2", null);
            lPropDefCol.Add(propDef);

            return(lPropDefCol);
        }
Esempio n. 9
0
        public static ClassDef CreateTestMapperClassDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef propDef =
                new PropDef("ShapeName", typeof(String), PropReadWriteRule.ReadWrite, "ShapeName", null);
            lPropDefCol.Add(propDef);
            propDef = new PropDef("ShapeID", typeof(Guid), PropReadWriteRule.WriteOnce, "ShapeID_field", null);
            lPropDefCol.Add(propDef);
            propDef = new PropDef("ShapeValue", typeof(Int32), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);
            // propDef = new PropDef("MyID", typeof(Guid), PropReadWriteRule.WriteOnce, null);
            // lPropDefCol.Add(propDef);
            PrimaryKeyDef primaryKey = new PrimaryKeyDef();
            primaryKey.IsGuidObjectID = true;
            primaryKey.Add(lPropDefCol["ShapeID"]);
            KeyDefCol keysCol = new KeyDefCol();
            KeyDef lKeyDef = new KeyDef();
            lKeyDef.Add(lPropDefCol["ShapeName"]);
            keysCol.Add(lKeyDef);
//            RelKeyDef relKeyDef = new RelKeyDef();

            //RelPropDef lRelPropDef = new RelPropDef(propDef, "OwnerID");
            //relKeyDef.Add(lRelPropDef);
            //RelationshipDef relDef = new MultipleRelationshipDef("Owner", typeof (Shape),
            //                                                      relKeyDef, false, "", DeleteParentAction.DereferenceRelated);
            RelationshipDefCol relDefCol = new RelationshipDefCol();
            //relDefCol.Add(relDef);

            ClassDef lClassDef = new ClassDef(typeof(Shape), primaryKey, "Shape_table", lPropDefCol, keysCol, relDefCol);
            ClassDef.ClassDefs.Add(lClassDef);
            return lClassDef;
        }
Esempio n. 10
0
        protected static RelationshipDefCol CreateRelationshipDefCol(PropDefCol lPropDefCol)
        {
            RelationshipDefCol relDefCol = new RelationshipDefCol();


            //Define Driver Relationships
            RelKeyDef relKeyDef = new RelKeyDef();
            IPropDef  propDef   = lPropDefCol[PK1_PROP1_NAME];

            RelPropDef lRelPropDef = new RelPropDef(propDef, "DriverFK1");

            relKeyDef.Add(lRelPropDef);

            propDef = lPropDefCol[PK1_PROP2_NAME];

            lRelPropDef = new RelPropDef(propDef, "DriverFK2");
            relKeyDef.Add(lRelPropDef);

            RelationshipDef relDef = new MultipleRelationshipDef("Driver",
                                                                 typeof(Car), relKeyDef, true, "",
                                                                 DeleteParentAction.DereferenceRelated);

            relDefCol.Add(relDef);
            return(relDefCol);
        }
Esempio n. 11
0
 public void SetUp()
 {
     PropDef propDef = new PropDef("Prop", typeof(string), PropReadWriteRule.ReadWrite, null);
     mRelPropDef = new RelPropDef(propDef, "PropName");
     mPropDefCol = new PropDefCol();
     mPropDefCol.Add(propDef);
     BORegistry.DataAccessor = new DataAccessorInMemory();
 }
Esempio n. 12
0
        public void init()
        {
            PropDef propDef = new PropDef("Prop", typeof(string), PropReadWriteRule.ReadWrite, null);

            _relPropDef = new RelPropDef(propDef, "PropName");
            _propDefCol = new PropDefCol();
            _propDefCol.Add(propDef);
        }
Esempio n. 13
0
        //public ClassDefBuilder AddPropDef(string propertyName)
        //{
        //    PropDef propDef = new PropDefBuilder().WithPropertyName(propertyName);
        //    if (_propDefCol == null) _propDefCol = new PropDefCol();
        //    _propDefCol.Add(propDef);
        //    return this;
        //}

        public ClassDefBuilder AddPropDef(PropDef propDef)
        {
            if (_propDefCol == null)
            {
                _propDefCol = new PropDefCol();
            }
            _propDefCol.Add(propDef);
            return(this);
        }
Esempio n. 14
0
        public void SetUp()
        {
            PropDef propDef = new PropDef("Prop", typeof(string), PropReadWriteRule.ReadWrite, null);

            mRelPropDef = new RelPropDef(propDef, "PropName");
            mPropDefCol = new PropDefCol();
            mPropDefCol.Add(propDef);
            BORegistry.DataAccessor = new DataAccessorInMemory();
        }
Esempio n. 15
0
        protected static PropDefCol CreateBOPropDef()
        {
            var lPropDefCol = new PropDefCol();

            var propDef = new PropDef(PK1_PROP1_NAME, typeof(string), PropReadWriteRule.ReadWrite, "PK1_Prop1", null);
            lPropDefCol.Add(propDef);

            return lPropDefCol;
        }
Esempio n. 16
0
        protected static PropDefCol CreateBOPropDef()
        {
            var lPropDefCol = new PropDefCol();

            var propDef = new PropDef(PK1_PROP1_NAME, typeof(string), PropReadWriteRule.ReadWrite, "PK1_Prop1", null);

            lPropDefCol.Add(propDef);

            return(lPropDefCol);
        }
Esempio n. 17
0
        public void TestEquals()
        {
            PropDefCol propDefCol1 = new PropDefCol();
            PropDef    def         = new PropDef("bob", typeof(string), PropReadWriteRule.ReadOnly, null);

            propDefCol1.Add(def);
            PropDefCol propDefCol2 = new PropDefCol();

            propDefCol2.Add(def);
            Assert.AreEqual(propDefCol1, propDefCol2);
        }
Esempio n. 18
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef    propDef     = new PropDef
                                         ("MockBOProp1", typeof(Guid), PropReadWriteRule.ReadWrite, "MockBOProp1", null, true, false);

            lPropDefCol.Add(propDef);
            lPropDefCol.Add("MockBOProp2", typeof(string), PropReadWriteRule.WriteOnce, "MockBOProp2", null);
            lPropDefCol.Add("MockBOID", typeof(Guid), PropReadWriteRule.WriteOnce, "MockBOID", null);
            return(lPropDefCol);
        }
Esempio n. 19
0
 private static ClassDef CreateClassDef()
 {
     PropDefCol lPropDefCol = new PropDefCol();
     PropDef propDef =
         new PropDef("SomeNewProp", typeof(int), PropReadWriteRule.ReadWrite, null);
     lPropDefCol.Add(propDef);
     KeyDefCol keysCol = new KeyDefCol();
     RelationshipDefCol relDefCol = new RelationshipDefCol();
     ClassDef lClassDef = new ClassDef(typeof(BOWithIntID_Child), null, "bowithintid", lPropDefCol, keysCol, relDefCol, null);
     return lClassDef;
 }
        private static ClassDef CreateClassDef()
        {
            PropDefCol         lPropDefCol = new PropDefCol();
            KeyDefCol          keysCol     = new KeyDefCol();
            RelationshipDefCol relDefCol   = new RelationshipDefCol();
            //ClassDef lClassDef = new ClassDef(typeof(FilledCircleInheritsCircleNoPK), primaryKey, lPropDefCol, keysCol, relDefCol);
            ClassDef lClassDef = new ClassDef(typeof(FakeSubClass), null, lPropDefCol, keysCol, relDefCol, null);

            lClassDef.SuperClassDef = new SuperClassDef(FakeSuperClass.GetClassDef(), ORMapping.SingleTableInheritance);
            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
Esempio n. 21
0
        private static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef    propDef     =
                new PropDef("SomeNewProp", typeof(int), PropReadWriteRule.ReadWrite, null);

            lPropDefCol.Add(propDef);
            KeyDefCol          keysCol   = new KeyDefCol();
            RelationshipDefCol relDefCol = new RelationshipDefCol();
            ClassDef           lClassDef = new ClassDef(typeof(BOWithIntID_Child), null, "bowithintid", lPropDefCol, keysCol, relDefCol, null);

            return(lClassDef);
        }
Esempio n. 22
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol propDefCol = new PropDefCol();

            propDefCol.Add("AddressID", typeof(Guid), PropReadWriteRule.WriteOnce, null);
            propDefCol.Add("ContactPersonID", typeof(Guid), PropReadWriteRule.ReadWrite, null);
            propDefCol.Add("AddressLine1", typeof(String), PropReadWriteRule.ReadWrite, null);
            propDefCol.Add("AddressLine2", typeof(String), PropReadWriteRule.ReadWrite, null);
            propDefCol.Add("AddressLine3", typeof(String), PropReadWriteRule.ReadWrite, null);
            propDefCol.Add("AddressLine4", typeof(String), PropReadWriteRule.ReadWrite, null);
            propDefCol.Add("OrganisationID", typeof(Guid), PropReadWriteRule.ReadWrite, null);
            return(propDefCol);
        }
Esempio n. 23
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            IPropDef   propDef     =
                new PropDef("EngineNo", typeof(String), PropReadWriteRule.ReadWrite, "ENGINE_NO", null);

            lPropDefCol.Add(propDef);

            propDef =
                lPropDefCol.Add("EngineID", typeof(Guid), PropReadWriteRule.WriteOnce, "Engine_ID", null);
            propDef = lPropDefCol.Add("CarID", typeof(Guid), PropReadWriteRule.ReadWrite, "CAR_ID", null);

            return(lPropDefCol);
        }
 private new static ClassDef CreateClassDef()
 {
     PropDefCol lPropDefCol = new PropDefCol();
     PropDef propDef =
         new PropDef("Colour", typeof(int), PropReadWriteRule.ReadWrite, null);
     lPropDefCol.Add(propDef);
     KeyDefCol keysCol = new KeyDefCol();
     RelationshipDefCol relDefCol = new RelationshipDefCol();
     //ClassDef lClassDef = new ClassDef(typeof (FilledCircleNoPrimaryKey), null, lPropDefCol, keysCol, relDefCol);
     ClassDef lClassDef = new ClassDef(typeof(FilledCircleNoPrimaryKey), null, "FilledCircle_table", lPropDefCol, keysCol, relDefCol, null);
     lClassDef.SuperClassDef = new SuperClassDef(Circle.GetClassDef(), ORMapping.ConcreteTableInheritance);
     ClassDef.ClassDefs.Add(lClassDef);
     return lClassDef;
 }
Esempio n. 25
0
 public void Test_Add_ShouldSetPropDefsClassDef()
 {
     //---------------Set up test pack-------------------
     PropDef propDef = new PropDefFake();
     PropDefCol col = new PropDefCol();
     var expectedClassDef = MockRepository.GenerateStub<IClassDef>();
     col.ClassDef = expectedClassDef;
     //---------------Assert Preconditions---------------
     Assert.IsNull(propDef.ClassDef);
     //---------------Execute Test ----------------------
     col.Add(propDef);
     //---------------Test Result -----------------------
     Assert.AreSame(expectedClassDef, propDef.ClassDef);
 }
Esempio n. 26
0
        private static ClassDef CreateTestClassDef(string suffix)
        {
            PropDefCol propDefCol = new PropDefCol();
            PropDef    propDef    = new PropDef("TestProperty" + suffix, typeof(string), PropReadWriteRule.ReadWrite, null, null, false, false, 100,
                                                "Tested Property" + suffix, "This is a property for testing.");

            propDefCol.Add(propDef);
            PrimaryKeyDef primaryKeyDef = new PrimaryKeyDef {
                propDef
            };

            return(new ClassDef("TestAssembly", "TestClass" + suffix, primaryKeyDef,
                                propDefCol, new KeyDefCol(), new RelationshipDefCol(), new UIDefCol()));
        }
Esempio n. 27
0
        public void Test_Add_ShouldSetPropDefsClassDef()
        {
            //---------------Set up test pack-------------------
            PropDef    propDef          = new PropDefFake();
            PropDefCol col              = new PropDefCol();
            var        expectedClassDef = MockRepository.GenerateStub <IClassDef>();

            col.ClassDef = expectedClassDef;
            //---------------Assert Preconditions---------------
            Assert.IsNull(propDef.ClassDef);
            //---------------Execute Test ----------------------
            col.Add(propDef);
            //---------------Test Result -----------------------
            Assert.AreSame(expectedClassDef, propDef.ClassDef);
        }
Esempio n. 28
0
        public void TestCreateRelPropNotNull()
        {
            PropDef propDef = new PropDef("Prop1", typeof(string), PropReadWriteRule.ReadWrite, "1");
            RelPropDef relPropDef = new RelPropDef(propDef, "PropName1");
            PropDefCol propDefCol = new PropDefCol();

            propDefCol.Add(propDef);
            IBOPropCol propCol = propDefCol.CreateBOPropertyCol(true);
            IRelProp relProp = relPropDef.CreateRelProp(propCol);

            Assert.AreEqual(relPropDef.OwnerPropertyName, relProp.OwnerPropertyName);
            Assert.AreEqual(relPropDef.RelatedClassPropName, relProp.RelatedClassPropName);

            Assert.IsFalse(relProp.IsNull);
        }
Esempio n. 29
0
        public void TestCreateRelPropNotNull()
        {
            PropDef    propDef    = new PropDef("Prop1", typeof(string), PropReadWriteRule.ReadWrite, "1");
            RelPropDef relPropDef = new RelPropDef(propDef, "PropName1");
            PropDefCol propDefCol = new PropDefCol();

            propDefCol.Add(propDef);
            IBOPropCol propCol = propDefCol.CreateBOPropertyCol(true);
            IRelProp   relProp = relPropDef.CreateRelProp(propCol);

            Assert.AreEqual(relPropDef.OwnerPropertyName, relProp.OwnerPropertyName);
            Assert.AreEqual(relPropDef.RelatedClassPropName, relProp.RelatedClassPropName);

            Assert.IsFalse(relProp.IsNull);
        }
Esempio n. 30
0
        //protected override void ConstructFromClassDef(bool newObject)
        //{
        //    base.ConstructFromClassDef(newObject);
        //    //SetTransactionLog(new TransactionLogTable("TransactionLogStub",
        //    //                                          "DateTimeUpdated",
        //    //                                          "WindowsUser",
        //    //                                          "LogonUser",
        //    //                                          "MachineName",
        //    //                                          "BusinessObjectTypeName",
        //    //                                          "CRUDAction",
        //    //                                          "DirtyXML"));
        //}

        private static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = CreateBOPropDef();

            KeyDefCol keysCol = new KeyDefCol();

            PrimaryKeyDef primaryKey = new PrimaryKeyDef();

            primaryKey.IsGuidObjectID = true;
            primaryKey.Add(lPropDefCol["TransactionSequenceNo"]);
            ClassDef lClassDef = new ClassDef(typeof(TransactionLogStub), primaryKey, lPropDefCol, keysCol, null);

            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
        private new static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef    propDef     =
                new PropDef("Colour", typeof(int), PropReadWriteRule.ReadWrite, "Colour", null);

            lPropDefCol.Add(propDef);
            KeyDefCol          keysCol   = new KeyDefCol();
            RelationshipDefCol relDefCol = new RelationshipDefCol();
            //ClassDef lClassDef = new ClassDef(typeof (FilledCircleNoPrimaryKeyInheritsCircle), null, lPropDefCol, keysCol, relDefCol);
            ClassDef lClassDef = new ClassDef(typeof(FilledCircleNoPrimaryKeyInheritsCircle), null, "FilledCircle_table", lPropDefCol, keysCol, relDefCol, null);

            lClassDef.SuperClassDef = new SuperClassDef(Circle.GetClassDef(), ORMapping.ConcreteTableInheritance);
            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
Esempio n. 32
0
        private static RelationshipDefCol CreateRelationshipDefCol(PropDefCol lPropDefCol)
        {
            RelationshipDefCol relDefCol = new RelationshipDefCol();

            //Define Engine Relationships
            RelKeyDef relKeyDef = new RelKeyDef();
            IPropDef propDef = lPropDefCol["CarID"];

            RelPropDef lRelPropDef = new RelPropDef(propDef, "CarID");
            relKeyDef.Add(lRelPropDef);

            RelationshipDef relDef = new SingleRelationshipDef("Car", typeof (Car), relKeyDef, false, DeleteParentAction.Prevent);
            relDefCol.Add(relDef);

            return relDefCol;
        }
Esempio n. 33
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef    propDef     =
                new PropDef("CarRegNo", typeof(String), PropReadWriteRule.ReadWrite, "CAR_REG_NO", null);

            lPropDefCol.Add(propDef);

            lPropDefCol.Add("OwnerId", typeof(Guid), PropReadWriteRule.ReadWrite, "OWNER_ID", null);

            lPropDefCol.Add("CarID", typeof(Guid), PropReadWriteRule.WriteOnce, "CAR_ID", null);
            lPropDefCol.Add("DriverFK1", typeof(String), PropReadWriteRule.WriteOnce, "Driver_FK1", null);
            lPropDefCol.Add("DriverFK2", typeof(String), PropReadWriteRule.WriteOnce, "Driver_FK2", null);

            return(lPropDefCol);
        }
Esempio n. 34
0
        private static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = CreateBOPropDef();

            KeyDefCol keysCol = new KeyDefCol();

            PrimaryKeyDef primaryKey = new PrimaryKeyDef();

            primaryKey.IsGuidObjectID = true;
            primaryKey.Add(lPropDefCol["MockBOID"]);
            ClassDef lClassDef = new ClassDef
                                     (typeof(MockBOWithCompulsoryField), primaryKey, lPropDefCol, keysCol, new RelationshipDefCol());

            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
        private IBusinessObject GetBusinessObjectStub()
        {
            PropDefCol propDefCol = new PropDefCol {
                _propDef_guid
            };

            PrimaryKeyDef def = new PrimaryKeyDef {
                _propDef_guid
            };
            ClassDef           classDef           = new ClassDef(typeof(BusinessObjectStub), def, propDefCol, new KeyDefCol(), null);
            BusinessObjectStub businessObjectStub = new BusinessObjectStub(classDef);
            BOProp             prop = new BOPropLookupList(_propDef_guid);

            businessObjectStub.Props.Remove(prop.PropertyName);
            businessObjectStub.Props.Add(prop);
            return(businessObjectStub);
        }
Esempio n. 36
0
 private new static ClassDef CreateClassDef()
 {
     PropDefCol lPropDefCol = new PropDefCol();
     IPropDef propDef =
         new PropDef("Colour", typeof(int), PropReadWriteRule.ReadWrite, null);
     lPropDefCol.Add(propDef);
     propDef = lPropDefCol.Add("FilledCircleID", typeof(Guid), PropReadWriteRule.WriteOnce, "FilledCircleID_field", null);
     PrimaryKeyDef primaryKey = new PrimaryKeyDef();
     primaryKey.IsGuidObjectID = true;
     primaryKey.Add(lPropDefCol["FilledCircleID"]);
     KeyDefCol keysCol = new KeyDefCol();
     RelationshipDefCol relDefCol = new RelationshipDefCol();
     ClassDef lClassDef = new ClassDef(typeof (FilledCircle), primaryKey, "FilledCircle_table", lPropDefCol, keysCol, relDefCol);
     lClassDef.SuperClassDef = new SuperClassDef(Circle.GetClassDef(), ORMapping.ConcreteTableInheritance);
     ClassDef.ClassDefs.Add(lClassDef);
     return lClassDef;
 }
Esempio n. 37
0
        private static ClassDef CreateTestClassDef(string suffix)
        {
            PropDefCol propDefCol = new PropDefCol();
            PropDef    propDef    = new PropDef("TestProperty" + suffix, typeof(string), PropReadWriteRule.ReadWrite, null, null, false, false, 100,
                                                "Tested Property" + suffix, null);

            propDefCol.Add(propDef);
            PrimaryKeyDef primaryKeyDef = new PrimaryKeyDef {
                propDef
            };
            var testClassDef = new ClassDef("Habanero.Test.Structure", "Person" + suffix, primaryKeyDef,
                                            propDefCol, new KeyDefCol(), new RelationshipDefCol(), new UIDefCol());
            var uiGrid = new UIGrid();

            testClassDef.UIDefCol.Add(new UIDef("UIDef1", new UIForm(), uiGrid));
            return(testClassDef);
        }
Esempio n. 38
0
        public static ClassDef CreateClassDefWithShapeRelationship()
        {
            PropDefCol lPropDefCol = CreateBOPropDef();

            KeyDef lKeyDef = new KeyDef();

            lKeyDef.IgnoreIfNull = true;
            lKeyDef.Add(lPropDefCol["PK2Prop1"]);
            lKeyDef.Add(lPropDefCol["PK2Prop2"]);
            KeyDefCol keysCol = new KeyDefCol();

            keysCol.Add(lKeyDef);

            lKeyDef = new KeyDef();
            lKeyDef.IgnoreIfNull = false;

            lKeyDef.Add(lPropDefCol["PK3Prop"]);
            keysCol.Add(lKeyDef);

            PrimaryKeyDef primaryKey = new PrimaryKeyDef();

            primaryKey.IsGuidObjectID = true;
            primaryKey.Add(lPropDefCol["ContactPersonID"]);


            //Releationships
            RelationshipDefCol relDefs = new RelationshipDefCol();

            RelKeyDef  relKeyDef   = new RelKeyDef();
            IPropDef   propDef     = lPropDefCol["ContactPersonID"];
            RelPropDef lRelPropDef = new RelPropDef(propDef, "OwnerId");

            relKeyDef.Add(lRelPropDef);

            RelationshipDef relDef = new MultipleRelationshipDef("Shapes", typeof(Shape),
                                                                 relKeyDef, false, "",
                                                                 DeleteParentAction.DereferenceRelated);

            //relDefCol.Add(relDef1);
            relDefs.Add(relDef);

            ClassDef lClassDef = new ClassDef(typeof(ContactPerson), primaryKey, "contact_person", lPropDefCol, keysCol, relDefs);

            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
Esempio n. 39
0
 public void TestAddDuplicationException()
 {
     //---------------Set up test pack-------------------
     PropDef propDef = new PropDef("prop", typeof(string), PropReadWriteRule.ReadWrite, null);
     PropDefCol col = new PropDefCol {propDef};
     //---------------Execute Test ----------------------
     try
     {
         col.Add(propDef);
         Assert.Fail("Expected to throw an ArgumentException");
     }
         //---------------Test Result -----------------------
     catch (ArgumentException ex)
     {
         StringAssert.Contains("A property definition with the name 'prop' already exists", ex.Message);
     }
 }
        private static ClassDef CreateClassDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            IPropDef   propDef     = new PropDef("FakeSuperClassID", typeof(Guid), PropReadWriteRule.WriteOnce, null);

            lPropDefCol.Add(propDef);
            PrimaryKeyDef primaryKey = new PrimaryKeyDef {
                IsGuidObjectID = true
            };

            primaryKey.Add(lPropDefCol["FakeSuperClassID"]);
            KeyDefCol          keysCol   = new KeyDefCol();
            RelationshipDefCol relDefCol = new RelationshipDefCol();
            ClassDef           lClassDef = new ClassDef(typeof(FakeSuperClass), primaryKey, lPropDefCol, keysCol, relDefCol, null);

            ClassDef.ClassDefs.Add(lClassDef);
            return(lClassDef);
        }
Esempio n. 41
0
        public void Setup()
        {
            ClassDef.ClassDefs.Clear();
            mRelKeyDef = new RelKeyDef();
            mPropDefCol = new PropDefCol();

            PropDef propDef = new PropDef("Prop", typeof(string), PropReadWriteRule.ReadWrite, "1");

            mPropDefCol.Add(propDef);
            RelPropDef lRelPropDef = new RelPropDef(propDef, "PropName");
            mRelKeyDef.Add(lRelPropDef);

            propDef = new PropDef("Prop2", typeof(string), PropReadWriteRule.ReadWrite, "2");

            mPropDefCol.Add(propDef);
            lRelPropDef = new RelPropDef(propDef, "PropName2");
            mRelKeyDef.Add(lRelPropDef);
        }
Esempio n. 42
0
        private static ClassDef CreateClassDef()
        {
            PropDefCol propDefCol = CreateBOPropDef();

            KeyDefCol keysCol = new KeyDefCol();

            PrimaryKeyDef primaryKey = new PrimaryKeyDef();

            primaryKey.IsGuidObjectID = true;
            primaryKey.Add(propDefCol["AddressID"]);

            RelationshipDefCol relDefCol = CreateRelationshipDefCol(propDefCol);

            ClassDef classDef = new ClassDef(typeof(Address), primaryKey, "contact_person_address", propDefCol, keysCol, relDefCol);

            ClassDef.ClassDefs.Add(classDef);
            return(classDef);
        }
Esempio n. 43
0
        public void Test_Contains_WhenPropNameNull_ShouldReturnFalse()
        {
            //---------------Set up test pack-------------------
            PropDefCol propDefCol1 = new PropDefCol();
            PropDef    def         = new PropDef("bob", typeof(string), PropReadWriteRule.ReadOnly, null);

            propDefCol1.Add(def);
            string propertyName = null;

            //---------------Assert Precondition----------------
            Assert.Greater(propDefCol1.Count, 0);
            Assert.IsNull(propertyName);
            //---------------Execute Test ----------------------
            bool contains = propDefCol1.Contains(propertyName);

            //---------------Test Result -----------------------
            Assert.IsFalse(contains);
        }
        private IBusinessObject GetBusinessObjectStub()
        {
            PropDefCol propDefCol = new PropDefCol {_propDef_int};

            PrimaryKeyDef def = new PrimaryKeyDef {_propDef_int};
            def.IsGuidObjectID = false;
            ClassDef classDef = new ClassDef(typeof (BusinessObjectStub), def, propDefCol, new KeyDefCol(), null);
            BusinessObjectStub businessObjectStub = new BusinessObjectStub(classDef);
            BOProp prop = new BOPropLookupList(_propDef_int);
            businessObjectStub.Props.Remove(prop.PropertyName);
            businessObjectStub.Props.Add(prop);
            return businessObjectStub;
        }
        private static ClassDef GetClassDef()
        {
            PropDef propDefPK = new PropDef(ENUM_PKPROP_NAME, typeof(Guid), PropReadWriteRule.WriteNew, null);
            PropDef propDef = new PropDef(ENUM_PROP_NAME, typeof(TestEnum), PropReadWriteRule.ReadWrite, TestEnum.Option1);
            PropDef propDef2 = new PropDef(ENUM_PROP_NAME_EMPTY, typeof(TestEnumEmpty), PropReadWriteRule.ReadWrite, null);
            PropDef propDef3 = new PropDef(ENUM_PROP_NAME_PASCAL, typeof(TestEnumPascalCase), PropReadWriteRule.ReadWrite, null);
            PrimaryKeyDef primaryKeyDef = new PrimaryKeyDef { propDefPK };
            PropDefCol propDefCol = new PropDefCol { propDefPK, propDef, propDef2, propDef3 };

            UIFormField uiFormField = new UIFormField(TestUtil.GetRandomString(), propDef.PropertyName,
                                                      typeof(IComboBox), "EnumComboBoxMapper", "Habanero.Faces.Base", true, null, null, LayoutStyle.Label);
            UIFormColumn uiFormColumn = new UIFormColumn { uiFormField };
            UIFormTab uiFormTab = new UIFormTab { uiFormColumn };
            UIForm uiForm = new UIForm { uiFormTab };
            UIDef uiDef = new UIDef("default", uiForm, null);
            UIDefCol uiDefCol = new UIDefCol { uiDef };

            ClassDef classDef = new ClassDef(typeof(EnumBO), primaryKeyDef, propDefCol, new KeyDefCol(), null, uiDefCol);
            return classDef;
        }
Esempio n. 46
0
 private static PropDefCol CreateBOPropDef()
 {
     PropDefCol propDefCol = new PropDefCol();
     propDefCol.Add("AddressID", typeof(Guid), PropReadWriteRule.WriteOnce, null);
     propDefCol.Add("ContactPersonID", typeof(Guid), PropReadWriteRule.ReadWrite, null);
     propDefCol.Add("AddressLine1", typeof(String), PropReadWriteRule.ReadWrite, null);
     propDefCol.Add("AddressLine2", typeof(String), PropReadWriteRule.ReadWrite, null);
     propDefCol.Add("AddressLine3", typeof(String), PropReadWriteRule.ReadWrite, null);
     propDefCol.Add("AddressLine4", typeof(String), PropReadWriteRule.ReadWrite, null);
     propDefCol.Add("OrganisationID", typeof (Guid), PropReadWriteRule.ReadWrite, null);
     return propDefCol;
 }
        //public ClassDefBuilder AddPropDef(string propertyName)
        //{
        //    PropDef propDef = new PropDefBuilder().WithPropertyName(propertyName);
        //    if (_propDefCol == null) _propDefCol = new PropDefCol();
        //    _propDefCol.Add(propDef);
        //    return this;
        //}

        public ClassDefBuilder AddPropDef(PropDef propDef)
        {
           if (_propDefCol == null) _propDefCol = new PropDefCol();
            _propDefCol.Add(propDef);
            return this;
        }
Esempio n. 48
0
        private static ClassDef CreateTestClassDef(string suffix)
        {
            PropDefCol propDefCol = new PropDefCol();
            PropDef propDef = new PropDef("TestProperty" + suffix, typeof(string), PropReadWriteRule.ReadWrite, null, null, false, false, 100,
                                          "Tested Property" + suffix, null);
            propDefCol.Add(propDef);
            PrimaryKeyDef primaryKeyDef = new PrimaryKeyDef {propDef};
            var testClassDef = new ClassDef("Habanero.Test.Structure", "Person" + suffix, primaryKeyDef,
                                            propDefCol, new KeyDefCol(), new RelationshipDefCol(), new UIDefCol());
            var uiGrid = new UIGrid();
            testClassDef.UIDefCol.Add(new UIDef("UIDef1", new UIForm(), uiGrid ));
            return testClassDef;

        }
        protected static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef propDef = new PropDef("Surname", typeof(String), PropReadWriteRule.ReadWrite, null);
            propDef.AddPropRule(new PropRuleString("ContactPerson-" + propDef.PropertyName, "", 2, 50, null));
            lPropDefCol.Add(propDef);

            propDef = new PropDef("FirstName", typeof(String), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("DateOfBirth", typeof(DateTime), PropReadWriteRule.WriteOnce, null);
            lPropDefCol.Add(propDef);

            return lPropDefCol;
        }
Esempio n. 50
0
 private static ClassDef CreateTestClassDef(string suffix)
 {
     PropDefCol propDefCol = new PropDefCol();
     PropDef propDef = new PropDef("TestProperty" + suffix, typeof(string), PropReadWriteRule.ReadWrite, null, null, false, false, 100,
                                   "Tested Property" + suffix, "This is a property for testing.");
     propDefCol.Add(propDef);
     PrimaryKeyDef primaryKeyDef = new PrimaryKeyDef {propDef};
     return new ClassDef("TestAssembly", "TestClass" + suffix, primaryKeyDef, 
                         propDefCol, new KeyDefCol(), new RelationshipDefCol(), new UIDefCol());
 }
Esempio n. 51
0
        public void TestEqualsDifferentType()
        {
            PropDefCol uiFormField1 = new PropDefCol();

            Assert.AreNotEqual(uiFormField1, "bob");
        }
 private  static ClassDef CreateClassDef()
 {
     PropDefCol lPropDefCol = new PropDefCol();
     IPropDef propDef = new PropDef("FakeSuperClassID", typeof(Guid), PropReadWriteRule.WriteOnce, null);
     lPropDefCol.Add(propDef);
     PrimaryKeyDef primaryKey = new PrimaryKeyDef {IsGuidObjectID = true};
     primaryKey.Add(lPropDefCol["FakeSuperClassID"]);
     KeyDefCol keysCol = new KeyDefCol();
     RelationshipDefCol relDefCol = new RelationshipDefCol();
     ClassDef lClassDef = new ClassDef(typeof(FakeSuperClass), primaryKey, lPropDefCol, keysCol, relDefCol, null);
     ClassDef.ClassDefs.Add(lClassDef);
     return lClassDef;
 }
 private static ClassDef CreateClassDef()
 {
     PropDefCol lPropDefCol = new PropDefCol();
     KeyDefCol keysCol = new KeyDefCol();
     RelationshipDefCol relDefCol = new RelationshipDefCol();
     //ClassDef lClassDef = new ClassDef(typeof(FilledCircleInheritsCircleNoPK), primaryKey, lPropDefCol, keysCol, relDefCol);
     ClassDef lClassDef = new ClassDef(typeof(FakeSubClass), null, lPropDefCol, keysCol, relDefCol, null);
     lClassDef.SuperClassDef = new SuperClassDef(FakeSuperClass.GetClassDef(), ORMapping.SingleTableInheritance);
     ClassDef.ClassDefs.Add(lClassDef);
     return lClassDef;
 }
Esempio n. 54
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef propDef =
                new PropDef("CarRegNo", typeof (String), PropReadWriteRule.ReadWrite, "CAR_REG_NO", null);
            lPropDefCol.Add(propDef);

            lPropDefCol.Add("OwnerId", typeof (Guid), PropReadWriteRule.ReadWrite, "OWNER_ID", null);

            lPropDefCol.Add("CarID", typeof (Guid), PropReadWriteRule.WriteOnce, "CAR_ID", null);
            lPropDefCol.Add("DriverFK1", typeof (String), PropReadWriteRule.WriteOnce, "Driver_FK1", null);
            lPropDefCol.Add("DriverFK2", typeof (String), PropReadWriteRule.WriteOnce, "Driver_FK2", null);

            return lPropDefCol;
        }
 private static PrimaryKeyDef CreatePrimaryKey(PropDefCol lPropDefCol)
 {
     PrimaryKeyDef primaryKey = new PrimaryKeyDef();
     primaryKey.IsGuidObjectID = false;
     primaryKey.Add(lPropDefCol["Surname"]);
     primaryKey.Add(lPropDefCol["FirstName"]);
     primaryKey.Add(lPropDefCol["DateOfBirth"]);
     return primaryKey;
 }
Esempio n. 56
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef propDef =
                new PropDef("TransactionSequenceNo", typeof (int), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("DateTimeUpdated", typeof (DateTime), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("WindowsUser", typeof (String), PropReadWriteRule.WriteOnce, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("LogonUser", typeof (String), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("BusinessObjectTypeName", typeof (string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("CRUDAction", typeof (string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("DirtyXML", typeof (string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("MachineName", typeof (string), PropReadWriteRule.ReadOnly, null);
            lPropDefCol.Add(propDef);
            return lPropDefCol;
        }
Esempio n. 57
0
 private static PropDefCol CreateBOPropDef()
 {
     PropDefCol lPropDefCol = new PropDefCol();
     PropDef propDef = new PropDef
         ("MockBOProp1", typeof (Guid), PropReadWriteRule.ReadWrite, "MockBOProp1", null, true, false);
     lPropDefCol.Add(propDef);
     lPropDefCol.Add("MockBOProp2", typeof (string), PropReadWriteRule.WriteOnce, "MockBOProp2", null);
     lPropDefCol.Add("MockBOID", typeof (Guid), PropReadWriteRule.WriteOnce, "MockBOID", null);
     return lPropDefCol;
 }
        protected static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            PropDef propDef = new PropDef("Surname", typeof (String), PropReadWriteRule.ReadWrite, null);
            propDef.AddPropRule( new PropRuleString("ContactPerson-" + propDef.PropertyName, "", 2, 50, null));
            lPropDefCol.Add(propDef);

            propDef = new PropDef("FirstName", typeof (String), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("DateOfBirth", typeof (DateTime), PropReadWriteRule.WriteOnce, null);
            lPropDefCol.Add(propDef);

            //Create concurrency control properties
            propDef = new PropDef("DateLastUpdated", typeof (DateTime), PropReadWriteRule.ReadWrite, DateTime.Now);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("UserLastUpdated", typeof (string), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("MachineLastUpdated", typeof (string), PropReadWriteRule.ReadWrite, null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef("VersionNumber", typeof (int), PropReadWriteRule.ReadWrite, 1);
            lPropDefCol.Add(propDef);

            propDef = new PropDef(PK1_PROP1_NAME, typeof (string), PropReadWriteRule.ReadWrite, "PK1_Prop1", null);
            lPropDefCol.Add(propDef);

            propDef = new PropDef(PK1_PROP2_NAME, typeof (string), PropReadWriteRule.ReadWrite, "PK1_Prop2", null);
            lPropDefCol.Add(propDef);

            return lPropDefCol;
        }
        protected static RelationshipDefCol CreateRelationshipDefCol(PropDefCol lPropDefCol)
        {
            RelationshipDefCol relDefCol = new RelationshipDefCol();


            //Define Driver Relationships
            RelKeyDef relKeyDef = new RelKeyDef();
            IPropDef propDef = lPropDefCol[PK1_PROP1_NAME];

            RelPropDef lRelPropDef = new RelPropDef(propDef, "DriverFK1");
            relKeyDef.Add(lRelPropDef);

            propDef = lPropDefCol[PK1_PROP2_NAME];

            lRelPropDef = new RelPropDef(propDef, "DriverFK2");
            relKeyDef.Add(lRelPropDef);

            RelationshipDef relDef = new MultipleRelationshipDef("Driver",
                                                                 typeof (Car), relKeyDef, true, "",
                                                                 DeleteParentAction.DereferenceRelated);

            relDefCol.Add(relDef);
            return relDefCol;
        }
Esempio n. 60
0
        private static PropDefCol CreateBOPropDef()
        {
            PropDefCol lPropDefCol = new PropDefCol();
            IPropDef propDef =
                new PropDef("EngineNo", typeof (String), PropReadWriteRule.ReadWrite, "ENGINE_NO", null);
            lPropDefCol.Add(propDef);

            propDef =
                lPropDefCol.Add("EngineID", typeof (Guid), PropReadWriteRule.WriteOnce, "Engine_ID", null);
            propDef = lPropDefCol.Add("CarID", typeof(Guid), PropReadWriteRule.ReadWrite, "CAR_ID", null);

            return lPropDefCol;
        }