Java Code Examples for org.springframework.data.projection.ProjectionFactory

The following examples show how to use org.springframework.data.projection.ProjectionFactory. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: sdn-rx   Source File: ReactiveNeo4jQueryMethod.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link ReactiveNeo4jQueryMethod} from the given parameters.
 *
 * @param method   must not be {@literal null}.
 * @param metadata must not be {@literal null}.
 * @param factory  must not be {@literal null}.
 */
ReactiveNeo4jQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) {
	super(method, metadata, factory);

	if (hasParameterOfType(method, Pageable.class)) {

		TypeInformation<?> returnType = ClassTypeInformation.fromReturnTypeOf(method);

		boolean multiWrapper = ReactiveWrappers.isMultiValueType(returnType.getType());
		boolean singleWrapperWithWrappedPageableResult = ReactiveWrappers.isSingleValueType(returnType.getType())
			&& (PAGE_TYPE.isAssignableFrom(returnType.getRequiredComponentType())
			|| SLICE_TYPE.isAssignableFrom(returnType.getRequiredComponentType()));

		if (singleWrapperWithWrappedPageableResult) {
			throw new InvalidDataAccessApiUsageException(
				String.format("'%s.%s' must not use sliced or paged execution. Please use Flux.buffer(size, skip).",
					ClassUtils.getShortName(method.getDeclaringClass()), method.getName()));
		}

		if (!multiWrapper) {
			throw new IllegalStateException(String.format(
				"Method has to use a multi-item reactive wrapper return type. Offending method: %s",
				method.toString()));
		}
	}
}
 
Example 2
Source Project: sdn-rx   Source File: Neo4jQueryLookupStrategy.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, ProjectionFactory factory,
	NamedQueries namedQueries) {

	Neo4jQueryMethod queryMethod = new Neo4jQueryMethod(method, metadata, factory);
	String namedQueryName = queryMethod.getNamedQueryName();

	if (namedQueries.hasQuery(namedQueryName)) {
		return StringBasedNeo4jQuery.create(neo4jOperations, mappingContext, evaluationContextProvider, queryMethod,
			namedQueries.getQuery(namedQueryName));
	} else if (queryMethod.hasQueryAnnotation()) {
		return StringBasedNeo4jQuery.create(neo4jOperations, mappingContext, evaluationContextProvider, queryMethod);
	} else {
		return PartTreeNeo4jQuery.create(neo4jOperations, mappingContext, queryMethod);
	}
}
 
Example 3
Source Project: sdn-rx   Source File: ReactiveNeo4jQueryLookupStrategy.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, ProjectionFactory factory,
	NamedQueries namedQueries) {

	Neo4jQueryMethod queryMethod = new ReactiveNeo4jQueryMethod(method, metadata, factory);
	String namedQueryName = queryMethod.getNamedQueryName();

	if (namedQueries.hasQuery(namedQueryName)) {
		return ReactiveStringBasedNeo4jQuery
			.create(neo4jOperations, mappingContext, evaluationContextProvider, queryMethod,
			namedQueries.getQuery(namedQueryName));
	} else if (queryMethod.hasQueryAnnotation()) {
		return ReactiveStringBasedNeo4jQuery
			.create(neo4jOperations, mappingContext, evaluationContextProvider, queryMethod);
	} else {
		return ReactivePartTreeNeo4jQuery.create(neo4jOperations, mappingContext, queryMethod);
	}
}
 
Example 4
Source Project: spring-data   Source File: ArangoRepositoryFactory.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public RepositoryQuery resolveQuery(
	final Method method,
	final RepositoryMetadata metadata,
	final ProjectionFactory factory,
	final NamedQueries namedQueries) {

	final ArangoQueryMethod queryMethod = new ArangoQueryMethod(method, metadata, factory);
	final String namedQueryName = queryMethod.getNamedQueryName();

	if (namedQueries.hasQuery(namedQueryName)) {
		final String namedQuery = namedQueries.getQuery(namedQueryName);
		return new StringBasedArangoQuery(namedQuery, queryMethod, operations);
	} else if (queryMethod.hasAnnotatedQuery()) {
		return new StringBasedArangoQuery(queryMethod, operations);
	} else {
		return new DerivedArangoQuery(queryMethod, operations);
	}
}
 
