Annotation Interface MongoId


MongoId represents a MongoDB specific Id annotation that allows customizing id conversion. Id properties use FieldType.IMPLICIT as the default id's target type. This means that the actual property value is used. No conversion attempts to any other type are made.
In contrast to @Id, String id's are stored as the such even when the actual value represents a valid ObjectId hex String. To trigger String to ObjectId conversion use @MongoId(FieldType.OBJECT_ID).
Since:
2.2
Author:
Christoph Strobl, Mark Paluch
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Get the preferred _id type to be used.