Search in sources :

Example 1 with IValChain

use of com.qlangtech.tis.sql.parser.tuple.creator.IValChain 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)

Aggregations

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