Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. }
  2.  
  3. manager
  4. {
  5. id:"abc",
  6. name:”PP”,
  7. age:26
  8. }
  9.  
  10. supervisor
  11. {
  12. id:"abc",
  13. name:"Raj",
  14. age:25
  15. }
  16. public class Employee
  17. {
  18. private String id;
  19. private String name;
  20. private int age;
  21. }
  22. @Document(collection="manager")
  23. public class Manager extends Employee
  24. {
  25. }
  26. @Document(collection="supervisor")
  27. public class Supervisor extends Employee
  28. {
  29. }
  30. public interface EmployeeService<T>
  31. {
  32. public T save(T employee);
  33. }
  34. @Service
  35. public class EmployeeServiceImpl<T> implements EmployeeService<T>
  36. {
  37. @Autowired
  38. EmployeeRepository employeeRepository;
  39. @Override
  40. public T save(T obj) {
  41. return (T) employeeRepository.save(obj);
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement