spring-projects / spring-projects/spring-data-rest

@MappedSuperclass [DATAREST-28]

Open
#411 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

wims.tijd opened DATAREST-28 and commented

entity extending Abstract base class :
org.springframework.data.jpa.domain.AbstractPersistable

resolved by :

org.springframework.data.rest.webmvc.RepositoryRestController.entity
org.springframework.data.rest.webmvc.RepositoryRestController.linkedEntity

results in :

Provided id of the wrong type for class repository.domain.ColumnMetaData. Expected: class java.lang.Long, got class java.lang.String; nested exception is java.lang.IllegalArgumentException: Provided id of the wrong type for class repository.domain.ColumnMetaData. Expected: class java.lang.Long, got class java.lang.String


Affects: 1.0.0.RC1

Issue Links:

  • DATAREST-433 Inheritance of Id property from abstract base class causes NullPointerException

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 examining RepositoryRestController.entity and RepositoryRestController.linkedEntity, the locations named in the report. Reproduce the wrong-id-type error with an entity extending AbstractPersistable and inspect how the inherited identifier is handled. Done means mapped-superclass entities no longer produce the reported Long-versus-String error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.