Tabnine Logo
org.springframework.data.repository.core.support
Code IndexAdd Tabnine to your IDE (free)

How to use org.springframework.data.repository.core.support

Best Java code snippets using org.springframework.data.repository.core.support (Showing top 20 results out of 315)

origin: spring-projects/spring-data-elasticsearch

@Override
protected void setMappingContext(MappingContext<?, ?> mappingContext) {
  super.setMappingContext(mappingContext);
  this.mappingContextConfigured = true;
}
origin: spring-projects/spring-data-jpa

@Override
public void setMappingContext(MappingContext<?, ?> mappingContext) {
  super.setMappingContext(mappingContext);
}
origin: spring-projects/spring-data-jpa

  @Override
  public void afterPropertiesSet() {

    Assert.state(entityManager != null, "EntityManager must not be null!");

    super.afterPropertiesSet();
  }
}
origin: spring-projects/spring-data-mongodb

@Override
protected RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) {
  RepositoryFragments fragments = RepositoryFragments.empty();
  boolean isQueryDslRepository = QUERY_DSL_PRESENT
      && ReactiveQuerydslPredicateExecutor.class.isAssignableFrom(metadata.getRepositoryInterface());
  if (isQueryDslRepository) {
    MongoEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType(),
        metadata);
    fragments = fragments.append(RepositoryFragment.implemented(getTargetRepositoryViaReflection(
        ReactiveQuerydslMongoPredicateExecutor.class, entityInformation, operations)));
  }
  return fragments;
}
origin: spring-projects/spring-data-elasticsearch

  @Override
  public void afterPropertiesSet() {

    super.afterPropertiesSet();
    Assert.state(operations != null, "ReactiveElasticsearchOperations must not be null!");

    if (!mappingContextConfigured) {
      setMappingContext(operations.getElasticsearchConverter().getMappingContext());
    }
  }
}
origin: apache/ignite

/** {@inheritDoc} */
@Override protected RepositoryMetadata getRepositoryMetadata(Class<?> repoItf) {
  Assert.notNull(repoItf, "Repository interface must be set.");
  Assert.isAssignable(IgniteRepository.class, repoItf, "Repository must implement IgniteRepository interface.");
  RepositoryConfig annotation = repoItf.getAnnotation(RepositoryConfig.class);
  Assert.notNull(annotation, "Set a name of an Apache Ignite cache using @RepositoryConfig annotation to map " +
    "this repository to the underlying cache.");
  Assert.hasText(annotation.cacheName(), "Set a name of an Apache Ignite cache using @RepositoryConfig " +
    "annotation to map this repository to the underlying cache.");
  repoToCache.put(repoItf, annotation.cacheName());
  return super.getRepositoryMetadata(repoItf);
}
origin: spring-projects/spring-data-jpa

@Override
public void setBeanClassLoader(ClassLoader classLoader) {
  super.setBeanClassLoader(classLoader);
  this.crudMethodMetadataPostProcessor.setBeanClassLoader(classLoader);
}
origin: spring-projects/spring-data-jpa

  @Override
  protected Object doExecute(final AbstractJpaQuery query, Object[] values) {
    if (!SurroundingTransactionDetectorMethodInterceptor.INSTANCE.isSurroundingTransactionActive()) {
      throw new InvalidDataAccessApiUsageException(NO_SURROUNDING_TRANSACTION);
    }
    Query jpaQuery = query.createQuery(values);
    // JPA 2.2 on the classpath
    if (streamMethod != null) {
      return ReflectionUtils.invokeMethod(streamMethod, jpaQuery);
    }
    // Fall back to legacy stream execution
    PersistenceProvider persistenceProvider = PersistenceProvider.fromEntityManager(query.getEntityManager());
    CloseableIterator<Object> iter = persistenceProvider.executeQueryWithResultStream(jpaQuery);
    return StreamUtils.createStreamFromIterator(iter);
  }
}
origin: spring-projects/spring-data-mongodb

  @Override
  @SuppressWarnings("unchecked")
  public Class<ID> getIdType() {

    if (this.entityMetadata.hasIdProperty()) {
      return super.getIdType();
    }

    return fallbackIdType;
  }
}
origin: spring-projects/spring-data-mongodb

