<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Spring Crud Generator Blog]]></title><description><![CDATA[Spring Crud Generator Blog]]></description><link>https://spring-crud-generator.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 23:34:21 GMT</lastBuildDate><atom:link href="https://spring-crud-generator.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Spring CRUD Generator v1.1.0 is out (Validation, Redis caching, Spring Boot 3/4)]]></title><description><![CDATA[I just released Spring CRUD Generator v1.1.0.
Repo: https://github.com/mzivkovicdev/spring-crud-generator
This release focuses on making generated projects feel more “production-ready” out of the box: field-level validation, more reliable Redis cachi...]]></description><link>https://spring-crud-generator.hashnode.dev/spring-crud-generator-v110-is-out-validation-redis-caching-spring-boot-34</link><guid isPermaLink="true">https://spring-crud-generator.hashnode.dev/spring-crud-generator-v110-is-out-validation-redis-caching-spring-boot-34</guid><category><![CDATA[Springboot]]></category><category><![CDATA[generators]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[SQL]]></category><category><![CDATA[Java]]></category><category><![CDATA[REST API]]></category><category><![CDATA[NoSQL]]></category><category><![CDATA[crud]]></category><category><![CDATA[CRUD Operations]]></category><category><![CDATA[generator]]></category><category><![CDATA[maven]]></category><category><![CDATA[plugins]]></category><dc:creator><![CDATA[Marko Zivkovic]]></dc:creator><pubDate>Tue, 10 Feb 2026 14:16:53 GMT</pubDate><content:encoded><![CDATA[<p>I just released <strong>Spring CRUD Generator v1.1.0</strong>.</p>
<p>Repo: <a target="_blank" href="https://github.com/mzivkovicdev/spring-crud-generator">https://github.com/mzivkovicdev/spring-crud-generator</a></p>
<p>This release focuses on making generated projects feel more “production-ready” out of the box: <strong>field-level validation</strong>, <strong>more reliable Redis caching</strong>, and <strong>better compatibility with Spring Boot 3 and Spring Boot 4</strong>. It also improves behavior when <strong>OSIV (Open Session in View)</strong> is disabled by generating resources that use <strong>EntityGraph</strong> where needed, avoiding common lazy-loading pitfalls.</p>
<h2 id="heading-whats-new-in-v110">What’s new in v1.1.0</h2>
<h3 id="heading-field-level-validation-in-yaml-fieldsvalidation">Field-level validation in YAML (<code>fields.validation</code>)</h3>
<p>You can now define common validation rules directly in your YAML spec and get generated validation annotations in the right place (DTO/request layer), including regex-based constraints via <code>pattern</code>.</p>
<p>Why this matters:</p>
<ul>
<li><p>validation rules live next to your model definition (single source of truth)</p>
</li>
<li><p>generated APIs fail fast with clear 400 responses instead of leaking issues deeper into the stack</p>
</li>
<li><p>less repetitive boilerplate for request validation</p>
</li>
</ul>
<p>Supported examples include <code>required</code>, <code>email</code>, <code>pattern</code> (regex), <code>min</code>, <code>max</code> etc.</p>
<h3 id="heading-caching-fixes-correct-cacheablevalue">Caching fixes (correct <code>@Cacheable(value=...)</code>)</h3>
<p>Caching was previously easy to misconfigure in generated code due to incorrect <code>@Cacheable(value = ...)</code> values. This version fixes the generated cache names so caching behaves consistently across resources.</p>
<p>Why this matters:</p>
<ul>
<li><p>wrong cache names = cache misses (no benefit) or collisions (hard-to-debug behavior)</p>
</li>
<li><p>consistent naming makes it easier to monitor and invalidate caches correctly</p>
</li>
</ul>
<h3 id="heading-redis-improvement-safer-caching-with-hibernate-lazy-loading">Redis improvement: safer caching with Hibernate lazy loading</h3>
<p>Redis caching is improved by adding <code>HibernateLazyNullModule</code>, which makes serialization safer around Hibernate proxies and lazy-loaded associations.</p>
<p>Why this matters:</p>
<ul>
<li><p>caching entities/DTOs can blow up when lazy fields are involved (serialization issues, unexpected proxy handling, etc.)</p>
</li>
<li><p>this reduces “works locally, breaks in prod” surprises when Redis is enabled and your domain model has lazily loaded relationships</p>
</li>
</ul>
<h3 id="heading-osiv-config-entitygraph-support-osiv-default-false">OSIV config + EntityGraph support (OSIV default: false)</h3>
<p>This release introduces:</p>
<ul>
<li><p><a target="_blank" href="http://additionalProperties.spring.jpa.open"><code>additionalProperties.spring.jpa.open</code></a><code>-in-view</code> (default: <strong>false</strong>)</p>
</li>
<li><p><strong>EntityGraph support</strong> in generated resources when OSIV is disabled</p>
</li>
</ul>
<p>Why this matters:</p>
<ul>
<li><p>many teams disable OSIV to avoid hidden DB access during serialization and to keep boundaries clean</p>
</li>
<li><p>once OSIV is off, naive lazy loading can cause <code>LazyInitializationException</code></p>
</li>
<li><p>EntityGraph helps fetch what’s needed explicitly during the service/repository call instead of during JSON serialization</p>
</li>
</ul>
<h2 id="heading-highlights">Highlights</h2>
<ul>
<li><p><strong>Field validation (</strong><code>fields.validation</code>): configure common validation rules directly in YAML (including regex via <code>pattern</code>).</p>
</li>
<li><p><strong>Caching fixes</strong>: corrected generated <code>@Cacheable(value=...)</code> values.</p>
</li>
<li><p><strong>Redis improvement</strong>: added <code>HibernateLazyNullModule</code> for safer caching with Hibernate lazy loading.</p>
</li>
<li><p><strong>OSIV config</strong>: <a target="_blank" href="http://additionalProperties.spring.jpa.open"><code>additionalProperties.spring.jpa.open</code></a><code>-in-view</code> (default: <code>false</code>), with EntityGraph support when OSIV is off.</p>
</li>
<li><p><strong>Stability</strong>: docs/tests updated, refactoring, and an NPE fix when <code>min</code>/<code>max</code> are not provided.</p>
</li>
</ul>
<h2 id="heading-short-yaml-example">Short YAML example</h2>
<pre><code class="lang-yaml"><span class="hljs-attr">configuration:</span>
  <span class="hljs-attr">database:</span> <span class="hljs-string">postgresql</span>
  <span class="hljs-attr">javaVersion:</span> <span class="hljs-number">21</span>
  <span class="hljs-attr">springBootVersion:</span> <span class="hljs-number">4</span>
  <span class="hljs-attr">cache:</span>
    <span class="hljs-attr">enabled:</span> <span class="hljs-literal">true</span>
    <span class="hljs-attr">type:</span> <span class="hljs-string">REDIS</span>
    <span class="hljs-attr">expiration:</span> <span class="hljs-number">10</span>
  <span class="hljs-attr">additionalProperties:</span>
    <span class="hljs-attr">spring.jpa.open-in-view:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">entities:</span>
  <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">UserEntity</span>
    <span class="hljs-attr">storageName:</span> <span class="hljs-string">user_table</span>
    <span class="hljs-attr">fields:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">id</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">Long</span>
        <span class="hljs-attr">id:</span>
          <span class="hljs-attr">strategy:</span> <span class="hljs-string">IDENTITY</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">email</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">String</span>
        <span class="hljs-attr">validation:</span>
          <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span>
          <span class="hljs-attr">email:</span> <span class="hljs-literal">true</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">password</span>
        <span class="hljs-attr">type:</span> <span class="hljs-string">String</span>
        <span class="hljs-attr">validation:</span>
          <span class="hljs-attr">required:</span> <span class="hljs-literal">true</span>
          <span class="hljs-attr">pattern:</span> <span class="hljs-string">"^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$"</span>
</code></pre>
<blockquote>
<p>The repository contains an updated <strong>full</strong> <a target="_blank" href="https://github.com/mzivkovicdev/spring-crud-generator/blob/master/docs/examples/crud-spec-full.yaml"><strong>CRUD spec YAML</strong></a> reference example with all supported options.</p>
</blockquote>
<h3 id="heading-what-this-generates-high-level">What this generates (high-level)</h3>
<ul>
<li><p>CRUD layers (entities, transfer objects, repositories, services, mappers and controllers)</p>
</li>
<li><p>validation annotations for request fields (e.g. <code>@NotBlank</code>, <code>@Email</code>, <code>@Pattern</code>)</p>
</li>
<li><p>Redis caching wired via Spring Cache abstraction, with corrected cache names</p>
</li>
<li><p>when OSIV is off, generated repository/service methods use EntityGraph patterns to fetch required relations safely</p>
</li>
</ul>
<p>If you try v1.1.0, feedback is welcome. If you find the project useful, I’d really appreciate a star on the repo — it helps a lot:<br /><a target="_blank" href="https://github.com/mzivkovicdev/spring-crud-generator">https://github.com/mzivkovicdev/spring-crud-generator</a></p>
]]></content:encoded></item></channel></rss>