congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
KeyValueOperations.getMappingContext
Code IndexAdd Tabnine to your IDE (free)

How to use
getMappingContext
method
in
org.springframework.data.keyvalue.core.KeyValueOperations

Best Java code snippets using org.springframework.data.keyvalue.core.KeyValueOperations.getMappingContext (Showing top 15 results out of 315)

origin: spring-projects/spring-data-redis

@Override
public void destroy(KeyValueOperations instance, CreationalContext<KeyValueOperations> creationalContext) {
  if (instance.getMappingContext() instanceof DisposableBean) {
    try {
      ((DisposableBean) instance.getMappingContext()).destroy();
      instance.destroy();
    } catch (Exception e) {
      throw new IllegalStateException(e);
    }
  }
  super.destroy(instance, creationalContext);
}
origin: spring-projects/spring-data-redis

  @Override
  @SuppressWarnings("unchecked")
  public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {

    RedisPersistentEntity<T> entity = (RedisPersistentEntity<T>) operations.getMappingContext()
        .getRequiredPersistentEntity(domainClass);

    return new MappingRedisEntityInformation<>(entity);
  }
}
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: apache/servicemix-bundles

/**
 * Creates a new {@link KeyValueRepositoryFactory} for the given {@link KeyValueOperations} and
 * {@link AbstractQueryCreator}-type.
 *
 * @param keyValueOperations must not be {@literal null}.
 * @param queryCreator must not be {@literal null}.
 * @param repositoryQueryType must not be {@literal null}.
 * @since 1.1
 */
public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations,
    Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) {
  Assert.notNull(keyValueOperations, "KeyValueOperations must not be null!");
  Assert.notNull(queryCreator, "Query creator type must not be null!");
  Assert.notNull(repositoryQueryType, "RepositoryQueryType type must not be null!");
  this.queryCreator = queryCreator;
  this.keyValueOperations = keyValueOperations;
  this.context = keyValueOperations.getMappingContext();
  this.repositoryQueryType = repositoryQueryType;
}
origin: org.springframework.data/spring-data-keyvalue

/**
 * Creates a new {@link KeyValueRepositoryFactory} for the given {@link KeyValueOperations} and
 * {@link AbstractQueryCreator}-type.
 *
 * @param keyValueOperations must not be {@literal null}.
 * @param queryCreator must not be {@literal null}.
 * @param repositoryQueryType must not be {@literal null}.
 * @since 1.1
 */
public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations,
    Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) {
  Assert.notNull(keyValueOperations, "KeyValueOperations must not be null!");
  Assert.notNull(queryCreator, "Query creator type must not be null!");
  Assert.notNull(repositoryQueryType, "RepositoryQueryType type must not be null!");
  this.queryCreator = queryCreator;
  this.keyValueOperations = keyValueOperations;
  this.context = keyValueOperations.getMappingContext();
  this.repositoryQueryType = repositoryQueryType;
}
origin: spring-projects/spring-data-keyvalue

/**
 * Creates a new {@link KeyValueRepositoryFactory} for the given {@link KeyValueOperations} and
 * {@link AbstractQueryCreator}-type.
 *
 * @param keyValueOperations must not be {@literal null}.
 * @param queryCreator must not be {@literal null}.
 * @param repositoryQueryType must not be {@literal null}.
 * @since 1.1
 */
public KeyValueRepositoryFactory(KeyValueOperations keyValueOperations,
    Class<? extends AbstractQueryCreator<?, ?>> queryCreator, Class<? extends RepositoryQuery> repositoryQueryType) {
  Assert.notNull(keyValueOperations, "KeyValueOperations must not be null!");
  Assert.notNull(queryCreator, "Query creator type must not be null!");
  Assert.notNull(repositoryQueryType, "RepositoryQueryType type must not be null!");
  this.queryCreator = queryCreator;
  this.keyValueOperations = keyValueOperations;
  this.context = keyValueOperations.getMappingContext();
  this.repositoryQueryType = repositoryQueryType;
}
origin: org.springframework.data/spring-data-redis

