Examples of GemfireMappingContext


Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

  @SuppressWarnings("unchecked")
  public GemfireMappingContext gemfireMappingContext() {

    AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(Region.class);

    GemfireMappingContext context = new GemfireMappingContext();
    context.setInitialEntitySet(scanner.findTypes(GemfireRepositoryConfig.class.getPackage().getName()));
    context.initialize();

    return context;
  }
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

  @Test
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public void detectsAnnotatedQueryCorrectly() throws Exception {

    GemfireMappingContext context = new GemfireMappingContext();
    when(metadata.getDomainType()).thenReturn((Class) Person.class);
    when(metadata.getReturnedDomainClass(Mockito.any(Method.class))).thenReturn((Class) Person.class);

    GemfireQueryMethod method = new GemfireQueryMethod(Sample.class.getMethod("annotated"), metadata, context);
    assertThat(method.hasAnnotatedQuery(), is(true));
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

   * @see SGF-112
   */
  @Test
  public void rejectsQueryMethodWithPageableParameter() throws Exception {

    GemfireMappingContext context = new GemfireMappingContext();
    Method method = Invalid.class.getMethod("someMethod", Pageable.class);

    try {
      new GemfireQueryMethod(method, metadata, context);
      fail("Expected exception!");
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

    when(region.getAttributes()).thenReturn(attributes);

    List<Region<?, ?>> regions = new ArrayList<Region<?, ?>>();
    regions.add(region);

    GemfireMappingContext context = new GemfireMappingContext();

    GemfireRepositoryFactory factory = new GemfireRepositoryFactory(regions, context);

    try {
      factory.getRepository(SampleInterface.class);
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

  private MappingContext mappingContext;

  @Before
  public void setup() {
    mappingContext = new GemfireMappingContext();
  }
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

    stefan = new Person(4L, "Stefan", "Lessard");
    leroi = new Person(5L, "Leroi", "Moore");
    jeff = new Person(6L, "Jeff", "Coffin");
    oliverAugust = new Person(7L, "Oliver August", "Matthews");

    GemfireMappingContext context = new GemfireMappingContext();

    Regions regions = new Regions(this.regions, context);
    GemfireTemplate template = new GemfireTemplate(regions.getRegion(Person.class));

    template.put(dave.id, dave);
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

  @Before
  @SuppressWarnings("unchecked")
  public void setUp() {

    GemfireMappingContext context = new GemfireMappingContext();
    entity = (GemfirePersistentEntity<Person>) context.getPersistentEntity(Person.class);
  }
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

   * to the underlying data store.
   */
  public GemfireRepositoryFactory(Iterable<Region<?, ?>> regions, MappingContext<? extends GemfirePersistentEntity<?>,
      GemfirePersistentProperty> context) {
    Assert.notNull(regions);
    this.context = context == null ? new GemfireMappingContext() : context;
    this.regions = new Regions(regions, this.context);
  }
View Full Code Here

Examples of org.springframework.data.gemfire.mapping.GemfireMappingContext

   */
  @Override
  public void afterPropertiesSet() {

    if (this.context == null) {
      this.context = new GemfireMappingContext();
      setMappingContext(context);
    }

    super.afterPropertiesSet();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.