Here is my UserRepository and a find function
@Repository
public interface UserRepository extends CrudRepository<JPA_Users, Long> {
List<JPA_Users> findByName(String Name);
}
then in one of the controller function i try to access this find function as follows
@RequestMapping(value = "/jpadata1", method = RequestMethod.GET)
public String jpadata1(ModelMap map) {
UserRepository repository;
ApplicationContext context = new ClassPathXmlApplicationContext("beans1.xml");
repository = context.getBean(UserRepository.class);
Iterable usrs = repository.findByName("shahzad");
}
there is a column with named name in database and i have multiple records with values shahzad i was expecting that all those records will be return but this function returns nothing no records are return
Shahzad