Class RelationDescriptors


  • public final class RelationDescriptors
    extends Object
    Provides static helper methods for RelationDescriptor objects.
    Since:
    5.9
    See Also:
    RelationDescriptor
    • Constructor Detail

      • RelationDescriptors

        public RelationDescriptors()
    • Method Detail

      • lookupBuiltinOrCreate

        public static <S extends Relatable,​T extends RelatableRelationDescriptor<S,​T> lookupBuiltinOrCreate​(Class<S> sourceClass,
                                                                                                                          String name,
                                                                                                                          Class<T> targetClass)
        Get one of the built-in RelationDescriptor objects (for example FavouriteRelationDescriptor). If a built-in relationship doesn't exist for the relation name, create a new NamedRelationDescriptor.
        Parameters:
        sourceClass - The source type of the relationship
        name - The name of the relationship - this may be a built-in name or arbitrary name
        targetClass - The target type of the relationship
        Returns:
        The built-in or created RelationDescriptor object