code: public Token findTokenByVisualNumber(String visualNumber) {
          EntityManager entityManager = getEntityManager();
  		try {
  			return entityManager
  					.createQuery("SELECT token FROM Token AS token WHERE visualNumber = :visualNumber", Token.class)
  					.setParameter("visualNumber", visualNumber).setMaxResults(1).getSingleResult();
  		} catch (NoResultException e) {
  			return null;
  		} finally {
  			entityManager.close();
  		}
  	}
docs: findTokenByVisualNumber
  
  @param visualNumber
  @return