protected Entry getEntry(String id) { Entry entry = null; // check if numeric try { entry = dao.get(Long.decode(id)); } catch (NumberFormatException nfe) { // fine to ignore } // check for part Id if (entry == null) entry = dao.getByPartNumber(id); // check for global unique id if (entry == null) entry = dao.getByRecordId(id); // get by unique name if (entry == null) return dao.getByUniqueName(id); return entry; }