@Override
    public long fetchCount() {
        try {
            return unsafeCount();
        } catch (SQLException e) {
            String error = "Caught " + e.getClass().getName();
            logger.log(Level.SEVERE, error, e);
            throw configuration.translate(e);
        }
    }
Add a listener

@param listener listener to add
querydsl-sql/src/main/java/com/querydsl/sql/AbstractSQLQuery.java