use of com.xiaolyuh.entity.Location in project spring-boot-student by wyh-spring-ecosystem-student.
the class DataController method save.
@RequestMapping("/save")
public Person save() {
Person p = new Person("wyf", 32);
Collection<Location> locations = new LinkedHashSet<Location>();
Location loc1 = new Location("上海", "2009");
Location loc2 = new Location("合肥", "2010");
Location loc3 = new Location("广州", "2011");
Location loc4 = new Location("马鞍山", "2012");
locations.add(loc1);
locations.add(loc2);
locations.add(loc3);
locations.add(loc4);
p.setLocations(locations);
return personRepository.save(p);
}
Aggregations