Annotation Type Entity


  • @Documented
    @Inherited
    @Retention(RUNTIME)
    @Target(TYPE)
    public @interface Entity
    Allows marking and naming the collectionName
    Author:
    Olafur Gauti Gudmundsson, Scott Hernandez
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      CappedAt cap  
      java.lang.String concern  
      boolean noClassnameStored
      Deprecated.
      to be replaced in 2.0 where the default will be to store the discriminator
      boolean queryNonPrimary
      Deprecated.
      no replacement is planned
      java.lang.String value  
    • Element Detail

      • cap

        CappedAt cap
        Returns:
        The capped collection configuration options
        Default:
        @dev.morphia.annotations.CappedAt(0L)
      • concern

        java.lang.String concern
        Returns:
        The default write concern to use when dealing with this entity
        Default:
        ""
      • noClassnameStored

        @Deprecated
        boolean noClassnameStored
        Deprecated.
        to be replaced in 2.0 where the default will be to store the discriminator
        Returns:
        When true, instructs Morphia to not include when serializing an entity to mongodb.
        Default:
        false
      • queryNonPrimary

        @Deprecated
        boolean queryNonPrimary
        Deprecated.
        no replacement is planned
        Returns:
        slaveOk for queries for this Entity.
        Default:
        false
      • value

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