anchor.diff:  
   The `@Transient` annotation is used to indicate the field should be ignored by the object directory mapping and not mapped to an underlying LDAP property. Note that if a `@DnAttribute` is not to be bound to an Attribute, i.e. it is only part of the Distinguished Name and not represented by an object attibute, it must also be annotated with `@Transient`.
   
  -=== Type Conversion
  -
  -The object directory mapping relies on the `org.springframework.ldap.odm.typeconversion` package to convert LDAP attributes to Java fields. For simple setups, no particular configuraion is needed for this purpose. However, more complex mapping scenarios require the `ObjectDirectoryMapper` and its associated `ConverterManager` to be explicitly configured on the `LdapTemplate` instance. The default `ConverterManager` implementation uses the following algorithm when parsing objects to convert fields:
  -
  -. Try to find and use a `Converter` registered for the `fromClass`, `syntax` and `toClass` and use it.
  -. If this fails, then if the `toClass``isAssignableFrom` the `fromClass` then just assign it.
  -. If this fails try to find and use a `Converter` registered for the `fromClass` and the `toClass` ignoring the syntax.
  -. If this fails then throw a `ConverterException`.
  -
  -
  -
  -Implementations of the `ConverterManager` interface can be obtained from the `o.s.l.odm.typeconversion.impl.ConvertManagerFactoryBean`. The factory bean requires converter configurations to be declared in the bean configuration.
  -
  -The converterConfig property accepts a set of `ConverterConfig` classes, each one defining some conversion logic. A converter config is an instance of `o.s.l.odm.typeconversion.impl.ConverterManagerFactoryBean.ConverterConfig`. The config defines a set of source classes, the set of target classes, and an implementation of the `org.springframework.ldap.odm.typeconversion.impl.Converter` interface which provides the logic to convert from the `fromClass` to the `toClass`. A sample configuration is provided in the following example:
  -
  -.Configuring the Converter Manager Factory
  -[source,xml]
  -[subs="verbatim,quotes"]
  -----
  -<bean id="fromStringConverter"
  -   class="org.springframework.ldap.odm.typeconversion.impl.converters.FromStringConverter" />
  -<bean id="toStringConverter"
  -   class="org.springframework.ldap.odm.typeconversion.impl.converters.ToStringConverter" />
  -<bean id="converterManager"
  -   class="org.springframework.ldap.odm.typeconversion.impl.ConverterManagerFactoryBean">
  -   <property name="converterConfig">
  -      <set>
  -      <bean class="org.springframework.ldap.odm.typeconversion.impl.ConverterManagerFactoryBean$ConverterConfig">
  -            <property name="fromClasses">
  -               <set>
  -                  <value>java.lang.String</value>
  -               </set>
  -            </property>
  -            <property name="toClasses">
  -               <set>
  -                  <value>java.lang.Byte</value>
  -                  <value>java.lang.Short</value>
  -                  <value>java.lang.Integer</value>
  -                  <value>java.lang.Long</value>
  -                  <value>java.lang.Float</value>
  -                  <value>java.lang.Double</value>
  -                  <value>java.lang.Boolean</value>
  -               </set>
  -            </property>
  -            <property name="converter" ref="fromStringConverter" />
  -         </bean>
  -         <bean class="org.springframework.ldap.odm.typeconversion.impl.ConverterManagerFactoryBean$ConverterConfig">
  -            <property name="fromClasses">
  -               <set>
  -                  <value>java.lang.Byte</value>
  -                  <value>java.lang.Short</value>
  -                  <value>java.lang.Integer</value>
  -                  <value>java.lang.Long</value>
  -                  <value>java.lang.Float</value>
  -                  <value>java.lang.Double</value>
  -                  <value>java.lang.Boolean</value>
  -               </set>
  -            </property>
  -            <property name="toClasses">
  -               <set>
  -                  <value>java.lang.String</value>
  -               </set>
  -            </property>
  -            <property name="converter" ref="toStringConverter" />
  -         </bean>
  -      </set>
  -   </property>
  -</bean>
  -
  -<ldap:ldap-template id="ldapTemplate" odm-ref="odm" />
  -<bean id="odm" class="org.springframework.ldap.odm.impl.DefaultObjectDirectoryMapper">
  -   <property name="converterManager" ref="converterManager" />
  -</bean>
  -----
  -
  -
   
   === Execution
   When all components have been properly configured and annotated, the object mapping methods of `LdapTemplate` can be used as follows:
  
positive.code: }
  ----
  
  
  
  === A Complete PersonDao Class
  To illustrate the power of Spring LDAP, here is a complete Person DAO implementation for LDAP in just 68 lines:
  
negative.code:       return ldapTemplate.findAll(Person.class);
     }
  
     public List<Person> findByLastName(String lastName) {
        return ldapTemplate.find(query().where("sn").is(lastName), Person.class);
     }
  }
  ----
  
  
  [[odm-dn-attributes]]
  === ODM and Distinguished Names as Attribute Values.
  
  Security groups in LDAP commonly contains a multi-value attribute where each of the values is the distinguished name
  of a user in the system. The difficulties involved when handling these kinds of attributes are discussed in <<dns-as-attribute-values>>.
  
  ODM also has support for `javax.naming.Name` attribute values, making group modifications very easy:
  
  .Example Group representation
  [source,java]
  [subs="verbatim,quotes"]
  ----
  @Entry(objectClasses = {"top", "groupOfUniqueNames"}, base = "cn=groups")
  public class Group {
  
      @Id
      private Name dn;
  
      @Attribute(name="cn")
      @DnAttribute("cn")
      private String name;
  
      @Attribute(name="uniqueMember")
      private Set<Name> members;
  
      public Name getDn() {
          return dn;
      }
  
      public void setDn(Name dn) {
          this.dn = dn;
      }
  
      public Set<Name> getMembers() {
          return members;
      }
  
      public void setMembers(Set<Name> members) {
          this.members = members;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public void addMember(Name member) {
          members.add(member);
      }
  
      public void removeMember(Name member) {
          members.remove(member);
      }
  }
  ----
  
  Modifying group members using `setMembers`, `addMember` and `removeMember` above, and then calling `ldapTemplate.update()`,
  attribute modifications will be calculated using distinguished name equality, meaning that the text formatting of
  distinguished names will be disregarded when figuring out whether they are equal.
  
  [[query-builder-advanced]]
  == Advanced LDAP Queries
  