UnboundID LDAP SDK for Java

Ping Identity
Product Information
Using the LDAP SDK Persistence Framework

The @LDAPDNField and @LDAPEntryField Annotation Types

The @LDAPDNField annotation type may be used to mark at most one field in a Java class, and when initializing and instance of that class with information from an LDAP entry, the DN of that entry will be stored in that field. If a field is marked with this annotation type, then it must have a type of java.lang.String.

The @LDAPEntryField annotation type may be used to mark at most one field in a Java class, and when initializing an instance of that class with information from an LDAP entry, a read-only copy of that entry will be stored in that field. If a field is marked with this annotation type, then it must have a type of com.unboundid.ldap.sdk.ReadOnlyEntry.

Zero, one, or both of these annotation types may be used in any class marked with the @LDAPObject annotation type (although if a class contains a field marked with the @LDAPEntryField annotation type then the DN of the entry can be gotten from that, so there really isn't a need to also have a field marked with the @LDAPDNField annotation type). Neither field may be marked static or final, although they may have any access modifier, including public, private, protected, or the default of package-level access.

When attempting to modify or delete an entry retrieved using the LDAP SDK persistence framework, either of these fields may be used to obtain the DN of the target entry. In addition, when performing a modify operation, if the class contains a field marked with the @LDAPEntryField annotation type then that entry may be used to better identify the changes made to the object so that it can construct a more concise set of modifications.