@Test public void testExecuteWithOriginalActorActivities() { final Long activityId1 = 6789L; final Long activityId2 = 6790L; final Long activityId3 = 6791L; final Long activityId4 = 6793L; List<Long> actual = sut.execute("smithers", EntityType.PERSON); Collections.sort(actual); List<Long> expected = new ArrayList<Long>(); expected.add(activityId1); expected.add(activityId2); expected.add(activityId3); expected.add(activityId4); assertEquals(expected, actual); }
@SuppressWarnings("unchecked") public List<Long> execute(final String inAuthorId, final EntityType inAuthorEntityType) { return (List<Long>) getEntityManager() .createQuery( "SELECT id FROM Activity WHERE (actorId=:actorId AND actorType=:actorType) " + "OR (originalActorId=:actorId AND originalActorType=:actorType)") .setParameter("actorId", inAuthorId).setParameter("actorType", inAuthorEntityType).getResultList(); }
GetActivityIdsAuthoredByOrOriginallyAuthoredByEntity extends
        BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final String inAuthorId, final EntityType inAuthorEntityType) { return (List<Long>) getEntityManager() .createQuery( "SELECT id FROM Activity WHERE (actorId=:actorId AND actorType=:actorType) " + "OR (originalActorId=:actorId AND originalActorType=:actorType)") .setParameter("actorId", inAuthorId).setParameter("actorType", inAuthorEntityType).getResultList(); } }
GetActivityIdsAuthoredByOrOriginallyAuthoredByEntity extends
        BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final String inAuthorId, final EntityType inAuthorEntityType) { return (List<Long>) getEntityManager() .createQuery( "SELECT id FROM Activity WHERE (actorId=:actorId AND actorType=:actorType) " + "OR (originalActorId=:actorId AND originalActorType=:actorType)") .setParameter("actorId", inAuthorId).setParameter("actorType", inAuthorEntityType).getResultList(); }  }
GetActivityIdsAuthoredByOrOriginallyAuthoredByEntity extends
        BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final String inAuthorId, final EntityType inAuthorEntityType) { return (List<Long>) getEntityManager() .createQuery( "SELECT id FROM Activity WHERE (actorId=:actorId AND actorType=:actorType) " + "OR (originalActorId=:actorId AND originalActorType=:actorType)") .setParameter("actorId", inAuthorId).setParameter("actorType", inAuthorEntityType).getResultList(); }  @SuppressWarnings("unchecked") List<Long> execute(final String inAuthorId,
            final EntityType inAuthorEntityType); }
GetActivityIdsAuthoredByOrOriginallyAuthoredByEntity extends
        BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final String inAuthorId, final EntityType inAuthorEntityType) { return (List<Long>) getEntityManager() .createQuery( "SELECT id FROM Activity WHERE (actorId=:actorId AND actorType=:actorType) " + "OR (originalActorId=:actorId AND originalActorType=:actorType)") .setParameter("actorId", inAuthorId).setParameter("actorType", inAuthorEntityType).getResultList(); }  @SuppressWarnings("unchecked") List<Long> execute(final String inAuthorId,
            final EntityType inAuthorEntityType);  }