ViewEntity viewDefinition = viewInstanceDefinition.getViewEntity();
Collection<ViewEntityEntity> entities = new HashSet<ViewEntityEntity>();
ViewConfig viewConfig = viewDefinition.getConfiguration();
for (EntityConfig entityConfiguration : viewConfig.getPersistence().getEntities()) {
ViewEntityEntity viewEntityEntity = new ViewEntityEntity();
viewEntityEntity.setId(1L);
viewEntityEntity.setViewName(viewDefinition.getName());
viewEntityEntity.setViewInstanceName(viewInstanceDefinition.getName());
viewEntityEntity.setClassName(entityConfiguration.getClassName());
viewEntityEntity.setIdProperty(entityConfiguration.getIdProperty());
viewEntityEntity.setViewInstance(viewInstanceDefinition);
entities.add(viewEntityEntity);
}
viewInstanceDefinition.setEntities(entities);
}