Example 5
private PartTreeDatastoreQuery<Trade> createQuery(boolean isPageQuery, boolean isSliceQuery,
		ProjectionInformation projectionInformation) {
	ProjectionFactory projectionFactory = mock(ProjectionFactory.class);
	doReturn(projectionInformation != null ? projectionInformation : getProjectionInformationMock()).when(projectionFactory).getProjectionInformation(any());

	PartTreeDatastoreQuery<Trade> tradePartTreeDatastoreQuery = new PartTreeDatastoreQuery<>(this.queryMethod,
			this.datastoreTemplate,
			this.datastoreMappingContext, Trade.class, projectionFactory);
	PartTreeDatastoreQuery<Trade> spy = spy(tradePartTreeDatastoreQuery);
	doReturn(isPageQuery).when(spy).isPageQuery();
	doReturn(isSliceQuery).when(spy).isSliceQuery();
	doAnswer((invocation) -> invocation.getArguments()[0]).when(spy).processRawObjectForProjection(any());
	doAnswer((invocation) -> invocation.getArguments()[0]).when(spy).convertResultCollection(any(), isNotNull());

	return spy;
}
 
Example 6
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata,
		ProjectionFactory factory, NamedQueries namedQueries) {
	SpannerQueryMethod queryMethod = createQueryMethod(method, metadata, factory);
	Class<?> entityType = getEntityType(queryMethod);
	boolean isDml = queryMethod.getQueryAnnotation() != null && queryMethod.getQueryAnnotation().dmlStatement();

	if (queryMethod.hasAnnotatedQuery()) {
		Query query = queryMethod.getQueryAnnotation();
		return createSqlSpannerQuery(entityType, queryMethod, query.value(), isDml);
	}
	else if (namedQueries.hasQuery(queryMethod.getNamedQueryName())) {
		String sql = namedQueries.getQuery(queryMethod.getNamedQueryName());
		return createSqlSpannerQuery(entityType, queryMethod, sql, isDml);
	}

	return createPartTreeSpannerQuery(entityType, queryMethod);
}
 
Example 7
Source Project: spring-data-mybatis   Source File: MybatisQueryMethod.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new {@link QueryMethod} from the given parameters. Looks up the correct
 * query to use for following invocations of the method given.
 * @param method must not be {@literal null}.
 * @param metadata must not be {@literal null}.
 * @param factory must not be {@literal null}.
 */
public MybatisQueryMethod(Method method, RepositoryMetadata metadata,
		ProjectionFactory factory) {

	super(method, metadata, factory);

	Assert.notNull(method, "Method must not be null!");

	this.method = method;

	Assert.isTrue(!(isModifyingQuery() && getParameters().hasSpecialParameter()),
			String.format("Modifying method must not contain %s!", Parameters.TYPES));

	this.metadata = metadata;
	String namespace = getAnnotationValue("namespace", String.class);
	String statementName = getAnnotationValue("statement", String.class);
	this.namespace = StringUtils.hasText(namespace) ? namespace
			: metadata.getRepositoryInterface().getName();
	this.statementName = StringUtils.hasText(statementName) ? statementName
			: (method.getName() + UUID.randomUUID().toString().replace("-", ""));

}
 