@Override
protected final RepositoryFactorySupport createRepositoryFactory() {
  RepositoryFactorySupport factory = getFactoryInstance(operations);
  if (createIndexesForQueryMethods) {
    factory.addQueryCreationListener(
        new IndexEnsuringQueryCreationListener(collectionName -> operations.indexOps(collectionName)));
  }
  return factory;
}
origin: spring-projects/spring-data-jpa

/**
 * Extract the {@link Predicate} representing the {@link Example}.
 *
 * @param root must not be {@literal null}.
 * @param cb must not be {@literal null}.
 * @param example must not be {@literal null}.
 * @return never {@literal null}.
 */
public static <T> Predicate getPredicate(Root<T> root, CriteriaBuilder cb, Example<T> example) {
  Assert.notNull(root, "Root must not be null!");
  Assert.notNull(cb, "CriteriaBuilder must not be null!");
  Assert.notNull(example, "Example must not be null!");
  ExampleMatcher matcher = example.getMatcher();
  List<Predicate> predicates = getPredicates("", cb, root, root.getModel(), example.getProbe(),
      example.getProbeType(), new ExampleMatcherAccessor(matcher), new PathNode("root", null, example.getProbe()));
  if (predicates.isEmpty()) {
    return cb.isTrue(cb.literal(true));
  }
  if (predicates.size() == 1) {
    return predicates.iterator().next();
  }
  Predicate[] array = predicates.toArray(new Predicate[0]);
  return matcher.isAllMatching() ? cb.and(array) : cb.or(array);
}
origin: spring-projects/spring-data-redis

@Override
protected RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) {
  RepositoryFragments fragments = RepositoryFragments.empty();
  if (QueryByExampleExecutor.class.isAssignableFrom(metadata.getRepositoryInterface())) {
    RedisMappingContext mappingContext = (RedisMappingContext) this.operations.getMappingContext();
    RedisPersistentEntity<?> persistentEntity = mappingContext.getRequiredPersistentEntity(metadata.getDomainType());
    MappingRedisEntityInformation<?, ?> entityInformation = new MappingRedisEntityInformation<>(persistentEntity);
    fragments = fragments.append(RepositoryFragment.implemented(QueryByExampleExecutor.class,
        getTargetRepositoryViaReflection(QueryByExampleRedisExecutor.class, entityInformation, operations)));
  }
  return fragments;
}
origin: spring-projects/spring-data-mongodb

  @Override
  public void afterPropertiesSet() {

    super.afterPropertiesSet();
    Assert.state(operations != null, "MongoTemplate must not be null!");

    if (!mappingContextConfigured) {
      setMappingContext(operations.getConverter().getMappingContext());
    }
  }
}
origin: spring-projects/spring-data-mongodb

@Override
protected void setMappingContext(MappingContext<?, ?> mappingContext) {
  super.setMappingContext(mappingContext);
  this.mappingContextConfigured = true;
}
origin: apache/ignite

/** {@inheritDoc} */
@Override protected RepositoryMetadata getRepositoryMetadata(Class<?> repoItf) {
  Assert.notNull(repoItf, "Repository interface must be set.");
  Assert.isAssignable(IgniteRepository.class, repoItf, "Repository must implement IgniteRepository interface.");
  RepositoryConfig annotation = repoItf.getAnnotation(RepositoryConfig.class);
  Assert.notNull(annotation, "Set a name of an Apache Ignite cache using @RepositoryConfig annotation to map " +
    "this repository to the underlying cache.");
  Assert.hasText(annotation.cacheName(), "Set a name of an Apache Ignite cache using @RepositoryConfig " +
    "annotation to map this repository to the underlying cache.");
  repoToCache.put(repoItf, annotation.cacheName());
  return super.getRepositoryMetadata(repoItf);
}
origin: spring-projects/spring-data-mongodb

