Annotations

Entity classes managed by the OdmManager are required to be annotated with the annotations in the org.springframework.ldap.odm.annotations package. The available annotations are:

The @Entry and @Id attributes are required to be declared on managed classes. @Entry is used to specify which object classes the entity maps too. All object classes for which fields are mapped are required to be declared. Also, in order for a directory entry to be considered a match to the managed entity, all object classes declared by the directory entry must match be declared by in the @Entry annotation.

The @Id annotation is used to map the distinguished name of the entry to a field. The field must be an instance of javax.naming.Name or a subclass of it.

The @Attribute annotation is used to map object class fields to entity fields. @Attribute is required to declare the name of the object class property to which the field maps and may optionally declare the syntax OID of the LDAP attribute, to guarantee exact matching. @Attribute also provides the type declaration which allows you to indicate whether the attribute is regarded as binary based or string based by the LDAP JNDI provider.

The @Transient annotation is used to indicate the field should be ignored by the OdmManager and not mapped to an underlying LDAP property.