// need to remove old shapes...
}
TripPattern updatedTripPattern = TripPattern.em().merge(tripPattern);
updatedTripPattern.save();
Set<Long> patternStopIds = new HashSet<Long>();
for(TripPatternStop patternStop : updatedTripPattern.patternStops) {
patternStopIds.add(patternStop.id);
}