Example 8
@Override
@SuppressWarnings("unchecked")
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, ProjectionFactory factory,
		NamedQueries namedQueries) {

	QueryMethod queryMethod = new QueryMethod(method, metadata, factory);

	Constructor<? extends KeyValuePartTreeQuery> constructor = (Constructor<? extends KeyValuePartTreeQuery>) ClassUtils
			.getConstructorIfAvailable(this.repositoryQueryType, QueryMethod.class,
					QueryMethodEvaluationContextProvider.class, KeyValueOperations.class, Class.class);

	Assert.state(constructor != null,
			String.format(
					"Constructor %s(QueryMethod, EvaluationContextProvider, KeyValueOperations, Class) not available!",
					ClassUtils.getShortName(this.repositoryQueryType)));

	return BeanUtils.instantiateClass(constructor, queryMethod, evaluationContextProvider, this.keyValueOperations,
			this.queryCreator);
}
 
Example 9
Source Project: spring-data-cosmosdb   Source File: CosmosRepositoryFactory.java    License: MIT License 5 votes vote down vote up
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata,
                                    ProjectionFactory factory, NamedQueries namedQueries) {
    final CosmosQueryMethod queryMethod = new CosmosQueryMethod(method, metadata, factory);

    Assert.notNull(queryMethod, "queryMethod must not be null!");
    Assert.notNull(dbOperations, "dbOperations must not be null!");
    return new PartTreeCosmosQuery(queryMethod, dbOperations);

}
 
Example 10
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata,
                                    ProjectionFactory factory, NamedQueries namedQueries) {
    final ReactiveCosmosQueryMethod queryMethod = new ReactiveCosmosQueryMethod(method,
        metadata, factory);

    Assert.notNull(queryMethod, "queryMethod must not be null!");
    Assert.notNull(cosmosOperations, "dbOperations must not be null!");
    return new PartTreeReactiveCosmosQuery(queryMethod, cosmosOperations);

}
 
Example 11
Source Project: spring-cloud-gcp   Source File: PartTreeDatastoreQuery.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Constructor.
 * @param queryMethod the metadata for this query method.
 * @param datastoreTemplate used to execute the given query.
 * @param datastoreMappingContext used to provide metadata for mapping results to objects.
 * @param entityType the result domain type.
 * @param projectionFactory the projection factory that is used to get projection information.
 */
public PartTreeDatastoreQuery(DatastoreQueryMethod queryMethod,
							DatastoreOperations datastoreTemplate,
		DatastoreMappingContext datastoreMappingContext, Class<T> entityType, ProjectionFactory projectionFactory) {
	super(queryMethod, datastoreTemplate, datastoreMappingContext, entityType);
	this.tree = new PartTree(queryMethod.getName(), entityType);
	this.datastorePersistentEntity = this.datastoreMappingContext
			.getPersistentEntity(this.entityType);

	this.projectionFactory = projectionFactory;
	validateAndSetFilterParts();
}
 
Example 12
Source Project: spring-cloud-gcp   Source File: SpannerQueryMethod.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new {@link QueryMethod} from the given parameters. Looks up the correct
 * query to use for following invocations of the method given.
 *
 * @param method must not be {@literal null}.
 * @param metadata must not be {@literal null}.
 * @param factory must not be {@literal null}.
 * @param mappingContext the mapping context to use.
 */
public SpannerQueryMethod(Method method, RepositoryMetadata metadata,
		ProjectionFactory factory,
		MappingContext<? extends SpannerPersistentEntity<?>,
				SpannerPersistentProperty> mappingContext) {
	super(method, metadata, factory);

	Assert.notNull(mappingContext, "MappingContext must not be null!");

	this.method = method;
	this.mappingContext = mappingContext;
}
 
Example 13
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata repositoryMetadata,
		ProjectionFactory projectionFactory, NamedQueries namedQueries) {
	// In this method we usually decide if the query method is a PartTree or an annotated
	// @Query method.
	// There is no choice in Firestore. We only have PartTree.
	return new PartTreeFirestoreQuery(
			new FirestoreQueryMethod(method, repositoryMetadata, projectionFactory),
			this.firestoreTemplate,
			this.firestoreTemplate.getMappingContext(),
			this.firestoreTemplate.getClassMapper()
	);
}
 
