Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. package ims.reports.utils;
  2.  
  3. import ims.security.application.group.SecurityGroupUserFinder;
  4. import ims.security.application.group.dto.GroupUserMemberDTO;
  5.  
  6. import java.util.List;
  7.  
  8. import org.hibernate.Session;
  9. import org.hibernate.SessionFactory;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.context.ApplicationContext;
  12. import org.springframework.stereotype.Service;
  13.  
  14. import beluca.core.spring.AppStartUtils;
  15.  
  16. /**
  17. *
  18. */
  19. @Service
  20. public class GroupUserReport {
  21.  
  22. public GroupUserReport() {
  23.  
  24. }
  25.  
  26. @Autowired
  27. private SecurityGroupUserFinder securityGroupUserFinder;
  28.  
  29.  
  30. public static void main(String args[]) {
  31. AppStartUtils.initLog4j();
  32. ApplicationContext ctx = AppStartUtils.loadQuartzAppCtx();
  33. SessionFactory sessionFactory = ctx.getBean(SessionFactory.class);
  34. Session session = sessionFactory.openSession();
  35. GroupUserReport groupUserReport = new GroupUserReport();
  36. groupUserReport.generateGroupUserReport();
  37.  
  38. }
  39. public void generateGroupUserReport() {
  40. List<GroupUserMemberDTO> groupUserMemberDTOs = securityGroupUserFinder.getGroupUsers(111);
  41.  
  42. //here i am just populating the groupUserMemberDTO, from this i will get the name, group name, username for report.
  43.  
  44. for (GroupUserMemberDTO groupUserMemberDTO : groupUserMemberDTOs) {
  45. System.out.println(groupUserMemberDTO.toString());
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement