MetadataReader reader = readerFactory.getMetadataReader(resource);
String className = reader.getClassMetadata().getClassName();
Class<?> clazz = this.resourcePatternResolver.getClassLoader().loadClass(className);
Field[] fields = clazz.getDeclaredFields();
EntityMetadata entityMetadata = new EntityMetadata();
for(Field field : fields) {
if(!field.isAccessible())
field.setAccessible(true);
entityMetadata.getFields().add(field);
}
cache.put(clazz, entityMetadata);
}