DEV Community

Marko
Marko

Posted on

I Built a Maven Plugin That Generates Spring Boot CRUD Code — v1.4.0 Adds Soft Delete and Better Validation

I’ve just released Spring CRUD Generator v1.4.0 🎉

It’s an open-source Maven plugin that generates Spring Boot CRUD code from a YAML/JSON configuration — entities, DTOs, mappers, services, controllers, Flyway migrations, Docker resources, OpenAPI support, caching configuration, and more.

Repository: https://github.com/mzivkovicdev/spring-crud-generator

What’s new in v1.4.0

1) Stricter input spec validation (and better error reporting)

Validation is now significantly stricter, but also more helpful.

Instead of failing fast on the first invalid field, the generator now validates the entire entity and collects multiple validation errors before failing. Entities are still validated one-by-one, but you get a complete list of issues per entity, which makes fixing configuration problems much faster.

On top of that, relation validation got a major upgrade. The input spec is now validated for common (and painful) relation mistakes, such as:

  • invalid relation type values
  • relations referencing target models that don’t exist
  • invalid or missing join table configuration
  • invalid join column / inverse join column naming
  • missing join table for Many-to-Many
  • unsupported mapping combinations (e.g. orphanRemoval on Many-to-Many / Many-to-One)

It also enforces lower_snake_case naming rules for join table and join column-related names, which helps avoid broken or inconsistent schema artifacts.

2) Soft delete support

Soft delete is now available as a feature. This helps when your domain needs logical deletion (audit/history, restore flows, etc.) without physically removing records.

3) orphanRemoval support for relations

Relations now support an orphanRemoval parameter. In addition, validation prevents unsupported usage — specifically, orphan removal is rejected for Many-to-Many and Many-to-One relations to avoid generating invalid JPA mappings.

4) Hazelcast caching support (incl. Docker Compose)

Caching support now includes Hazelcast, along with cache configuration and Docker Compose resources to make it easier to spin up the required infrastructure.

Quick start (Maven)

If you want to try it out quickly:

<plugin>
  <groupId>dev.markozivkovic</groupId>
  <artifactId>spring-crud-generator</artifactId>
  <version>1.4.0</version>
</plugin>
Enter fullscreen mode Exit fullscreen mode

(See the repo for full configuration examples and the demo project.)

Upgrade notes

If you’re upgrading from an earlier version: expect stricter validation. Specs that previously “worked by accident” may now fail with explicit, actionable errors.

The most common things to double-check are:

  • relation type values
  • target model names in relations
  • Many-to-Many definitions missing a join table
  • join table / join column naming (must be lower_snake_case)
  • avoiding orphanRemoval on Many-to-Many / Many-to-One

Links

Repo: https://github.com/mzivkovicdev/spring-crud-generator

If you try v1.4.0, I’d love feedback — especially on the new validation behavior and the Hazelcast setup.

Top comments (0)