spring-projects / spring-projects/spring-data-relational
Ability to override JdbcType
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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