Skip to content

Extend python-sdk to surface Java EE CRUD operations and queries #98

Description

@rahlk

Is your feature request related to a problem? Please describe.
We want to surface the database crud operations that are now produced by codeanalyzer version 2.2.0-dev (see issue #100)

Describe the solution you'd like
CLDK's java analysis must now capture the new fields of crud operations and expose them as APIs such as

  • analysis.get_all_crud_operations() -> List[Dict[str, Union[JType, JCallable, List[JCRUDOperation]]]]

  • analysis.get_all_create_operations() -> List[Dict[str, Union[JType, JCallable, List[JCRUDOperation]]]]

  • analysis.get_all_read_operations() -> List[Dict[str, Union[JType, JCallable, List[JCRUDOperation]]]]

  • analysis.get_all_delete_operations() -> List[Dict[str, Union[JType, JCallable, List[JCRUDOperation]]]]

  • analysis.get_all_update_operations() -> List[Dict[str, Union[JType, JCallable, List[JCRUDOperation]]]]

  • analysis.has_crud_operations(callable: JCallable) -> boolean

  • analysis.has_create_operations(callable: JCallable) -> boolean

  • analysis.has_read_operations(callable: JCallable) -> boolean

  • analysis.has_delete_operations(callable: JCallable) -> boolean

  • analysis.has_update_operations(callable: JCallable) -> boolean

  • analysis.get_crud_operations_in_method(callable: JCallable)

  • analysis.get_crud_operations_in_class(cls: JType)

Queries

  • analysis.get_all_crud_queries() -> List[JCRUDQuery]
  • analysis.get_all_read_queries() -> List[JCRUDQuery]
  • analysis.get_all_write_queries() -> List[JCRUDQuery]
  • analysis.get_all_named_queries() -> List[JCRUDQuery]

Some goodies to process named queries

  • analysis.find_named_query_definition(query_string: str) -> Dict[str, JCallable]
    ...

Describe alternatives you've considered
N/A

Additional context

  • We may need new entries in the java model to capture JCRUDQuery and JCRUDOperation
  • Above list of APIs in not exhaustive.

Activity

  1. self-assigned this
    on Feb 8, 2025
  2. added 4 commits that reference this issue on Feb 8, 2025
  3. rahlk commented on Aug 3, 2026

    @rahlk
    CollaboratorAuthor

    Done — JCRUDOperation and the CRUDRow = Dict[str, Union[JType, JCallable, List[JCRUDOperation]]] shape exist (cldk/analysis/java/backend.py:45,52), and this issue's own checklist is already ticked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions