Postgresql Iterate Over Json Array Length Java