Java 类org.springframework.data.repository.core.support.ReflectionEntityInformation 实例源码

项目:spring-data-jdbc    文件:BaseJdbcRepository.java   
@SuppressWarnings({"rawtypes", "unchecked"})
protected static EntityInformation createEntityInformation(Class<?> entityType) {

    if (Persistable.class.isAssignableFrom(entityType)) {
        return new PersistableEntityInformation(entityType);
    }
    return new ReflectionEntityInformation(entityType);
}
项目:spring-data-keyvalue    文件:SimpleKeyValueRepositoryUnitTests.java   
@Test // DATACMNS-525
public void saveNewWithNumericId() {

    ReflectionEntityInformation<WithNumericId, Integer> ei = new ReflectionEntityInformation<>(WithNumericId.class);
    SimpleKeyValueRepository<WithNumericId, Integer> temp = new SimpleKeyValueRepository<>(ei, opsMock);

    WithNumericId withNumericId = new WithNumericId();
    temp.save(withNumericId);

    verify(opsMock, times(1)).insert(eq(withNumericId));
}
项目:spring-data-jdbc-template    文件:JdbcTemplateRepositoryFactoryBean.java   
@Override
public <T, ID extends Serializable> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
    return new ReflectionEntityInformation<>(domainClass, Id.class);
}
项目:Qihua    文件:JdbcRepository.java   
@SuppressWarnings("unchecked")
private EntityInformation<T, ID> createEntityInformation() {
  Class<T> clazz = (Class<T>) GenericTypeResolver.resolveTypeArguments(getClass(), JdbcRepository.class)[0];

  return new ReflectionEntityInformation(clazz);
}
项目:spring-data-hazelcast    文件:SimpleHazelcastRepositoryIT.java   
@Before
public void setUp_After_Super_SetUp() throws Exception {
    ReflectionEntityInformation<Makeup, String> entityInformation = new ReflectionEntityInformation<>(Makeup.class);

    this.theRepository = new SimpleHazelcastRepository<>(entityInformation, keyValueOperations);
}
项目:spring-data-keyvalue    文件:SimpleKeyValueRepositoryUnitTests.java   
@Before
public void setUp() {

    ReflectionEntityInformation<Foo, String> ei = new ReflectionEntityInformation<>(Foo.class);
    repo = new SimpleKeyValueRepository<>(ei, opsMock);
}