@Override
    public OneTimeTokenAccount get(final String username, final long id) {
        return entityManager.createQuery("SELECT r FROM "
                + ENTITY_NAME + " r WHERE r.id=:id AND r.username = :username", JpaGoogleAuthenticatorAccount.class)
            .setParameter("username", username.toLowerCase(Locale.ENGLISH).trim())
            .setParameter("id", id)
            .getSingleResult();
    }
This is {@link JpaGoogleAuthenticatorTokenCredentialRepository} that stores gauth data into a RDBMS database.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-gauth-jpa/src/main/java/org/apereo/cas/gauth/credential/JpaGoogleAuthenticatorTokenCredentialRepository.java