@Test public void testSetNull() { getEntityManager().createQuery("UPDATE DomainGroup SET stickyActivityId = 6793 WHERE id = 2").executeUpdate(); Long activityId = (Long) getEntityManager().createQuery( "SELECT stickyActivityId FROM DomainGroup WHERE id = 2").getSingleResult(); assertEquals((Long) 6793L, activityId); getEntityManager().clear(); sut.execute(new UpdateStickyActivityRequest(2L, null)); getEntityManager().clear(); activityId = (Long) getEntityManager().createQuery("SELECT stickyActivityId FROM DomainGroup WHERE id = 2") .getSingleResult(); assertNull(activityId); }
@Override public Void execute(final UpdateStickyActivityRequest inRequest) { getEntityManager().createQuery("UPDATE DomainGroup SET stickyActivityId = :activityId WHERE id = :id") .setParameter("id", inRequest.getStreamEntityId()) .setParameter("activityId", inRequest.getActivityId()).executeUpdate(); return null; }
UpdateGroupStickyActivityDbMapper extends BaseArgDomainMapper<UpdateStickyActivityRequest, Void> { @Override public Void execute(final UpdateStickyActivityRequest inRequest) { getEntityManager().createQuery("UPDATE DomainGroup SET stickyActivityId = :activityId WHERE id = :id") .setParameter("id", inRequest.getStreamEntityId()) .setParameter("activityId", inRequest.getActivityId()).executeUpdate(); return null; } }
UpdateGroupStickyActivityDbMapper extends BaseArgDomainMapper<UpdateStickyActivityRequest, Void> { @Override public Void execute(final UpdateStickyActivityRequest inRequest) { getEntityManager().createQuery("UPDATE DomainGroup SET stickyActivityId = :activityId WHERE id = :id") .setParameter("id", inRequest.getStreamEntityId()) .setParameter("activityId", inRequest.getActivityId()).executeUpdate(); return null; }  }
UpdateGroupStickyActivityDbMapper extends BaseArgDomainMapper<UpdateStickyActivityRequest, Void> { @Override public Void execute(final UpdateStickyActivityRequest inRequest) { getEntityManager().createQuery("UPDATE DomainGroup SET stickyActivityId = :activityId WHERE id = :id") .setParameter("id", inRequest.getStreamEntityId()) .setParameter("activityId", inRequest.getActivityId()).executeUpdate(); return null; }  @Override Void execute(final UpdateStickyActivityRequest inRequest); }
UpdateGroupStickyActivityDbMapper extends BaseArgDomainMapper<UpdateStickyActivityRequest, Void> { @Override public Void execute(final UpdateStickyActivityRequest inRequest) { getEntityManager().createQuery("UPDATE DomainGroup SET stickyActivityId = :activityId WHERE id = :id") .setParameter("id", inRequest.getStreamEntityId()) .setParameter("activityId", inRequest.getActivityId()).executeUpdate(); return null; }  @Override Void execute(final UpdateStickyActivityRequest inRequest);  }