spring-ldap icon indicating copy to clipboard operation
spring-ldap copied to clipboard

spring-data-ldap @DnAttribute value is not work

Open chc123456 opened this issue 7 years ago • 5 comments
trafficstars

Setting “value” has no effect, when I set the value like @DnAttribute(value = "ou", index = 3) this is not index by "ou" attribute.It works the whole "dn"

chc123456 avatar Aug 16 '18 12:08 chc123456

@chc123456 Thank you for the report! Would you be able to submit an example or a PR with a test to fix it?

rwinch avatar Aug 16 '18 14:08 rwinch

Use user-admin-sample data like

dn: cn=Some Dude,ou=Development,ou=IT,ou=Departments,dc=example,dc=com

Entity Like

    @DnAttribute(value = "ou", index = 3)
    @Transient
    private String unit;

    @DnAttribute(value = "ou", index = 2)
    @Transient
    private String department;

Change Index Number.

   @DnAttribute(value = "ou", index = 5)
    @Transient
    private String department;

getDepartment() value is “Some Dude”

chc123456 avatar Aug 16 '18 23:08 chc123456

Any chance you can provide a complete sample? If you are able to, this will greatly speed up the ability for me to respond since I have lots of other users asking for help.

rwinch avatar Aug 17 '18 14:08 rwinch

@rwinch
https://github.com/chc123456/springboot-ldap-simple

chc123456 avatar Aug 22 '18 02:08 chc123456

Thanks for the sample @chc123456 I have added this to my queue

rwinch avatar Aug 22 '18 14:08 rwinch