@Override @Transactional(readOnly = true) public Collection findTrashedByCode(String code) throws Exception { Collection temp = collectionRepository.findByCode(code); if (temp.getStatus().equals(CollectionStatus.TRASHED)) { return temp; } return null; }
// this method is common to get collection and should not filter by status @Override @Transactional(readOnly = true) public Collection findByCode(String code) throws Exception { return collectionRepository.findByCode(code); }