Skip to content

How to replace StatementLocator/StatementRewriter #2655

Answered by stevenschlansker
vszakd asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @vszakd , can you define() an attribute and use statement templating instead? I am writing pseudocode and did not fully test this, but something like

class SchemaDefiner implements StatementCustomizer {
    void beforeTemplating(PreparedStatement stmt, StatementContext ctx) {
        ctx.define("schema", schema.name());
    }
}

@UseTemplateEngine(DefinedAttributeTemplateEngine.class)
@SqlQuery("select * from <schema>.table where foo = bar")
MyRow list();

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@vszakd
Comment options

@stevenschlansker
Comment options

@vszakd
Comment options

@stevenschlansker
Comment options

Answer selected by vszakd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants