diff --git a/redis-om-spring/src/main/java/com/redis/om/spring/repository/support/RedisEnhancedRepositoryFactoryBean.java b/redis-om-spring/src/main/java/com/redis/om/spring/repository/support/RedisEnhancedRepositoryFactoryBean.java index a9a0508c..da66dcf6 100644 --- a/redis-om-spring/src/main/java/com/redis/om/spring/repository/support/RedisEnhancedRepositoryFactoryBean.java +++ b/redis-om-spring/src/main/java/com/redis/om/spring/repository/support/RedisEnhancedRepositoryFactoryBean.java @@ -5,6 +5,7 @@ import com.redis.om.spring.ops.RedisModulesOperations; import com.redis.om.spring.repository.query.RedisEnhancedQuery; import com.redis.om.spring.vectorize.Embedder; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.keyvalue.core.KeyValueOperations; import org.springframework.data.keyvalue.repository.config.QueryCreatorType; import org.springframework.data.mapping.context.MappingContext; @@ -21,38 +22,30 @@ public class RedisEnhancedRepositoryFactoryBean, S, ID> extends RepositoryFactoryBeanSupport { - private @Nullable KeyValueOperations operations; + @Autowired private @Nullable RedisModulesOperations rmo; + @Autowired private @Nullable RedisOperations redisOperations; + @Autowired private @Nullable RediSearchIndexer indexer; - private @Nullable Class> queryCreator; - private @Nullable Class repositoryQueryType; + @Autowired private @Nullable Embedder embedder; - + @Autowired private RedisOMProperties properties; + private @Nullable KeyValueOperations operations; + private @Nullable Class> queryCreator; + private @Nullable Class repositoryQueryType; + /** * Creates a new {@link RedisRepositoryFactoryBean} for the given repository * interface. * * @param repositoryInterface must not be {@literal null}. - * @param redisOperations must not be {@literal null}. - * @param rmo must not be {@literal null}. - * @param indexer must not be {@literal null}. */ public RedisEnhancedRepositoryFactoryBean( // - Class repositoryInterface, // - RedisOperations redisOperations, // - RedisModulesOperations rmo, // - RediSearchIndexer indexer, // - Embedder embedder, // - RedisOMProperties properties) { + Class repositoryInterface) { super(repositoryInterface); - setRedisModulesOperations(rmo); - setRedisOperations(redisOperations); - setKeyspaceToIndexMap(indexer); - setFeatureExtractor(embedder); - setRedisOMSpringProperties(properties); } private void setFeatureExtractor(Embedder embedder) {