Skip to content

Commit 81604a8

Browse files
edyslirwinch
authored andcommitted
Document that @DnAttribute only works on String fields
Fixes #499.
1 parent e32379a commit 81604a8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

core/src/main/java/org/springframework/ldap/odm/annotations/DnAttribute.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* Indicates that a field is to be automatically populated to/from the distinguished name
2626
* of an entry. Fields annotated with this annotation will be automatically populated with values from
27-
* the distinguished names of found entries.
27+
* the distinguished names of found entries. Annotated fields must be of type <code>String</code>.
2828
* <p>
2929
* For automatic calculation of the DN of an entry to work, the {@link #index()} value
3030
* must be specified on all DnAttribute annotations in that class, and these attribute values,

src/docs/asciidoc/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,7 @@ The `@Attribute` annotation is used to map object class fields to entity fields.
10211021

10221022
The `@DnAttribute` annotation is used to map object class fields to and from components in the distinguished name of an entry.
10231023
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.
1024+
Only fields of type `String` can be annotated with `@DnAttribute`, other types are not supported.
10241025
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.
10251026
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.
10261027

0 commit comments

Comments
 (0)