spring-projects / spring-projects/spring-data-relational

Ability to override JdbcType

Open
#1,648 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
827
Forks
394
PR merge metrics
No merged PRs in 30d

Description

Just want to give yet another reason to support explicit JdbcType definition.

When implementing database agnostic onion/hexagonal architecture, we usually have 2 distinct models: domain and persistence. So port/adapter responsible for mapping between them. In the domain model we want to use rich java types (e.g. UUID), in the persistence model - more primitive types (e.g. String as common denominator). Some databases have UUID support, but not all of them. So it would be great to be able to override JdbcType for some fields of the persistence model (or arguments of repository methods) in per database/dialect manner.

Related issues: #746, #464

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading related issues #746 and #464, then inspect the existing Spring Data JDBC and R2DBC mapping paths for persistence-model fields, repository method arguments, and database dialects. Done means an explicit JdbcType can be selected per field or argument and overridden per database or dialect without preventing domain models from using richer Java types.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.