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.
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
@ShallowReferenceon a field instead of a class. For example, this might look like thisRather than add
@ShallowReferenceto 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
@ShallowReferencewould 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@Relationshipannotation are shallow, that would work.I have a pull request I will add shortly, but I'm sure it will need work.