Is your feature request related to a problem? Please describe
The codeanalyzer currently lacks database operation analysis capabilities. It cannot detect, represent or analyze CRUD (Create, Read, Update, Delete) operations in Java classes, making it difficult to understand database interactions and data flow in applications.
Describe the solution you'd like
Add a CRUDOperation and CRUDQuery class to represent database operations with:
- Detection of database-related methods/annotations:
@Query, @Insert, @Update, @Delete annotations- JDBC/JPA/Hibernate method calls (
persist, merge, remove, find, executeQuery, executeUpdate) - SQL/JPQL strings in code
- Properties to capture:
classCRUDOperation {
privateCRUDOperationTypeoperationType; // An Enum with CREATE, READ, UPDATE, DELETEprivateintline = -1; // Source code location details
}
classCRUDQuery {
privateStringqueryString; // Raw SQL or JPQLprivateCRUDQueryTypequeryType; // An Enum with READ and WRITEprivateintline = -1; // Source code location details
}- Integration with
CallSite and Callable objects to track database operations:
classCallSite {
// Existing fields...privateCRUDOperationcrudOperation;
privateCRUDQuerycrudQuery;
}
classCallable {
// Existing fields...privateList<CRUDOperation> crudOperations = newArrayList<>();
privateList<CRUDQuery> crudQueries = newArrayList<>();
}Describe alternatives you've considered
- Parsing raw SQL strings - Limited, misses ORM operations
- Static analysis of database calls - Complex implementation
- Configuration-based approach - Less accurate, requires manual updates
Additional context
The solution should support common Java persistence frameworks:
- Jakarta and JavaEE
- Spring Data JPA
- Hibernate
- JDBC
- MyBatis
Is your feature request related to a problem? Please describe
The codeanalyzer currently lacks database operation analysis capabilities. It cannot detect, represent or analyze CRUD (Create, Read, Update, Delete) operations in Java classes, making it difficult to understand database interactions and data flow in applications.
Describe the solution you'd like
Add a
CRUDOperationandCRUDQueryclass to represent database operations with:@Query,@Insert,@Update,@Deleteannotationspersist,merge,remove,find,executeQuery,executeUpdate)CallSiteandCallableobjects to track database operations:Describe alternatives you've considered
Additional context
The solution should support common Java persistence frameworks: