Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. @Transactional(readOnly = true)
  2. public List<Social> getAllSocialData() throws FastestDAOException {
  3. try {
  4. Session session = sessionFactory.getCurrentSession();
  5. Query query = session.createQuery("Select social.followers From Social social where social.socialId=1");
  6. return query.list();
  7. }
  8. catch (Exception ex) {
  9. System.out.println("Unable to get data"+ex);
  10. }
  11.  
  12. private static List<QuickStartSocial> followers = null;
  13. public String aBCForm(@ModelAttribute(value = "abcbean") QuickStartBean quickstartbean,Model model) {
  14.  
  15. try {
  16. followers=quickStartDataService.getAllSocialData();
  17. model.addAttribute("followers",followers);
  18. }
  19. catch (Exception e) {
  20. e.printStackTrace();
  21. }
  22.  
  23. return "quickstart/create";
  24. }
  25.  
  26. ID - socialId
  27. column1 - following
  28. column2- followers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement