我有一个Spring Data LDAP存储库,如下所示:
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);
}
不幸的是,我在spring上下文中有多个LDAP连接。我怎样才能定义哪个LDAPTemplate
属于哪个Repository
?我没有在documentation找到任何东西。
所以我想通了。在EnableLdapRepositories注释中,可以定义template reference。