M
mikew01
Hi all
I need to extract all of the SQL select statements from a codebase ideally during build time.
The SQL queries are embedded in the source code in either String or StringBuffer form, none of them are annotated with a unique annotation.
I've been looking into AspectJ and maybe applying an aspect to the class Connection for instance which could output the sql to whereever at some pointduring execution, this does mean however that I'd need some way of executing each and every method which executes a select statement in a unit test for instance.
I've also briefly looked into AST as a possibility.
If the queries were annotated I could have used an annotation processor butalas they aren't.
Has anyone done this kind of thing before or can reccommend a suitable method?
Thanks
I need to extract all of the SQL select statements from a codebase ideally during build time.
The SQL queries are embedded in the source code in either String or StringBuffer form, none of them are annotated with a unique annotation.
I've been looking into AspectJ and maybe applying an aspect to the class Connection for instance which could output the sql to whereever at some pointduring execution, this does mean however that I'd need some way of executing each and every method which executes a select statement in a unit test for instance.
I've also briefly looked into AST as a possibility.
If the queries were annotated I could have used an annotation processor butalas they aren't.
Has anyone done this kind of thing before or can reccommend a suitable method?
Thanks