@Override
protected final RepositoryFactorySupport createRepositoryFactory() {
  RepositoryFactorySupport factory = getFactoryInstance(operations);
  if (createIndexesForQueryMethods) {
    factory.addQueryCreationListener(new IndexEnsuringQueryCreationListener(
        collectionName -> IndexOperationsAdapter.blocking(operations.indexOps(collectionName))));
  }
  return factory;
}
origin: spring-projects/spring-data-mongodb

@Override
protected RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) {
  RepositoryFragments fragments = RepositoryFragments.empty();
  boolean isQueryDslRepository = QUERY_DSL_PRESENT
      && QuerydslPredicateExecutor.class.isAssignableFrom(metadata.getRepositoryInterface());
  if (isQueryDslRepository) {
    if (metadata.isReactiveRepository()) {
      throw new InvalidDataAccessApiUsageException(
          "Cannot combine Querydsl and reactive repository support in a single interface");
    }
    MongoEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType(),
        metadata);
    fragments = fragments.append(RepositoryFragment.implemented(
        getTargetRepositoryViaReflection(QuerydslMongoPredicateExecutor.class, entityInformation, operations)));
  }
  return fragments;
}
origin: spring-projects/spring-data-mongodb

  @Override
  public void afterPropertiesSet() {

    super.afterPropertiesSet();
    Assert.state(operations != null, "ReactiveMongoOperations must not be null!");

    if (!mappingContextConfigured) {
      setMappingContext(operations.getConverter().getMappingContext());
    }
  }
}
origin: spring-projects/spring-data-mongodb

@Override
protected void setMappingContext(MappingContext<?, ?> mappingContext) {
  super.setMappingContext(mappingContext);
  this.mappingContextConfigured = true;
}
origin: spring-projects/spring-data-jpa

@Override
protected RepositoryComposition.RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) {
  RepositoryComposition.RepositoryFragments fragments = RepositoryComposition.RepositoryFragments.empty();
  boolean isQueryDslRepository = QUERY_DSL_PRESENT
      && QuerydslPredicateExecutor.class.isAssignableFrom(metadata.getRepositoryInterface());
  if (isQueryDslRepository) {
    if (metadata.isReactiveRepository()) {
      throw new InvalidDataAccessApiUsageException(
          "Cannot combine Querydsl and reactive repository support in a single interface");
    }
    JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType());
    Object querydslFragment = getTargetRepositoryViaReflection(QuerydslJpaPredicateExecutor.class, entityInformation,
        entityManager, entityPathResolver, crudMethodMetadataPostProcessor.getCrudMethodMetadata());
    fragments = fragments.append(RepositoryFragment.implemented(querydslFragment));
  }
  return fragments;
}
org.springframework.data.repository.core.support

Most used classes

  • RepositoryFactoryBeanSupport
    Adapter for Springs FactoryBean interface to allow easy setup of repository factories via Spring con
  • RepositoryFactorySupport
    Factory bean to create instances of a given repository interface. Creates a proxy implementing the c
  • TransactionalRepositoryFactoryBeanSupport
    Extension of RepositoryFactoryBeanSupport to add transactional capabilities to the repository proxy.
  • RepositoryFragment
  • PersistentEntityInformation
  • RepositoryFactorySupport$QueryExecutorMethodInterceptor,
  • RepositoryProxyPostProcessor,
  • DefaultRepositoryMetadata,
  • MethodInvocationValidator,
  • MethodLookup$InvokedMethod,
  • MethodLookup,
  • RepositoryComposition,
  • RepositoryFactorySupport$ImplementationMethodExecutionInterceptor,
  • AbstractEntityInformation,
  • AnnotationRepositoryMetadata,
  • SurroundingTransactionDetectorMethodInterceptor,
  • TransactionalRepositoryProxyPostProcessor,
  • AbstractRepositoryMetadata,
  • DefaultRepositoryInformation
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now