shenyu-admin/src/main/java/org/apache/shenyu/admin/mybatis/og/interceptor/OpenGaussSQLPrepareInterceptor.java [40:65]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Object intercept(final Invocation invocation) throws Throwable {
        StatementHandler statementHandler = (StatementHandler) invocation.getTarget();

        //Elegant access to object properties through MetaObject, here is access to the properties of statementHandler;
        //MetaObject is an object provided by Mybatis for easy and elegant access to object properties,
        // through which you can simplify the code, no need to try/catch various reflect exceptions,
        // while it supports the operation of JavaBean, Collection, Map three types of object operations.
        // MetaObject metaObject = MetaObject
        //        .forObject(statementHandler, SystemMetaObject.DEFAULT_OBJECT_FACTORY, SystemMetaObject.DEFAULT_OBJECT_WRAPPER_FACTORY,
        //                new DefaultReflectorFactory());
        //First intercept to RoutingStatementHandler, there is a StatementHandler type delegate variable,
        // its implementation class is BaseStatementHandler, and then to the BaseStatementHandler member variable mappedStatement

        // MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
        // String id = mappedStatement.getId(); mapper method full path
        // String sqlCommandType = mappedStatement.getSqlCommandType().toString();  sql method eg: insert update delete select

        BoundSql boundSql = statementHandler.getBoundSql();
        // get original sql file
        // reflect modify sql file
        Field field = boundSql.getClass().getDeclaredField("sql");
        field.setAccessible(true);
        field.set(boundSql, boundSql.getSql().replace("`", "\"").toLowerCase());

        return invocation.proceed();
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



shenyu-admin/src/main/java/org/apache/shenyu/admin/mybatis/pg/interceptor/PostgreSQLPrepareInterceptor.java [40:65]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public Object intercept(final Invocation invocation) throws Throwable {
        StatementHandler statementHandler = (StatementHandler) invocation.getTarget();

        //Elegant access to object properties through MetaObject, here is access to the properties of statementHandler;
        //MetaObject is an object provided by Mybatis for easy and elegant access to object properties,
        // through which you can simplify the code, no need to try/catch various reflect exceptions,
        // while it supports the operation of JavaBean, Collection, Map three types of object operations.
        // MetaObject metaObject = MetaObject
        //        .forObject(statementHandler, SystemMetaObject.DEFAULT_OBJECT_FACTORY, SystemMetaObject.DEFAULT_OBJECT_WRAPPER_FACTORY,
        //                new DefaultReflectorFactory());
        //First intercept to RoutingStatementHandler, there is a StatementHandler type delegate variable,
        // its implementation class is BaseStatementHandler, and then to the BaseStatementHandler member variable mappedStatement

        // MappedStatement mappedStatement = (MappedStatement) metaObject.getValue("delegate.mappedStatement");
        // String id = mappedStatement.getId(); mapper method full path
        // String sqlCommandType = mappedStatement.getSqlCommandType().toString();  sql method eg: insert update delete select

        BoundSql boundSql = statementHandler.getBoundSql();
        // get original sql file
        // reflect modify sql file
        Field field = boundSql.getClass().getDeclaredField("sql");
        field.setAccessible(true);
        field.set(boundSql, boundSql.getSql().replace("`", "\"").toLowerCase());

        return invocation.proceed();
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



