/**
  * Returns only extensions of type Location and sets the entityExtId automatically. Note: at this
  * point the entity item is a transient object.
  */
 public List<Extension> getAllLocationExtensions() {
   List<Extension> list = new ArrayList<Extension>();
   for (Extension e : entityItem.getExtensions()) {
     if (e.getClassExtension().getEntityClass().equals(EntityType.LOCATION)) {
       e.setEntityExtId(entityItem.getVisitLocation().getExtId());
       list.add(e);
     }
   }
   return list;
 }
 /**
  * Returns only extensions of type Visit and sets the entityExtId automatically. Note: at this
  * point the entity item is a transient object.
  */
 public List<Extension> getAllVisitExtensions() throws ConstraintViolations {
   List<Extension> list = new ArrayList<Extension>();
   for (Extension e : entityItem.getExtensions()) {
     if (e.getClassExtension().getEntityClass().equals(EntityType.VISIT)) {
       e.setEntityExtId(service.generateId(entityItem).getExtId());
       list.add(e);
     }
   }
   return list;
 }