本文整理匯總了TypeScript中@connections/shared/schema-node.model.SchemaNode.getChildren方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript model.SchemaNode.getChildren方法的具體用法?TypeScript model.SchemaNode.getChildren怎麽用?TypeScript model.SchemaNode.getChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@connections/shared/schema-node.model.SchemaNode
的用法示例。
在下文中一共展示了model.SchemaNode.getChildren方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("should create, root with 3 levels", () => {
console.log("========== [SchemaNode] should create, root with 3 levels");
schemaNode = SchemaNode.create(
{
"name": "myCatalog",
"type": "catalog",
"path": "catalog=myCatalog",
"connectionName": "conn1",
"queryable": false,
"children": [
{
"name": "mySchema1",
"type": "schema",
"path": "catalog=myCatalog/schema=mySchema1",
"connectionName": "conn1",
"queryable": false,
"children": [
{
"name": "myTable1",
"type": "table",
"path": "catalog=myCatalog/schema=mySchema1/table=myTable1",
"connectionName": "conn1",
"queryable": true,
"children": []
},
{
"name": "myTable2",
"type": "table",
"path": "catalog=myCatalog/schema=mySchema1/table=myTable2",
"connectionName": "conn1",
"queryable": true,
"children": []
}
]
},
{
"name": "mySchema2",
"type": "schema",
"path": "catalog=myCatalog/schema=mySchema2",
"connectionName": "conn1",
"queryable": false,
"children": [
{
"name": "myTableA",
"type": "table",
"path": "catalog=myCatalog/schema=mySchema2/table=myTableA",
"connectionName": "conn1",
"queryable": true,
"children": []
},
{
"name": "myTableB",
"type": "table",
"path": "catalog=myCatalog/schema=mySchema2/table=myTableB",
"connectionName": "conn1",
"queryable": true,
"children": []
},
{
"name": "myTableC",
"type": "table",
"path": "catalog=myCatalog/schema=mySchema2/table=myTableC",
"connectionName": "conn1",
"queryable": true,
"children": []
}
]
},
],
});
// Root Node (myCatalog)
expect(schemaNode.getName()).toEqual("myCatalog");
expect(schemaNode.getType()).toEqual("catalog");
expect(schemaNode.getPath()).toEqual("catalog=myCatalog");
expect(schemaNode.getConnectionName()).toEqual("conn1");
expect(schemaNode.isQueryable()).toEqual(false);
expect(schemaNode.getMaxLevels()).toEqual(3);
expect(schemaNode.getChildren().length).toEqual(2);
// Root Child 1 (mySchema1)
const schema1: SchemaNode = schemaNode.getChildren()[0];
expect(schema1.getName()).toEqual("mySchema1");
expect(schema1.getType()).toEqual("schema");
expect(schema1.getPath()).toEqual("catalog=myCatalog/schema=mySchema1");
expect(schema1.getConnectionName()).toEqual("conn1");
expect(schema1.isQueryable()).toEqual(false);
expect(schema1.getMaxLevels()).toEqual(2);
expect(schema1.getChildren().length).toEqual(2);
// Root Child 2 (mySchema2)
const schema2: SchemaNode = schemaNode.getChildren()[1];
expect(schema2.getName()).toEqual("mySchema2");
expect(schema2.getType()).toEqual("schema");
expect(schema2.getPath()).toEqual("catalog=myCatalog/schema=mySchema2");
expect(schema2.getConnectionName()).toEqual("conn1");
expect(schema2.isQueryable()).toEqual(false);
expect(schema2.getMaxLevels()).toEqual(2);
expect(schema2.getChildren().length).toEqual(3);
//.........這裏部分代碼省略.........