@Test public void testFindByActorIncludeCommon() { deleteAll(); Actor user = this.createActor(Actor.TYPE_USER, "user1", null); this.actorService.save(user); Assert.assertNotNull(user.getId()); Shortcut shortcut4user = this.createShortcut(user, null, "01"); shortcut4user.setActorId(user.getId()); this.shortcutService.save(shortcut4user); Assert.assertNotNull(shortcut4user.getId()); Shortcut shortcut4common = this.createShortcut(null, null, "00"); this.shortcutService.save(shortcut4common); Assert.assertNotNull(shortcut4common.getId()); List<Shortcut> shortcuts = this.shortcutService.findByActor( user.getId(), false, true); Assert.assertNotNull(shortcuts); Assert.assertEquals(2, shortcuts.size()); Assert.assertEquals(shortcut4common, shortcuts.get(0)); Assert.assertEquals(shortcut4user, shortcuts.get(1)); }
public List<Shortcut> findByActor(Long actorId) { return this.shortcutDao.findByActor(actorId, true, true); }
ShortcutServiceImpl extends DefaultCrudService<Shortcut> implements
  ShortcutService { public List<Shortcut> findByActor(Long actorId) { return this.shortcutDao.findByActor(actorId, true, true); } }
ShortcutServiceImpl extends DefaultCrudService<Shortcut> implements
  ShortcutService { public List<Shortcut> findByActor(Long actorId) { return this.shortcutDao.findByActor(actorId, true, true); }  }
ShortcutServiceImpl extends DefaultCrudService<Shortcut> implements
  ShortcutService { public List<Shortcut> findByActor(Long actorId) { return this.shortcutDao.findByActor(actorId, true, true); }  @Autowired void setShortcutDao(ShortcutDao shortcutDao); List<Shortcut> findCommon(); List<Shortcut> findByActor(Long actorId); List<Shortcut> findByActor(Long actorId, boolean includeAncestor,
                                    boolean includeCommon); List<Shortcut> findByActor(Long actorId,
                                    Set<Actor> ancestorOrganizations, Set<Role> roles,
                                    Set<Resource> modules); }
ShortcutServiceImpl extends DefaultCrudService<Shortcut> implements
  ShortcutService { public List<Shortcut> findByActor(Long actorId) { return this.shortcutDao.findByActor(actorId, true, true); }  @Autowired void setShortcutDao(ShortcutDao shortcutDao); List<Shortcut> findCommon(); List<Shortcut> findByActor(Long actorId); List<Shortcut> findByActor(Long actorId, boolean includeAncestor,
                                    boolean includeCommon); List<Shortcut> findByActor(Long actorId,
                                    Set<Actor> ancestorOrganizations, Set<Role> roles,
                                    Set<Resource> modules);  }