@Override
    public Set<? extends MultifactorAuthenticationTrustRecord> get(final String principal) {
        return FunctionUtils.doAndHandle(() -> transactionTemplate.execute(__ -> {
            remove();
            val query = entityManager
                .createQuery(QUERY_SELECT + " WHERE r.principal = :principal", getEntityFactory().getType())
                .setParameter("principal", principal);
            val results = query.getResultList();
            return new HashSet<>(results);
        }), e -> new HashSet<MultifactorAuthenticationTrustRecord>()).get();
    }
This is {@link JpaMultifactorAuthenticationTrustStorage}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-trusted-mfa-jdbc/src/main/java/org/apereo/cas/trusted/authentication/storage/JpaMultifactorAuthenticationTrustStorage.java