Postgresql Plpgsql Loop Through Array Of Objects In Java