Example 14
Source Project: spring-data-ebean   Source File: EbeanQueryMethod.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a {@link EbeanQueryMethod}.
 *
 * @param method   must not be {@literal null}
 * @param metadata must not be {@literal null}
 */
public EbeanQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) {
    super(method, metadata, factory);

    Assert.notNull(method, "Method must not be null!");

    this.method = method;
}
 
Example 15
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, ProjectionFactory factory,
                                    NamedQueries namedQueries) {
    if (method.getAnnotation(TemplateQuery.class) == null) {
        return jpaQueryLookupStrategy.resolveQuery(method, metadata, factory, namedQueries);
    } else {
        return new FreemarkerTemplateQuery(new JpaQueryMethod(method, metadata, factory, extractor), entityManager);
    }
}
 
Example 16
/**
 * Creates a new {@link AbstractMongoQuery} from the given {@link MongoQueryMethod} and {@link MongoOperations}.
 *
 * @param method must not be {@literal null}.
 * @param projectionFactory - the projection factory
 */
@Autowired
public AggregateMongoQuery(Method method, RepositoryMetadata metadata, MongoOperations mongoOperations,
                           ProjectionFactory projectionFactory, MongoQueryExecutor queryExecutor) {
  super(new MongoQueryMethod(method, metadata, projectionFactory, mongoOperations.getConverter().getMappingContext()),
        mongoOperations);
  this.mongoOperations = mongoOperations;
  this.method = method;
  this.queryExecutor = queryExecutor;
}
 
Example 17
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata repositoryMetadata,
                                    ProjectionFactory projectionFactory, NamedQueries namedQueries) {
  if (!isAggregateQueryAnnotated(method)) {
    return parentQueryLookupStrategy.resolveQuery(method, repositoryMetadata, projectionFactory, namedQueries);
  }
  else {
    return new AggregateMongoQuery(method, repositoryMetadata, mongoOperations, projectionFactory, queryExecutor);
  }
}
 
Example 18
@Test(dataProvider = "queryMethods", expectedExceptions = {JsonParseException.class})
public void testCreateAggregateQuery(String methodName) throws Exception {
  AggregateQuerySupportingRepositoryFactory factory = new AggregateQuerySupportingRepositoryFactory(mongoOperations,
                                                                                                    queryExecutor);
  QueryLookupStrategy lookupStrategy = factory.getQueryLookupStrategy(CREATE_IF_NOT_FOUND, evaluationContextProvider);

  Method method = TestAggregateRepository22.class.getMethod(methodName);
  RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(TestAggregateRepository22.class);
  ProjectionFactory projectionFactory = new SpelAwareProxyProjectionFactory();
  RepositoryQuery query = lookupStrategy.resolveQuery(method, repositoryMetadata, projectionFactory, null);
  assertNotNull(query);
  Object object = query.execute(new Object[0]);
  assertNull(object);
}
 
Example 19
/**
 * Creates a new {@link AbstractMongoQuery} from the given {@link MongoQueryMethod} and {@link MongoOperations}.
 *
 * @param method must not be {@literal null}.
 * @param projectionFactory - the projection factory
 */
@Autowired
public NonReactiveAggregateMongoQuery(Method method, RepositoryMetadata metadata, MongoOperations mongoOperations,
                                      ProjectionFactory projectionFactory, MongoQueryExecutor queryExecutor) {
  super(new MongoQueryMethod(method, metadata, projectionFactory, mongoOperations.getConverter().getMappingContext()),
        mongoOperations,
        new SpelExpressionParser(),
        CONTEXT_PROVIDER);
  this.mongoOperations = mongoOperations;
  this.method = method;
  this.queryExecutor = queryExecutor;
}
 
Example 20
/**
 * Creates a new {@link AbstractMongoQuery} from the given {@link MongoQueryMethod} and {@link MongoOperations}.
 *
 * @param method must not be {@literal null}.
 * @param projectionFactory - the projection factory
 */
