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

Composite Ids with JMolecule

Open
#2,327 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

JMolecule registers a converter for id types.
This makes them simple types for Spring Data JDBC, which disables treatment as Embedded types.

This issue surfaced after analyzing https://stackoverflow.com/questions/79902309/spring-data-jdbc-with-composite-id
for which there is a reproducer here: https://github.com/schauder/stackoverflow/tree/main/jdbc/composite-id-with-jmolecules

This issue doesn't aim to fix the problem described at SO directly, but the idea is to make @Embedded basically overwrite the registration as a simple type.
Then one could annotated embedded ids accordingly and resolve the issue.

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 with the linked composite-id-with-jmolecules reproducer and compare how JMolecule id converters are registered with how @Embedded is interpreted in Spring Data JDBC. Trace the simple-type and embedded-type handling, then verify that an explicitly embedded id takes precedence over the simple-type registration and resolves the reproducer without changing its direct scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.