@OneToMany / @ManyToOne
Parent entity holds the collection. Child entity holds the foreign key. @JoinColumn and @MappedBy generated correctly on both sides.
Automatically generate complete Spring Boot CRUD operations for every entity in your project — controller, service, repository, DTO, mapper. All wired together, all runnable from day one.
Generated per entity
ProductController.java REST endpoints for GET /products, GET /products/{id}, POST /products, PUT /products/{id}, DELETE /products/{id}. Annotated with @RestController, @RequestMapping, @Valid on request bodies.
ProductService.java + ProductServiceImpl.javaInterface + implementation pattern. Business logic layer cleanly separated from persistence. All CRUD methods defined — override or extend to add your logic.
ProductRepository.java Extends JpaRepository<Product, Long>. findById, findAll, save, deleteById — all inherited, zero implementation required.
Product.java@Entity, @Table, @Id, @GeneratedValue, @Column annotations for every property you defined. Lombok @Data keeps it concise.
ProductDto.java + ProductMapper.java DTO separates your API contract from your persistence model. MapStruct @Mapper handles bidirectional mapping at compile time — no reflection, no runtime cost.
Generated endpoints
/{resources}Returns all records. Supports pagination./{resources}/{id}Returns a single record by ID. Returns 404 if not found./{resources}Creates a new record. Request body validated with Bean Validation./{resources}/{id}Fully updates an existing record./{resources}/{id}Deletes the record. Returns 204 No Content. Resource name is pluralized and lowercased automatically. Product → /products.
How to generate
Group ID, artifact ID, Java version. Same flow as Spring Initializr.
Type your entity name, add fields and their types. Each resource gets its own CRUD layer.
Add @OneToMany, @ManyToMany, @ManyToOne, or N-ary associations between your entities if needed.
Click Generate, download the ZIP, run mvn spring-boot:run. Your CRUD API is on localhost:8080.
Beyond basic CRUD
Most CRUD generators stop at a single table. SpringBoot Generator lets you define JPA relationships between entities and correctly generates the mapping on both sides.
Parent entity holds the collection. Child entity holds the foreign key. @JoinColumn and @MappedBy generated correctly on both sides.
Join table created automatically. Owner side and inverse side annotated correctly. No more staring at Hibernate docs.
Shared primary key or foreign key strategy. Both options available when you configure the relation.
Link three or more entities through a synthesized association entity — each participant mapped as a @ManyToOne. Goes beyond the classic two-entity Many-To-Many.
FAQ
GET /products supports Spring Data's Pageable parameter — page size, page number, and sort are available out of the box. @NotNull or @NotBlank on the DTO and nullable = false on the @Column in the entity. Validation is enforced at both the API and database layer. Define your entities once, get all the code you need.
Generate CRUD — free