@Override
 @Transactional(readOnly = true)
 public Resource getResource(Integer id) {
   Resource result = null;
   if (id != null) {
     result = resourceRepository.getResource(id);
     if (result != null && ResourceType.DIRECTORY.equals(result.getType())) {
       Hibernate.initialize(((Directory) result).getChildren());
     }
   }
   return result;
 }
 @Override
 public List<Resource> find() {
   return resourceRepository.list();
 }
 @Override
 public List<Resource> getRootResources() {
   return resourceRepository.getRootResources();
 }