@Override
public void destroy(KeyValueOperations instance, CreationalContext<KeyValueOperations> creationalContext) {
  if (instance.getMappingContext() instanceof DisposableBean) {
    try {
      ((DisposableBean) instance.getMappingContext()).destroy();
      instance.destroy();
    } catch (Exception e) {
      throw new IllegalStateException(e);
    }
  }
  super.destroy(instance, creationalContext);
}
origin: org.springframework.vault/spring-vault-core

/**
 * Creates a new {@link VaultPartTreeQuery} for the given {@link QueryMethod},
 * {@link EvaluationContextProvider}, {@link KeyValueOperations} and query creator
 * type.
 *
 * @param queryMethod must not be {@literal null}.
 * @param evaluationContextProvider must not be {@literal null}.
 * @param keyValueOperations must not be {@literal null}.
 * @param queryCreator must not be {@literal null}.
 */
@SuppressWarnings("unchecked")
public VaultPartTreeQuery(QueryMethod queryMethod,
    QueryMethodEvaluationContextProvider evaluationContextProvider,
    KeyValueOperations keyValueOperations,
    Class<? extends AbstractQueryCreator<?, ?>> queryCreator) {
  super(queryMethod, evaluationContextProvider, keyValueOperations,
      new VaultQueryCreatorFactory(
          (MappingContext) keyValueOperations.getMappingContext()));
}
origin: apache/servicemix-bundles

@Override
public void destroy(KeyValueOperations instance, CreationalContext<KeyValueOperations> creationalContext) {
  if (instance.getMappingContext() instanceof DisposableBean) {
    try {
      ((DisposableBean) instance.getMappingContext()).destroy();
      instance.destroy();
    } catch (Exception e) {
      throw new IllegalStateException(e);
    }
  }
  super.destroy(instance, creationalContext);
}
origin: com.hazelcast/spring-data-hazelcast

  @Override
  public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
    PersistentEntity<T, ?> entity = (PersistentEntity<T, ?>) keyValueOperations.getMappingContext()
                                          .getPersistentEntity(domainClass);
    Assert.notNull(entity, "Entity must not be 'null'.");
    return new HazelcastEntityInformation<>(entity);
  }
}
origin: org.springframework.data/spring-data-redis

  @Override
  @SuppressWarnings("unchecked")
  public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {

    RedisPersistentEntity<T> entity = (RedisPersistentEntity<T>) operations.getMappingContext()
        .getRequiredPersistentEntity(domainClass);

    return new MappingRedisEntityInformation<>(entity);
  }
}
origin: apache/servicemix-bundles

  @Override
  @SuppressWarnings("unchecked")
  public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {

    RedisPersistentEntity<T> entity = (RedisPersistentEntity<T>) operations.getMappingContext()
        .getRequiredPersistentEntity(domainClass);

    return new MappingRedisEntityInformation<>(entity);
  }
}
origin: org.springframework.vault/spring-vault-core

  @Override
  @SuppressWarnings("unchecked")
  public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {

    VaultPersistentEntity<T> entity = (VaultPersistentEntity<T>) operations
        .getMappingContext().getPersistentEntity(domainClass);

    return new MappingVaultEntityInformation<>(entity);
  }
}
origin: org.springframework.data/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: apache/servicemix-bundles

@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;
}
org.springframework.data.keyvalue.coreKeyValueOperationsgetMappingContext

Popular methods of KeyValueOperations

  • count
    Total number of elements matching given query. Respects KeySpace if present and therefore counts all
  • delete
    Delete item of type with given id.
  • find
    Get all elements matching the given query. Respects KeySpace if present and therefore returns all e
  • destroy
  • findAll
    Get all elements ordered by sort. Respects KeySpace if present and therefore returns all elements th
  • findById
    Get element of given type with given id. Respects KeySpace if present and therefore returns all elem
  • findInRange
    Get all elements in given range ordered by sort. Respects KeySpace if present and therefore returns
  • insert
    Add object with given id.
  • update

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • getApplicationContext (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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