Advertisement
Guest User

Untitled

a guest
May 6th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. @Controller
  2. public class MeetingController
  3. {
  4. // Persistence Manager injected by spring
  5. @Autowired
  6. protected PersistenceManager persistenceManager;
  7.  
  8. /**
  9. * Simple method used to encapsulate the saving of a meeting.
  10. * @param meeting Meeting to persist
  11. */
  12. public void saveMeeting(Meeting meeting)
  13. {
  14. try {
  15. persistenceManager.saveEntity(meeting);
  16. } catch (EntityException e) {
  17. // Log an error
  18. }
  19. }
  20.  
  21. /**
  22. * Method used to aggregate all meetings at work that are
  23. * snoozers and are really hard to stay awake but, you still have
  24. * to pay attention because someone is going to call on you and ask
  25. * you a dumb question.
  26. *
  27. * @return A list of really boring meetings
  28. */
  29. public List<Meeting> findBoringMeetings()
  30. {
  31. Query query = new Query(Meeting.class, new QueryCriteria("notes", QueryCriteriaOperator.CONTAINS, "Boring"));
  32. List<Meeting> boringMeetings = null;
  33. try {
  34. boringMeetings = persistenceManager.executeQuery(query);
  35. } catch (EntityException e) {
  36. // Log an error
  37. }
  38. return boringMeetings;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement