I am new to spring data jpa and trying to use it but facing an issue with org.springframework.data.mapping.PropertyReferenceException: No property name found for type User! Could some one suggest me what can be done ? I am struggling but could not find an solution for this
**Service**
public interface UserService {
Page<User> findAllUsers();
}
**Service Impl** where I am trying to implement the service methods
@Service("userService")
@Transactional
public class UserServiceImpl implements UserService{
/*@Autowired*/
@Qualifier("userDao")
private final UserDao dao;
@Autowired
public UserServiceImpl(UserDao dao) {
this.dao = dao;
}
private static final AtomicLong counter = new AtomicLong();
private static List<User> users;
public Page<User> findAllUsers() {
return dao.findAll(pageRequest);
}
**DAO**
public interface UserDao extends JpaRepository<User, Long> {
}
**User**
@Entity
@Table(name="USERAG")
public class User implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "users_seq")
private long id;
@Column(name = "NAME", nullable = true)
private String username;
@Column(name = "ADDRESS", nullable = true)
private String address;
@Column(name = "EMAIL", nullable = true)
private String email;