// Path: src/main/java/ru/shadam/tarantool/repository/query/TarantoolQueryCreator.java
// public class TarantoolQueryCreator extends AbstractQueryCreator<KeyValueQuery<TarantoolQuery>, TarantoolQuery> {
// 
//     public TarantoolQueryCreator(PartTree tree, ParameterAccessor parameters) {
//         super(tree, parameters);
//     }
// 
//     @Override
//     protected TarantoolQuery create(Part part, Iterator<Object> iterator) {
//         switch (part.getType()) {
//             case SIMPLE_PROPERTY:
//                 return new TarantoolQuery(part.getProperty().toDotPath(), iterator.next());
//             default:
//                 throw new IllegalArgumentException(part.getType() + "is not supported for redis query derivation");
//         }
//     }
// 
//     @Override
//     protected TarantoolQuery and(Part part, TarantoolQuery base, Iterator<Object> iterator) {
//         throw new UnsupportedOperationException("and is not supported");
//     }
// 
//     @Override
//     protected TarantoolQuery or(TarantoolQuery base, TarantoolQuery criteria) {
//         throw new UnsupportedOperationException("or is not supported");
//     }
// 
//     @Override
//     protected KeyValueQuery<TarantoolQuery> complete(TarantoolQuery criteria, Sort sort) {
//         final KeyValueQuery<TarantoolQuery> tarantoolQueryKeyValueQuery = new KeyValueQuery<>(criteria);
//         tarantoolQueryKeyValueQuery.setSort(sort);
//         return tarantoolQueryKeyValueQuery;
//     }
// }
// 
// Path: src/main/java/ru/shadam/tarantool/repository/support/TarantoolRepositoryFactoryBean.java
// public class TarantoolRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable>
//         extends KeyValueRepositoryFactoryBean<T, S, ID> {
// 
//     /*
//      * (non-Javadoc)
//      * @see org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactoryBean#createRepositoryFactory(org.springframework.data.keyvalue.core.KeyValueOperations, java.lang.Class, java.lang.Class)
//      */
//     @Override
//     protected TarantoolRepositoryFactory createRepositoryFactory(
//             KeyValueOperations operations,
//             Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
//             Class<? extends RepositoryQuery> repositoryQueryType
//     ) {
//         return new TarantoolRepositoryFactory(operations, queryCreator, repositoryQueryType);
//     }
// }


import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.repository.config.QueryCreatorType;
import ru.shadam.tarantool.repository.query.TarantoolQueryCreator;
import ru.shadam.tarantool.repository.support.TarantoolRepositoryFactoryBean;
import java.lang.annotation.*;
package ru.shadam.tarantool.repository.configuration;



/**
 * @author sala
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import(TarantoolRepositoriesRegistrar.class)
@QueryCreatorType(TarantoolQueryCreator.class)
public @interface EnableTarantoolRepositories {
    /**
     * Alias for the {@link #basePackages()} attribute. Allows for more concise annotation declarations e.g.:
     * {@code @EnableRedisRepositories("org.my.pkg")} instead of
     * {@code @EnableRedisRepositories(basePackages="org.my.pkg")}.
     */
    String[] value() default {};

    /**
     * Base packages to scan for annotated components. {@link #value()} is an alias for (and mutually exclusive with) this
     * attribute. Use {@link #basePackageClasses()} for a type-safe alternative to String-based package names.
     */
    String[] basePackages() default {};

    /**
     * Type-safe alternative to {@link #basePackages()} for specifying the packages to scan for annotated components. The
     * package of each class specified will be scanned. Consider creating a special no-op marker class or interface in
     * each package that serves no purpose other than being referenced by this attribute.
     */
    Class<?>[] basePackageClasses() default {};

    /**
     * Specifies which types are not eligible for component scanning.
     */
    ComponentScan.Filter[] excludeFilters() default {};

    /**
     * Specifies which types are eligible for component scanning. Further narrows the set of candidate components from
     * everything in {@link #basePackages()} to everything in the base packages that matches the given filter or filters.
     */
    ComponentScan.Filter[] includeFilters() default {};

    /**
     * Returns the {@link FactoryBean} class to be used for each repository instance. Defaults to
     * {@link TarantoolRepositoryFactoryBean}.
     *
     * @return
     */
