Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.     @Override
  2.     public Set<Project> findAllProjects(boolean onlyActive, boolean onlyCommercial) throws DataAccessException {
  3.         String hql;
  4.         if (onlyActive && onlyCommercial) {
  5.             hql = "from Project p where p.commercial = true and p.active = true";
  6.         } else if (onlyActive) {
  7.             hql = "from Project p where p.active = true";
  8.         } else if (onlyCommercial) {
  9.             hql = "from Project p where p.commercial = true";
  10.         } else {
  11.             hql = "from Project p";
  12.         }
  13.         return new HashSet<>((java.util.Collection<? extends Project>) hibernateOperations.find(hql));
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement