@Override
    public GoogleAuthenticatorToken get(final String uid, final Integer otp) {
        try {
            return entityManager.createQuery("SELECT r FROM " + JpaGoogleAuthenticatorToken.class.getSimpleName()
                                             + " r WHERE r.userId = :userId and r.token = :token", JpaGoogleAuthenticatorToken.class)
                .setParameter("userId", uid.trim().toLowerCase(Locale.ENGLISH))
                .setParameter("token", otp)
                .getSingleResult();
        } catch (final NoResultException e) {
            LOGGER.debug("No record could be found for google authenticator id [{}]", uid);
        }
        return null;
    }
This is {@link GoogleAuthenticatorJpaTokenRepository}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-gauth-jpa/src/main/java/org/apereo/cas/gauth/token/GoogleAuthenticatorJpaTokenRepository.java