Use
ShallowReference
to mark certain Entities as compared only by Id.
When
ShallowReference
is enabled for a given Entity,
all its properties (except idProperty) are ignored.
ShallowReference
annotation can be used both globally, on the class-level, for example:
@ShallowReference
class Entity {
@Id String id;
...
}
and locally, on the property-level, for example:
class Entity {
@Id String id;
...
}
class AnotherEntity {
@Id String id;
@ShallowReference Entity shallowReference;
@ShallowReference List<Entity> shallowReferences;
Entity regularReference;
...
}