1
votes

I have a Spring Data LDAP repository like this:

package x.y.z.repository;

import org.springframework.data.ldap.repository.LdapRepository;
import org.springframework.stereotype.Repository;

import x.y.z.domain.User;

@Repository
public interface UserRepository extends LdapRepository<User>{
    User findByUserId(String userId);
}

Unfortunately I have more than one LDAP connection in the spring context. How can I define which LDAPTemplate belongs to which Repository? I have not found anything in the documentation.

1
Hmm. ldap-template-ref is mentioned, however I cannot really find where it is to be defined. It seems to be an XML Config entry. Is it somehow possible with Java config? - Gábor Lipták

1 Answers

1
votes

So I figured out. In EnableLdapRepositories annotation it is possible to define the template reference.