@Autowired
public ReactiveAggregateMongoQuery(Method method, RepositoryMetadata metadata, ReactiveMongoOperations mongoOperations,
                                   ProjectionFactory projectionFactory, MongoQueryExecutor queryExecutor) {
  super(new ReactiveMongoQueryMethod(method, metadata, projectionFactory,
                                     mongoOperations.getConverter().getMappingContext()),
        mongoOperations,
        new SpelExpressionParser(),
        CONTEXT_PROVIDER);
  this.mongoOperations = mongoOperations;
  this.method = method;
  this.queryExecutor = queryExecutor;
}
 
Example 21
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata repositoryMetadata,
                                    ProjectionFactory projectionFactory, NamedQueries namedQueries) {
  if (!isAggregateQueryAnnotated(method)) {
    return parentQueryLookupStrategy.resolveQuery(method, repositoryMetadata, projectionFactory, namedQueries);
  }
  else {
    return new NonReactiveAggregateMongoQuery(method, repositoryMetadata, mongoOperations, projectionFactory, queryExecutor);
  }
}
 
Example 22
@Override
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata repositoryMetadata,
                                    ProjectionFactory projectionFactory, NamedQueries namedQueries) {
  if (!isAggregateQueryAnnotated(method)) {
    return parentQueryLookupStrategy.resolveQuery(method, repositoryMetadata, projectionFactory, namedQueries);
  }
  else {
    return new ReactiveAggregateMongoQuery(method, repositoryMetadata, mongoOperations, projectionFactory, queryExecutor);
  }
}
 
Example 23
@Test(dataProvider = "queryMethods", expectedExceptions = {JsonParseException.class})
public void testCreateAggregateQuery(String methodName) throws Exception {
  ReactiveAggregateQuerySupportingRepositoryFactory factory = new ReactiveAggregateQuerySupportingRepositoryFactory(mongoOperations,
                                                                                                                    queryExecutor);
  Optional<QueryLookupStrategy> lookupStrategy = factory.getQueryLookupStrategy(CREATE_IF_NOT_FOUND, evaluationContextProvider);

  Assert.isTrue(lookupStrategy.isPresent(), "Lookup strategy must not be null");
  Method method = ReactiveTestAggregateRepository22.class.getMethod(methodName);
  RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(ReactiveTestAggregateRepository22.class);
  ProjectionFactory projectionFactory = new SpelAwareProxyProjectionFactory();
  RepositoryQuery query = lookupStrategy.get().resolveQuery(method, repositoryMetadata, projectionFactory, null);
  assertNotNull(query);
  Object object = query.execute(new Object[0]);
  assertNull(object);
}
 
Example 24
@Test(dataProvider = "queryMethods", expectedExceptions = {JsonParseException.class})
public void testCreateAggregateQuery(String methodName) throws Exception {
  NonReactiveAggregateQuerySupportingRepositoryFactory factory =
      new NonReactiveAggregateQuerySupportingRepositoryFactory(mongoOperations, queryExecutor);
  Optional<QueryLookupStrategy> lookupStrategy = factory.getQueryLookupStrategy(CREATE_IF_NOT_FOUND, evaluationContextProvider);
  assertTrue(lookupStrategy.isPresent(), "Expecting non null lookupStrategy");
  Method method = TestAggregateRepository22.class.getMethod(methodName);
  RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(TestAggregateRepository22.class);
  ProjectionFactory projectionFactory = new SpelAwareProxyProjectionFactory();
  RepositoryQuery query = lookupStrategy.get().resolveQuery(method, repositoryMetadata, projectionFactory, null);
  assertNotNull(query);
  Object object = query.execute(new Object[0]);
  assertNull(object);
}
 
Example 25
/**
 * @since Spring data JPA 1.10.0
 */
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata,
      ProjectionFactory factory, NamedQueries namedQueries) {
  QueryLookupStrategy queryLookupStrategy =
      Factory.super.getQueryLookupStrategy(key, evaluationContextProvider);

  RepositoryQuery query = queryLookupStrategy.resolveQuery(method, metadata, factory, namedQueries);
  return wrapQuery(method, metadata, query);
}
 
