Search in sources :

Example 1 with TaskNodeTraversesCreatorVisitor

use of com.qlangtech.tis.sql.parser.tuple.creator.impl.TaskNodeTraversesCreatorVisitor in project tis by qlangtech.

the class TestValChainListTupleMap method generateCode.

public void generateCode() throws Exception {
    TableTupleCreator totalpaySummaryTuple = this.parseSqlTaskNode(totalpay_summary);
    TaskNodeTraversesCreatorVisitor visitor = new TaskNodeTraversesCreatorVisitor(TestERRules.getTotalpayErRules());
    totalpaySummaryTuple.accept(visitor);
    Map<IEntityNameGetter, List<IValChain>> tabTriggers = visitor.getTabTriggerLinker();
    for (Map.Entry<IEntityNameGetter, List<IValChain>> e : tabTriggers.entrySet()) {
        System.out.println(e.getKey().getEntityName());
        if ("payinfo".equals(e.getKey().getEntityName().getTabName()) || "card".equals(e.getKey().getEntityName().getTabName())) {
            System.out.println("====================================================");
            System.out.println(e.getKey().getEntityName().getTabName());
            for (IValChain chain : e.getValue()) {
                System.out.println(Joiner.on("->").join(chain.mapChainValve((r) -> {
                    return r.getIdentityName();
                }).iterator()));
            }
        }
    }
}
Also used : IEntityNameGetter(com.qlangtech.tis.sql.parser.tuple.creator.IEntityNameGetter) List(java.util.List) TestERRules(com.qlangtech.tis.sql.parser.er.TestERRules) IValChain(com.qlangtech.tis.sql.parser.tuple.creator.IValChain) TaskNodeTraversesCreatorVisitor(com.qlangtech.tis.sql.parser.tuple.creator.impl.TaskNodeTraversesCreatorVisitor) Map(java.util.Map) TableTupleCreator(com.qlangtech.tis.sql.parser.tuple.creator.impl.TableTupleCreator) Joiner(com.google.common.base.Joiner) TaskNodeTraversesCreatorVisitor(com.qlangtech.tis.sql.parser.tuple.creator.impl.TaskNodeTraversesCreatorVisitor) TableTupleCreator(com.qlangtech.tis.sql.parser.tuple.creator.impl.TableTupleCreator) IValChain(com.qlangtech.tis.sql.parser.tuple.creator.IValChain) List(java.util.List) IEntityNameGetter(com.qlangtech.tis.sql.parser.tuple.creator.IEntityNameGetter) Map(java.util.Map)

Example 2 with TaskNodeTraversesCreatorVisitor

use of com.qlangtech.tis.sql.parser.tuple.creator.impl.TaskNodeTraversesCreatorVisitor in project tis by qlangtech.

the class DataFlowAppSource method getTabTriggerLinker.

// @Override
public Map<IEntityNameGetter, List<IValChain>> getTabTriggerLinker() {
    try {
        SqlTaskNodeMeta.SqlDataFlowTopology topology = SqlTaskNodeMeta.getSqlDataFlowTopology(dataflowName);
        TableTupleCreator finalTableNode = topology.parseFinalSqlTaskNode();
        ERRules erR = getErRules();
        TaskNodeTraversesCreatorVisitor visitor = new TaskNodeTraversesCreatorVisitor(erR);
        finalTableNode.accept(visitor);
        Map<IEntityNameGetter, List<IValChain>> tabTriggers = visitor.getTabTriggerLinker();
        return tabTriggers;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : TaskNodeTraversesCreatorVisitor(com.qlangtech.tis.sql.parser.tuple.creator.impl.TaskNodeTraversesCreatorVisitor) TableTupleCreator(com.qlangtech.tis.sql.parser.tuple.creator.impl.TableTupleCreator) SqlTaskNodeMeta(com.qlangtech.tis.sql.parser.SqlTaskNodeMeta) IEntityNameGetter(com.qlangtech.tis.sql.parser.tuple.creator.IEntityNameGetter)

Aggregations

IEntityNameGetter (com.qlangtech.tis.sql.parser.tuple.creator.IEntityNameGetter)2 TableTupleCreator (com.qlangtech.tis.sql.parser.tuple.creator.impl.TableTupleCreator)2 TaskNodeTraversesCreatorVisitor (com.qlangtech.tis.sql.parser.tuple.creator.impl.TaskNodeTraversesCreatorVisitor)2 Joiner (com.google.common.base.Joiner)1 SqlTaskNodeMeta (com.qlangtech.tis.sql.parser.SqlTaskNodeMeta)1 TestERRules (com.qlangtech.tis.sql.parser.er.TestERRules)1 IValChain (com.qlangtech.tis.sql.parser.tuple.creator.IValChain)1 List (java.util.List)1 Map (java.util.Map)1