Package org.springframework.data.mapping.context

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


  }

  @Test
  public void shouldReturnMappingContextWithWhichItWasInitialized() {
    // given
    MappingContext mappingContext = new SimpleElasticsearchMappingContext();
    MappingElasticsearchConverter converter = new MappingElasticsearchConverter(mappingContext);
    // then
    assertThat(converter.getMappingContext(), is(notNullValue()));
    assertThat(converter.getMappingContext(), is(sameInstance(mappingContext)));
  }
View Full Code Here


        @RelatedTo TestRelationship test;
    }

    @Test(expected = MappingException.class)
    public void testFailInvalidRelatedTo() throws Exception {
        MappingContext context = new Neo4jMappingContext();
        context.getPersistentEntity(TestEntityRelatedTo.class);
    }
View Full Code Here

        MappingContext context = new Neo4jMappingContext();
        context.getPersistentEntity(TestEntityRelatedTo.class);
    }
    @Test(expected = MappingException.class)
    public void testFailInvalidRelatedToVia() throws Exception {
        MappingContext context = new Neo4jMappingContext();
        context.getPersistentEntity(TestEntityRelatedToVia.class);
    }
View Full Code Here

    }

    @Override
    @SuppressWarnings("unchecked")
    public Collection<? extends DomainConfigurationProblem> validateFieldMetadata(PersistentFieldMetadata fieldMetadata, Class<?> domainType, DomainConfigurationValidationContext validationContext) {
        MappingContext mappingContext = validationContext.getMappingContext();
        final LightAdminConfiguration lightAdminConfiguration = validationContext.getLightAdminConfiguration();

        final PersistentEntity persistentEntity = mappingContext.getPersistentEntity(domainType);

        PersistentProperty persistentProperty = persistentEntity.getPersistentProperty(fieldMetadata.getField());

        if (persistentProperty == null) {
            return newArrayList(validationContext.notPersistableFieldProblem(fieldMetadata.getName()));
View Full Code Here

    }

    @Test
    public void shouldReturnMappingContextWithWhichItWasInitialized(){
        //given
        MappingContext mappingContext = new SimpleElasticsearchMappingContext();
        MappingElasticsearchConverter converter = new MappingElasticsearchConverter(mappingContext);
        //then
        assertThat(converter.getMappingContext(), is(notNullValue()));
        assertThat(converter.getMappingContext(), is(sameInstance(mappingContext)));
    }
View Full Code Here

TOP

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

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.