@Test public void testExecute() { final long userid = 4507L; Query query = getEntityManager().createQuery("FROM GroupMembershipRequests WHERE groupId=8 and personId=" + userid); assertFalse(query.getResultList().isEmpty()); Boolean result = sut.execute(new RequestForGroupMembershipRequest(8L, userid)); assertTrue(result); assertTrue(query.getResultList().isEmpty()); }
@Override public Boolean execute(final RequestForGroupMembershipRequest inRequest) { long groupId = inRequest.getGroupId(); long personId = inRequest.getPersonId(); final String queryText = "DELETE FROM GroupMembershipRequests WHERE groupId=:groupId AND personId = :personId"; int count = getEntityManager().createQuery(queryText).setParameter("groupId", groupId).setParameter("personId", personId).executeUpdate(); return count > 0; }
DeleteRequestForGroupMembership extends
        BaseArgDomainMapper<RequestForGroupMembershipRequest, Boolean> { @Override public Boolean execute(final RequestForGroupMembershipRequest inRequest) { long groupId = inRequest.getGroupId(); long personId = inRequest.getPersonId(); final String queryText = "DELETE FROM GroupMembershipRequests WHERE groupId=:groupId AND personId = :personId"; int count = getEntityManager().createQuery(queryText).setParameter("groupId", groupId).setParameter("personId", personId).executeUpdate(); return count > 0; } }
DeleteRequestForGroupMembership extends
        BaseArgDomainMapper<RequestForGroupMembershipRequest, Boolean> { @Override public Boolean execute(final RequestForGroupMembershipRequest inRequest) { long groupId = inRequest.getGroupId(); long personId = inRequest.getPersonId(); final String queryText = "DELETE FROM GroupMembershipRequests WHERE groupId=:groupId AND personId = :personId"; int count = getEntityManager().createQuery(queryText).setParameter("groupId", groupId).setParameter("personId", personId).executeUpdate(); return count > 0; }  }
DeleteRequestForGroupMembership extends
        BaseArgDomainMapper<RequestForGroupMembershipRequest, Boolean> { @Override public Boolean execute(final RequestForGroupMembershipRequest inRequest) { long groupId = inRequest.getGroupId(); long personId = inRequest.getPersonId(); final String queryText = "DELETE FROM GroupMembershipRequests WHERE groupId=:groupId AND personId = :personId"; int count = getEntityManager().createQuery(queryText).setParameter("groupId", groupId).setParameter("personId", personId).executeUpdate(); return count > 0; }  @Override Boolean execute(final RequestForGroupMembershipRequest inRequest); }
DeleteRequestForGroupMembership extends
        BaseArgDomainMapper<RequestForGroupMembershipRequest, Boolean> { @Override public Boolean execute(final RequestForGroupMembershipRequest inRequest) { long groupId = inRequest.getGroupId(); long personId = inRequest.getPersonId(); final String queryText = "DELETE FROM GroupMembershipRequests WHERE groupId=:groupId AND personId = :personId"; int count = getEntityManager().createQuery(queryText).setParameter("groupId", groupId).setParameter("personId", personId).executeUpdate(); return count > 0; }  @Override Boolean execute(final RequestForGroupMembershipRequest inRequest);  }