protected void SetupBase(string resourcePath)
        {
            loader = new EntityLoader(MockRepository.GenerateStub<IFileController>());

            database = new Database("DB1");
            table1 = new Table("Table1");
            table1.AddColumn(new Column("ID") { Datatype = "int" });
            table1.AddColumn(new Column("BasicClass2_Index") { Datatype = "int" });
            database.AddEntity(table1);

            table2 = new Table("Table2");
            table2.AddColumn(new Column("ID") { Datatype = "int" });
            table2.AddColumn(new Column("BASIC_CLASS_1_ID"));
            database.AddEntity(table2);

            tableManyToMany = new Table("Class1Class2");
            tableManyToMany.AddColumn(new Column("Class1ID") { Datatype = "int" });
            tableManyToMany.AddColumn(new Column("Class2ID") { Datatype = "int" });
            database.AddTable(tableManyToMany);

            relationship = table1.CreateRelationshipTo(table2);
            relationship.PrimaryKey.AddColumn("ID");
            relationship.ForeignKey.AddColumn("BASIC_CLASS_1_ID");

            // Call we are testing
            mappingSet = loader.GetEntities(new[] { Path.Combine("Resources", resourcePath) }, database);
        }
        public void SetUp()
        {
            loader = new EntityLoader(MockRepository.GenerateStub<IFileController>());

            database = new Database("DB1");
            table = new Table("Transport");
            table.AddColumn(new Column("ID") { Datatype = "int" });
            table.AddColumn(new Column("Discriminator") { Datatype = "char", Size = 1});
            table.AddColumn(new Column("Name") { Datatype = "varchar", Size = 100 });
            table.AddColumn(new Column("Bike_Code") { Datatype = "varchar", Size = 5 });
            database.AddEntity(table);

            // Call we are testing
            mappingSet = loader.GetEntities(new[] { Path.Combine("Resources", "TablePerClassHierarchy.hbm.xml") }, database);
        }
コード例 #3
0
        public void SetUp()
        {
            Table1 = new Table("Table1");
            Table2 = new Table("Table2");
            Table3 = new Table("Table3");

            Database = new Database("DB1");
            Database.AddEntity(Table1);
            Database.AddEntity(Table2);
            Database.AddEntity(Table3);

            Relationship12 = Table1.CreateRelationshipTo(Table2);
            Relationship13 = Table1.CreateRelationshipTo(Table3);

            Set = new MappingSetImpl(Database, new EntitySetImpl());
        }
コード例 #4
0
        public void Setup()
        {
            loader = new EntityLoader(MockRepository.GenerateStub<IFileController>());

            database = new Database("DB1");
            table = new Table("Table1");
            table.AddColumn(new Column("ID") { Datatype = "int" });
            table.AddColumn(new Column("Column1"));
            table.AddColumn(new Column("Column2"));
            database.AddEntity(table);

            // Call we are testing
            mappingSet = loader.GetEntities(new[] { path }, database);
        }