Package org.springframework.data.mapping.context

Examples of org.springframework.data.mapping.context.SampleMappingContext.initialize()


  @Test
  public void extractsAliasForUnknownType() {

    SampleMappingContext mappingContext = new SampleMappingContext();
    mappingContext.initialize();

    mapper = new MappingContextTypeInformationMapper(mappingContext);

    assertThat(mapper.createAliasFor(from(Entity.class)), is((Object) "foo"));
  }
View Full Code Here


  @Test
  public void doesNotReturnTypeAliasForSimpleType() {

    SampleMappingContext mappingContext = new SampleMappingContext();
    mappingContext.initialize();

    mapper = new MappingContextTypeInformationMapper(mappingContext);
    assertThat(mapper.createAliasFor(from(String.class)), is(nullValue()));
  }
View Full Code Here

  @Test
  @SuppressWarnings("rawtypes")
  public void detectsTypeForUnknownEntity() {

    SampleMappingContext mappingContext = new SampleMappingContext();
    mappingContext.initialize();

    mapper = new MappingContextTypeInformationMapper(mappingContext);
    assertThat(mapper.resolveTypeFrom("foo"), is(nullValue()));

    PersistentEntity<?, SamplePersistentProperty> entity = mappingContext.getPersistentEntity(Entity.class);
View Full Code Here

    AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(TypeAlias.class);

    SampleMappingContext context = new SampleMappingContext();
    context.setInitialEntitySet(scanner.findTypes(getClass().getPackage().getName()));
    context.initialize();

    new MappingContextTypeInformationMapper(context);
  }

  @TypeAlias("foo")
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.