zoukankan      html  css  js  c++  java
  • How to Compare two layer’s object: Get AOT objects both modified in USR & SL1 layer

    static void CompareJob(Args _args)
    {
        UtilElements utilElements;
        UtilElements_Job utilElementsJob;
        UtilElements_Job utilElementsJob_usr;
        UtilElements_Job utilElementsJob_sl1;
        ;
     
        delete_from utilElementsJob;
        Insert_Recordset utilElementsJob(utilLevel, recordType, parentId, name)
            select utilLevel, recordType, parentId, name from utilElements
                where utilElements.utilLevel == UtilEntryLevel::usr || utilElements.utilLevel == UtilEntryLevel::sl1;
        info("Imported completed!");
     
        while select utilElementsJob_usr join utilElementsJob_sl1
            where utilElementsJob_usr.utilLevel == UtilEntryLevel::usr
            && utilElementsJob_sl1.utilLevel == UtilEntryLevel::sl1
            && utilElementsJob_usr.name == utilElementsJob_sl1.name
            // && utilElementsJob_usr.parentId == 0 && utilElementsJob_sl1.parentId == 0
            &&
            (
                (utilelementsJob_usr.recordType == UtilElementType::Class && utilelementsJob_sl1.recordType == UtilElementType::Class)
                ||
                (utilelementsJob_usr.recordType == UtilElementType::Form && utilelementsJob_sl1.recordType == UtilElementType::Form)
                ||
                (utilelementsJob_usr.recordType == UtilElementType::Table && utilelementsJob_sl1.recordType == UtilElementType::Table)
            )
            {
                info(utilElementsJob_usr.name);
            }
    }
    How it works:

    1. There is one special table in AOT\System Documentation\Tables\UtilElements, firstly, create a similar table UtilElements_Job with those fields: utilLevel(Enum: UtilEntryLevel), recordType(Enum: UtilElementType), parentId(int), name(EDT: Name)

    2. import data from UtilElements table into new table UtilElements_Job

    Bcs it’s very slow when querying the UtilElements table. (I cannot find the UtilElements table in AOT Data Dictionary tables folder, Maybe it is a system table, a file-based table, or a queried table…)

    3. while select…

  • 相关阅读:
    【并发】实现内存可见的两种方法比较:加锁和volatile变量
    HTTP2资料汇总
    微服务框架servicecomb
    【并发】使用synchronized获取互斥锁的几点说明
    【并发】通过同步保证内存可见性
    数据最终一致性方案设计
    Oracle中Constraint的状态参数initially与deferrable
    ORACLE GROUPING函数的使用
    Oracle INSERT WITH CHECK OPTION的用法
    ORACLE VERSIONS 用法
  • 原文地址:https://www.cnblogs.com/aot/p/1900140.html
Copyright © 2011-2022 走看看