get_jpa_model
Assemble a Java project's JPA entity model from @Entity types, table names, ID fields, and relationships after loading the project.
Instructions
Assemble the project's JPA entity model.
USAGE: get_jpa_model() OUTPUT: Entities with table name, id field, and relationships (kind, target entity, mappedBy side), with locations.
Scans @Entity types (jakarta.persistence and javax.persistence) and reads @Table, @Id, and @OneToMany/@ManyToOne/@OneToOne/ @ManyToMany field annotations. Relationship targets are resolved from the field's type binding, including through collection type arguments (List -> Order).
Projects without JPA on the classpath return an empty model.
potentialMatches lists, the first maxResults by file and position, the @Entity annotations JDT could not confirm, each with the annotation it names; none is an entity.
Options:
maxResults: cap the reported entities (default 100)
potentialMatches, present only when there are any, holds the places JDT's search reports as possible matches but cannot confirm, because a type or name there does not resolve (a missing dependency or a compile error): count is their exact number, and locations lists them, as many as the results it stands beside may list. They are never counted or listed as results.
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxResults | No | Maximum entities to return (default 100) |