@Override
 @Transactional
 public void addChildResource(String parentResourceId, String childResourceId) {
   final ResourceEntity parent = resourceDao.findById(parentResourceId);
   final ResourceEntity child = resourceDao.findById(childResourceId);
   parent.addChildResource(child);
   resourceDao.save(parent);
 }
 @Override
 @Transactional(readOnly = true)
 public int getNumOfParentResources(String resourceId) {
   final ResourceEntity example = new ResourceEntity();
   final ResourceEntity child = new ResourceEntity();
   child.setId(resourceId);
   example.addChildResource(child);
   return resourceDao.count(example);
 }
 @Override
 @Transactional(readOnly = true)
 public List<ResourceEntity> getParentResources(String resourceId, int from, int size) {
   final ResourceEntity example = new ResourceEntity();
   final ResourceEntity child = new ResourceEntity();
   child.setId(resourceId);
   example.addChildResource(child);
   return resourceDao.getByExample(example, from, size);
 }