Skip to content

Set properties as shallow references via EntityDefinitionBuilder #1306

Closed
@cberes

Description

@cberes

Hi there, I have a feature request. It would be helpful for us if we could set properties as shallow references via EntityDefinitionBuilder. Similar to placing @ShallowReference on a field instead of a class. For example, this might look like this

EntityDefinitionBuilder.entityDefinition(Student.class)
    .withIdPropertyName("id")
    .withShallowProperties(List.of("professor", "school"))
    .build()

Rather than add @ShallowReference to many fields in many entities, configuring this via EntityDefinitionBuilder would take only a few lines.

As as an alternative, some way to substitute our own annotation for @ShallowReference would work. For example, we want all relationships between entity classes to be shallow. So if there was some way to tell Javers that all fields with our own @Relationship annotation are shallow, that would work.

I have a pull request I will add shortly, but I'm sure it will need work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions