Package org.springframework.data.mapping.context

Examples of org.springframework.data.mapping.context.SampleMappingContext


  @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);

    assertThat(entity, is(notNullValue()));
    assertThat(mapper.resolveTypeFrom("foo"), is((TypeInformation) from(Entity.class)));
  }
View Full Code Here


  @SuppressWarnings("unchecked")
  public void createsTypeMapperForGenericTypesWithDifferentBindings() {

    AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(TypeAlias.class);

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

    new MappingContextTypeInformationMapper(context);
  }
View Full Code Here

  SampleMappingContext context;

  @Before
  public void setUp() {

    context = new SampleMappingContext();
    entity = context.getPersistentEntity(Sample.class);
  }
View Full Code Here

    RepositoryFactoryBeanSupport<T, S, ID> {

  private T repository;

  public DummyRepositoryFactoryBean() {
    setMappingContext(new SampleMappingContext());
  }
View Full Code Here

   * @see DATACMNS-480
   */
  @Test
  public void obtainsIdAndIdTypeInformationFromPersistentEntity() {

    SampleMappingContext context = new SampleMappingContext();
    PersistentEntity<Object, SamplePersistentProperty> entity = context.getPersistentEntity(Sample.class);

    EntityInformation<Object, Long> information = new PersistentEntityInformation<Object, Long>(entity);
    assertThat(information.getIdType(), is(typeCompatibleWith(Long.class)));

    Sample sample = new Sample();
View Full Code Here

TOP

Related Classes of org.springframework.data.mapping.context.SampleMappingContext

Copyright © 2018 www.massapicom. 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.