I've class called Parent which has OneToMany connection with another class 'Kid'. Parent containst a List of kids. Kids contains field 'name'. Could somebody help me with how CrudRepository method and REST method should look like ? I wanna ask for Parent, giving only kid's name to method.
So far i've got : a) crud repository method
Parent findByName(String name);
which is giving me an error (becouse Name is not Parent's Field)
b) rest method
@RequestMapping("parentByKidName/{name}")
@ResponseBody
public Parent getParentByKidName(@PathVariable String name) {
return repository.findByName(name);
Could somebody help me please? }