Example 26
protected EntityGraphAwareJpaQueryMethod(
    Method method,
    RepositoryMetadata metadata,
    ProjectionFactory factory,
    QueryExtractor extractor) {
  super(method, metadata, factory, extractor);
}
 
Example 27
Source Project: ignite   Source File: IgniteRepositoryQuery.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @param metadata Metadata.
 * @param qry Query.
 * @param mtd Method.
 * @param factory Factory.
 * @param cache Cache.
 */
public IgniteRepositoryQuery(RepositoryMetadata metadata, IgniteQuery qry,
    Method mtd, ProjectionFactory factory, IgniteCache cache) {
    type = metadata.getDomainType();
    this.qry = qry;
    this.cache = cache;
    this.metadata = metadata;
    this.mtd = mtd;
    this.factory = factory;

    returnStgy = calcReturnType(mtd, qry.isFieldQuery());
}
 
Example 28
Source Project: ignite   Source File: IgniteRepositoryFactory.java    License: Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected QueryLookupStrategy getQueryLookupStrategy(final QueryLookupStrategy.Key key,
    EvaluationContextProvider evaluationCtxProvider) {

    return new QueryLookupStrategy() {
        @Override public RepositoryQuery resolveQuery(final Method mtd, final RepositoryMetadata metadata,
            final ProjectionFactory factory, NamedQueries namedQueries) {

            final Query annotation = mtd.getAnnotation(Query.class);

            if (annotation != null) {
                String qryStr = annotation.value();

                if (key != Key.CREATE && StringUtils.hasText(qryStr))
                    return new IgniteRepositoryQuery(metadata,
                        new IgniteQuery(qryStr, isFieldQuery(qryStr), IgniteQueryGenerator.getOptions(mtd)),
                        mtd, factory, ignite.getOrCreateCache(repoToCache.get(metadata.getRepositoryInterface())));
            }

            if (key == QueryLookupStrategy.Key.USE_DECLARED_QUERY)
                throw new IllegalStateException("To use QueryLookupStrategy.Key.USE_DECLARED_QUERY, pass " +
                    "a query string via org.apache.ignite.springdata.repository.config.Query annotation.");

            return new IgniteRepositoryQuery(metadata, IgniteQueryGenerator.generateSql(mtd, metadata), mtd,
                factory, ignite.getOrCreateCache(repoToCache.get(metadata.getRepositoryInterface())));
        }
    };
}
 
Example 29
/**
 * <p>
 * Use {@link HazelcastPartTreeQuery} for resolving queries against Hazelcast repositories.
 * </P>
 *
 * @param Method,             the query method
 * @param RepositoryMetadata, not used
 * @param ProjectionFactory,  not used
 * @param NamedQueries,       not used
 * @return A mechanism for querying Hazelcast repositories
 */
public RepositoryQuery resolveQuery(Method method, RepositoryMetadata metadata, ProjectionFactory projectionFactory,
                                    NamedQueries namedQueries) {

    HazelcastQueryMethod queryMethod = new HazelcastQueryMethod(method, metadata, projectionFactory);

    if (queryMethod.hasAnnotatedQuery()) {
        return new StringBasedHazelcastRepositoryQuery(queryMethod, hazelcastInstance);
    }

    return new HazelcastPartTreeQuery(queryMethod, evaluationContextProvider, this.keyValueOperations, this.queryCreator);
}
 
Example 30
Source Project: spring-data   Source File: ArangoQueryMethod.java    License: Apache License 2.0 4 votes vote down vote up
public ArangoQueryMethod(final Method method, final RepositoryMetadata metadata, final ProjectionFactory factory) {
	super(method, metadata, factory);
	this.method = method;
	this.returnType = ClassTypeInformation.from(metadata.getRepositoryInterface()).getReturnType(method);
}