diff --git a/core/src/main/java/org/springframework/ldap/odm/annotations/DnAttribute.java b/core/src/main/java/org/springframework/ldap/odm/annotations/DnAttribute.java
index def495ab50..c5dddc2aaa 100644
--- a/core/src/main/java/org/springframework/ldap/odm/annotations/DnAttribute.java
+++ b/core/src/main/java/org/springframework/ldap/odm/annotations/DnAttribute.java
@@ -24,7 +24,7 @@
/**
* Indicates that a field is to be automatically populated to/from the distinguished name
* of an entry. Fields annotated with this annotation will be automatically populated with values from
- * the distinguished names of found entries.
+ * the distinguished names of found entries. Annotated fields must be of type String
.
*
* For automatic calculation of the DN of an entry to work, the {@link #index()} value * must be specified on all DnAttribute annotations in that class, and these attribute values, diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc index d7163fab5c..308b4fbbcf 100644 --- a/src/docs/asciidoc/index.adoc +++ b/src/docs/asciidoc/index.adoc @@ -1021,6 +1021,7 @@ The `@Attribute` annotation is used to map object class fields to entity fields. The `@DnAttribute` annotation is used to map object class fields to and from components in the distinguished name of an entry. Fields annotated with `@DnAttribute` will automatically be populated with the appropriate value from the distinguished name when an entry is read from the directory tree. +Only fields of type `String` can be annotated with `@DnAttribute`, other types are not supported. If the `index` attribute of all `@DnAttribute` annotations in a class is specified, the DN will also be automatically calculated when creating and updating entries. For update scenarios, this will also automatically take care of moving entries in the tree if attributes that are part of the distinguished name have changed.