Annotation Type ExternalEntity


  • @Documented
    @Inherited
    @Retention(RUNTIME)
    @Target(TYPE)
    @MorphiaExperimental
    public @interface ExternalEntity
    Marks a class as a "stand in" for an external class whose source can not be properly annotated. A class annotated with this annotation will be processed like any class annotated with Entity however, the resulting information stored will reference the target type instead of the annotated type. In this way third party classes can be mapped properly in spite of not having access to the source. See the documentation for more detail.
    Since:
    2.3
    Developer note.
    This is an experimental item. Its function and presence are subject to change. Feedback on features and usability extremely welcome.
    • Element Detail

      • target

        Class<?> target
        The external target type being mapped.
        Returns:
        the external target type
      • cap

        CappedAt cap
        Returns:
        The capped collection configuration options
        Default:
        @dev.morphia.annotations.CappedAt(value=-1L, count=-1L)
      • concern

        String concern
        Returns:
        The default write concern to use when dealing with this entity
        Default:
        ""
      • discriminator

        String discriminator
        Returns:
        the discriminator value to use for this type.
        Default:
        "."
      • discriminatorKey

        String discriminatorKey
        Returns:
        the discriminator key to use for this type.
        Default:
        "."
      • useDiscriminator

        boolean useDiscriminator
        Returns:
        true if the discriminator for this type should be stored
        Default:
        true
      • value

        String value
        Returns:
        the collection name to for this entity. Defaults to the class's simple name
        See Also:
        Class.getSimpleName()
        Default:
        "."