@Override
    public Collection<? extends Ticket> getTickets() {
        return transactionTemplate.execute(status -> {
            val factory = getJpaTicketEntityFactory();
            val sql = String.format("SELECT t FROM %s t", factory.getEntityName());
            val query = entityManager.createQuery(sql, factory.getType());
            query.setLockMode(casProperties.getTicket().getRegistry().getJpa().getTicketLockType());

            return query
                .getResultStream()
                .map(factory::toTicket)
                .map(this::decodeTicket)
                .collect(Collectors.toList());
        });
    }
JPA implementation of a CAS {@link TicketRegistry}. This implementation of
ticket registry is suitable for HA environments.

@author Scott Battaglia
@author Marvin S. Addison
@since 3.2.1
support/cas-server-support-jpa-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/JpaTicketRegistry.java