<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab" -->

---
title: DB-first Meets Code-first: Persistence Workflows in...
description: A JetBrains engineer walks through a live IntelliJ IDEA demo covering database-first and code-first workflows for Spring persistence projects. Starting from a...
canonical: https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: DB-first Meets Code-first: Persistence Workflows in IntelliJ IDEA by Anton Arhipov @ Spring I/O 2026 | daily.dev
og:description: A JetBrains engineer walks through a live IntelliJ IDEA demo covering database-first and code-first workflows for Spring persistence projects. Starting from a...
og:url: https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab
og:image: https://api.daily.dev/og/posts/TyvIyd5AB.png
og:image:alt: DB-first Meets Code-first: Persistence Workflows in IntelliJ IDEA by Anton Arhipov @ Spring I/O 2026
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# DB-first Meets Code-first: Persistence Workflows in IntelliJ IDEA by Anton Arhipov @ Spring I/O 2026

**[Spring I/O](https://daily.dev/sources/springio)** · 52 min read · 0 upvotes · 0 comments

## Summary

A JetBrains engineer walks through a live IntelliJ IDEA demo covering database-first and code-first workflows for Spring persistence projects. Starting from a raw SQL schema, he generates Spring Data JDBC and JPA entities, uses AI agents to group entities into logical packages, adjusts entity relationships, adds new columns and enums from schema changes, and generates Flyway migrations both from database diffs and from model diffs. He also covers branch merge conflicts in migration versioning, DB-to-DB comparison for generating merge migrations, and MapStruct DTO mapping support carried over from the JPA Buddy plugin. The talk is framed as work in progress, seeking audience feedback on which persistence workflows matter most.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=GT-ZK_3UG-A>

## Questions this post answers

### How can I generate Flyway migration scripts directly from JPA entity changes in IntelliJ IDEA?

IntelliJ IDEA offers a 'create Flyway diff changes' action on an entity that compares your model against the database and generates the migration SQL automatically. It detects safe changes like adding a new table in green, and for changes like column renames it can infer a merge/rename operation instead of a destructive drop-and-add, though it defaults to guessing unless you confirm the rename.

_Developers wiring up Flyway with Spring Data JPA can follow ongoing IntelliJ workflow coverage on daily.dev._

### How do you handle Flyway migration conflicts when two branches both add a migration with the same version number?

When two branches independently create the same next migration version (e.g., both add V4), the recommended approach is to compare database instances rather than migration files: generate a DB-to-DB diff between your branch's development database and the main branch's database, then produce a fresh migration from that comparison instead of manually reconciling the conflicting SQL files.

_Teams debugging Flyway version clashes across branches can track migration workflow tips on daily.dev._

### What is JPA Buddy and how does it relate to IntelliJ IDEA's built-in persistence tooling?

JPA Buddy is a JetBrains-adjacent IntelliJ plugin that originally implemented features like JPA entity generation and Flyway migration support through wizard-driven dialogs. Much of that functionality has since been migrated into IntelliJ IDEA itself using more fluent completions and commands, but MapStruct DTO generation and related completions/inspections still remain exclusive to the JPA Buddy plugin.

_Spring developers evaluating MapStruct tooling options can keep up with plugin-to-IDE feature migrations via daily.dev._

## Similar posts on daily.dev

- [Spring Data JDBC Made Easy with IntelliJ IDEA](https://daily.dev/posts/spring-data-jdbc-made-easy-with-intellij-idea-kqz5h1shs) · JetBrains · 0 upvotes · 0 comments
- [Reverse Engineering with Hibernate 7.4 and IntelliJ IDEA](https://daily.dev/posts/reverse-engineering-with-hibernate-7-4-and-intellij-idea-ftoyzdfii) · JetBrains · 0 upvotes · 0 comments
- [IntelliJ Series](https://daily.dev/posts/intellij-series-vetpyltcr) · Baeldung · 1 upvotes · 0 comments

---

Tags: [#devtools](https://daily.dev/tags/devtools), [#database](https://daily.dev/tags/database), [#spring](https://daily.dev/tags/spring)

[View this post on daily.dev](https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"DB-first Meets Code-first: Persistence Workflows in IntelliJ IDEA by Anton Arhipov @ Spring I/O 2026","url":"https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab"},"datePublished":"2026-09-27T07:26:29.661Z","dateModified":"2026-09-27T07:27:32.558Z","description":"A JetBrains engineer walks through a live IntelliJ IDEA demo covering database-first and code-first workflows for Spring persistence projects. Starting from a...","image":"https://i.ytimg.com/vi/GT-ZK_3UG-A/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/GT-ZK_3UG-A/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Spring I/O","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Spring I/O","logo":"https://media.daily.dev/image/upload/s--e-TcwM9B--/f_auto,q_auto/v1790493985/logos/springio?_a=BAMAMicg0","url":"https://daily.dev/sources/springio"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devtools,database,spring","timeRequired":"PT52M","video":{"@type":"VideoObject","name":"DB-first Meets Code-first: Persistence Workflows in IntelliJ IDEA by Anton Arhipov @ Spring I/O 2026","description":"A JetBrains engineer walks through a live IntelliJ IDEA demo covering database-first and code-first workflows for Spring persistence projects. Starting from a...","thumbnailUrl":"https://i.ytimg.com/vi/GT-ZK_3UG-A/sddefault.jpg","uploadDate":"2026-09-27T07:26:29.661Z","duration":"PT52M","url":"https://api.daily.dev/r/TyvIyd5AB","embedUrl":"https://www.youtube.com/embed/GT-ZK_3UG-A"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Spring I/O","item":"https://daily.dev/sources/springio"},{"@type":"ListItem","position":3,"name":"DB-first Meets Code-first: Persistence Workflows in IntelliJ IDEA by Anton Arhipov @ Spring I/O 2026"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/db-first-meets-code-first-persistence-workflows-in-intellij-idea-by-anton-arhipov-spring-i-o-2026-tyviyd5ab#faq","mainEntity":[{"@type":"Question","name":"How can I generate Flyway migration scripts directly from JPA entity changes in IntelliJ IDEA?","acceptedAnswer":{"@type":"Answer","text":"IntelliJ IDEA offers a 'create Flyway diff changes' action on an entity that compares your model against the database and generates the migration SQL automatically. It detects safe changes like adding a new table in green, and for changes like column renames it can infer a merge/rename operation instead of a destructive drop-and-add, though it defaults to guessing unless you confirm the rename. Developers wiring up Flyway with Spring Data JPA can follow ongoing IntelliJ workflow coverage on daily.dev."}},{"@type":"Question","name":"How do you handle Flyway migration conflicts when two branches both add a migration with the same version number?","acceptedAnswer":{"@type":"Answer","text":"When two branches independently create the same next migration version (e.g., both add V4), the recommended approach is to compare database instances rather than migration files: generate a DB-to-DB diff between your branch's development database and the main branch's database, then produce a fresh migration from that comparison instead of manually reconciling the conflicting SQL files. Teams debugging Flyway version clashes across branches can track migration workflow tips on daily.dev."}},{"@type":"Question","name":"What is JPA Buddy and how does it relate to IntelliJ IDEA's built-in persistence tooling?","acceptedAnswer":{"@type":"Answer","text":"JPA Buddy is a JetBrains-adjacent IntelliJ plugin that originally implemented features like JPA entity generation and Flyway migration support through wizard-driven dialogs. Much of that functionality has since been migrated into IntelliJ IDEA itself using more fluent completions and commands, but MapStruct DTO generation and related completions/inspections still remain exclusive to the JPA Buddy plugin. Spring developers evaluating MapStruct tooling options can keep up with plugin-to-IDE feature migrations via daily.dev."}}]}
```

