Skip to content

feat: JPA entity relationship rules not loaded for non-Spring JPA projects (EclipseLink/pure JPA) #602

Description

@SunnyWenwen

What problem are you trying to solve?

When running understand on a Java EE project that uses JPA with EclipseLink (not Spring), the @entity relationship extraction rules (@onetomany, @manytoone, @OnetoOne, @manytomany → depends_on edges) are never loaded because:

  1. The rules are defined exclusively in frameworks/spring.md
  2. spring.md is only triggered when the detected framework list includes spring
  3. Projects using JPA without Spring (e.g., EclipseLink, pure JPA in Java EE/EJB) detect as ['EclipseLink', 'JPA', ...] — no spring → rules never fire
  4. The resulting knowledge-graph has zero depends_on edges, making downstream ERD generation produce isolated tables with no relationships

Proposed solution (optional)

  1. Decouple JPA relationship rules from Spring: Move @entity relationship extraction rules to a separate frameworks/jpa.md (or frameworks/eclipselink.md) that triggers when framework detection finds JPA, EclipseLink, or Hibernate — independent of Spring.
  2. Alternatively, expand framework mapping: In project-scanner, when JPA or EclipseLink is detected, also load spring.md addendum (since the JPA rules there are framework-agnostic and apply to any JPA implementation).
  3. Preferred approach: Option 1 is cleaner — the rules themselves are pure JPA spec (javax.persistence.* / jakarta.persistence.*) and have no Spring dependency.

Alternatives you've considered

No response

Which part of the project?

skill

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions