Code example for ObjectRetrievalFailureException

0
    } 
 
    public Location addLocationScan(Ticket ticket, Long locationId) { 
        Location location = locationDao.findOne(locationId); 
        if (location == null) { 
            throw new ObjectRetrievalFailureException(Ticket.class, locationId); 
        } 
 
        LocationScan locationScan = new LocationScan(); 
        locationScan.setLocation(location); 
        locationScan.setTimestamp(new Date()); 
        ticket.getLocationScans().add(locationScan); 
        store(ticket); 
 
        return location; 
    } 
 
    public void deleteLocationScan(Ticket ticket, Long locationId) { 
 
        for (Iterator<LocationScan> locationIterator = ticket.getLocationScans().iterator() ; locationIterator.hasNext(); ) {