Skip to content

Do not delete mapped entities of an aggregate marked with @ReadOnlyProperty #1715

Closed as not planned
@hussainkarafallah

Description

@hussainkarafallah

So I have been using spring-data-jdbc for one of my applications

Basically I have a 1-1 relationship of a class let's call it this way

class Person{
   Long id;
   String name;
   @MappedCollection(idColumn = "person_id")
   @ReadOnlyProperty
   BirthDate birthdate;
}

What happened when I called repository.save(person) is that always the birthday is removed and inserted back.
Is this an intended design decision? This feature would make it repositories way more powerful.
I had a use case similar to flyweight pattern where I have big payloads that never change.
Is it possible for me to explore ways of adding such functionality? I will be very happy to contribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions