Generate Java JPA entity classes from database diagrams using Artificial Intelligence.
Features
Select a database diagram image.
Analyze entities, attributes, and relationships using Google Gemini AI.
Generate Java entity classes.
Generate JPA annotations such as @Entity, @Id, @GeneratedValue, and @ManyToOne.
Choose an output folder to save the generated .java files.
Open the generated Java code directly in Visual Studio Code.
How to Use
Open Visual Studio Code.
Open the Command Palette with Ctrl + Shift + P.
Search for Diagram2Java AI: Generate Java from Diagram.
Select your database diagram image (.png, .jpg, .jpeg, or .webp).
Choose the destination folder for the generated Java files.
Review the generated Java classes.
Supported Input
The extension accepts database diagrams that clearly show:
Entity or table names.
Attributes and data types.
Primary keys and foreign keys.
Relationships between entities.
Requirements
Visual Studio Code.
A valid Google Gemini API key.
An internet connection to access the Gemini API.
API Key
The extension uses Google Gemini AI to analyze diagrams and generate Java code.
Configure your Gemini API key using the extension's supported configuration method. Never publish your API key or include it in the extension package.
Important
Generated code should be reviewed before being used in a production project. You may need to adapt package names, relationships, database mappings, and project dependencies.
Author
Developed as an AI-assisted tool for generating Java JPA entities from database diagrams(firas ben kraiem).