我有一个像这样的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);
}
不幸的是,我在春季上下文中有多个 LDAP 连接。如何定义哪个LDAPTemplate
属于哪个Repository
?我在文档中没有找到任何内容。
所以我想通了。在 EnableLdapRepository 注释中,可以定义模板引用。