// Path: src/main/java/ru/shadam/tarantool/repository/query/TarantoolQueryCreator.java
// public class TarantoolQueryCreator extends AbstractQueryCreator<KeyValueQuery<TarantoolQuery>, TarantoolQuery> {
// 
//     public TarantoolQueryCreator(PartTree tree, ParameterAccessor parameters) {
//         super(tree, parameters);
//     }
// 
//     @Override
//     protected TarantoolQuery create(Part part, Iterator<Object> iterator) {
//         switch (part.getType()) {
//             case SIMPLE_PROPERTY:
//                 return new TarantoolQuery(part.getProperty().toDotPath(), iterator.next());
//             default:
//                 throw new IllegalArgumentException(part.getType() + "is not supported for redis query derivation");
//         }
//     }
// 
//     @Override
//     protected TarantoolQuery and(Part part, TarantoolQuery base, Iterator<Object> iterator) {
//         throw new UnsupportedOperationException("and is not supported");
//     }
// 
//     @Override
//     protected TarantoolQuery or(TarantoolQuery base, TarantoolQuery criteria) {
//         throw new UnsupportedOperationException("or is not supported");
//     }
// 
//     @Override
//     protected KeyValueQuery<TarantoolQuery> complete(TarantoolQuery criteria, Sort sort) {
//         final KeyValueQuery<TarantoolQuery> tarantoolQueryKeyValueQuery = new KeyValueQuery<>(criteria);
//         tarantoolQueryKeyValueQuery.setSort(sort);
//         return tarantoolQueryKeyValueQuery;
//     }
// }
// 
// Path: src/main/java/ru/shadam/tarantool/repository/support/TarantoolRepositoryFactoryBean.java
// public class TarantoolRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable>
//         extends KeyValueRepositoryFactoryBean<T, S, ID> {
// 
//     /*
//      * (non-Javadoc)
//      * @see org.springframework.data.keyvalue.repository.support.KeyValueRepositoryFactoryBean#createRepositoryFactory(org.springframework.data.keyvalue.core.KeyValueOperations, java.lang.Class, java.lang.Class)
//      */
//     @Override
//     protected TarantoolRepositoryFactory createRepositoryFactory(
//             KeyValueOperations operations,
//             Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
//             Class<? extends RepositoryQuery> repositoryQueryType
//     ) {
//         return new TarantoolRepositoryFactory(operations, queryCreator, repositoryQueryType);
//     }
// }


// Path: src/main/java/ru/shadam/tarantool/repository/configuration/EnableTarantoolRepositories.java
import org.springframework.beans.factory.FactoryBean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.keyvalue.repository.config.QueryCreatorType;
import ru.shadam.tarantool.repository.query.TarantoolQueryCreator;
import ru.shadam.tarantool.repository.support.TarantoolRepositoryFactoryBean;
import java.lang.annotation.*;

package ru.shadam.tarantool.repository.configuration;



/**
 * @author sala
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@Import(TarantoolRepositoriesRegistrar.class)
@QueryCreatorType(TarantoolQueryCreator.class)
public @interface EnableTarantoolRepositories {
    /**
     * Alias for the {@link #basePackages()} attribute. Allows for more concise annotation declarations e.g.:
     * {@code @EnableRedisRepositories("org.my.pkg")} instead of
     * {@code @EnableRedisRepositories(basePackages="org.my.pkg")}.
     */
    String[] value() default {};

    /**
     * Base packages to scan for annotated components. {@link #value()} is an alias for (and mutually exclusive with) this
     * attribute. Use {@link #basePackageClasses()} for a type-safe alternative to String-based package names.
     */
    String[] basePackages() default {};

    /**
     * Type-safe alternative to {@link #basePackages()} for specifying the packages to scan for annotated components. The
     * package of each class specified will be scanned. Consider creating a special no-op marker class or interface in
     * each package that serves no purpose other than being referenced by this attribute.
     */
    Class<?>[] basePackageClasses() default {};

    /**
     * Specifies which types are not eligible for component scanning.
     */
    ComponentScan.Filter[] excludeFilters() default {};

    /**
     * Specifies which types are eligible for component scanning. Further narrows the set of candidate components from
     * everything in {@link #basePackages()} to everything in the base packages that matches the given filter or filters.
     */
    ComponentScan.Filter[] includeFilters() default {};

    /**
     * Returns the {@link FactoryBean} class to be used for each repository instance. Defaults to
     * {@link TarantoolRepositoryFactoryBean}.
     *
     * @return
     */
    Class<?> repositoryFactoryBeanClass() default TarantoolRepositoryFactoryBean.class;