Interface RelationDescriptor<S extends Relatable,T extends Relatable>

All Known Subinterfaces:
ValidatingRelationDescriptor<S,T>
All Known Implementing Classes:
AbstractRelationDescriptor, AuthenticatedUserRelationDescriptor, CollaboratorRelationDescriptor, CumulativeContributorRelationDescriptor, DefaultValidatingRelationDescriptor, FavouriteRelationDescriptor, LikeRelationDescriptor, NamedRelationDescriptor, TouchedRelationDescriptor

@ExperimentalSpi public interface RelationDescriptor<S extends Relatable,T extends Relatable>
Defines relation name, type and who may have such relations.

Please do implement ths interface directly, if you need to create your own relation please use AbstractRelationDescriptor or NamedRelationDescriptor

Since:
5.9
  • Method Details

    • getRelationName

      String getRelationName()
      Get relation name. Relation name should be unique per relation type. For example: "favouriteContentRelation", "watchRelation" etc.
      Returns:
      relation name.
    • getSourceClass

      Class<S> getSourceClass()
      Returns class of source entity of the relation. Source entity is always subclass of Relatable
      Returns:
      type of source entity
    • getTargetClass

      Class<T> getTargetClass()
      Returns class of target entity of the relation. Target entity is always subclass of Relatable
      Returns:
      type of target entity