@Test public void testExecute() { final long userid = 98L; Query query = getEntityManager().createQuery("FROM PersonCryptoKey WHERE personId=" + userid); assertTrue(query.getResultList().isEmpty()); byte[] key = "Some Data".getBytes(); sut.refresh(userid, key); List list = query.getResultList(); assertEquals(1, list.size()); PersonCryptoKey entity = (PersonCryptoKey) list.get(0); assertEquals(userid, entity.getPersonId()); Assert.assertArrayEquals(key, entity.getKey()); }
@Override public void refresh(final Long inRequest, final byte[] inResponse) { PersonCryptoKey entity = new PersonCryptoKey(inRequest, inResponse); getEntityManager().persist(entity); }
PersonCryptoKeyDbRefreshStrategy extends BaseDomainMapper implements RefreshStrategy<Long, byte[]> { @Override public void refresh(final Long inRequest, final byte[] inResponse) { PersonCryptoKey entity = new PersonCryptoKey(inRequest, inResponse); getEntityManager().persist(entity); } }
PersonCryptoKeyDbRefreshStrategy extends BaseDomainMapper implements RefreshStrategy<Long, byte[]> { @Override public void refresh(final Long inRequest, final byte[] inResponse) { PersonCryptoKey entity = new PersonCryptoKey(inRequest, inResponse); getEntityManager().persist(entity); }  }
PersonCryptoKeyDbRefreshStrategy extends BaseDomainMapper implements RefreshStrategy<Long, byte[]> { @Override public void refresh(final Long inRequest, final byte[] inResponse) { PersonCryptoKey entity = new PersonCryptoKey(inRequest, inResponse); getEntityManager().persist(entity); }  @Override void refresh(final Long inRequest, final byte[] inResponse); }
PersonCryptoKeyDbRefreshStrategy extends BaseDomainMapper implements RefreshStrategy<Long, byte[]> { @Override public void refresh(final Long inRequest, final byte[] inResponse) { PersonCryptoKey entity = new PersonCryptoKey(inRequest, inResponse); getEntityManager().persist(entity); }  @Override void refresh(final Long inRequest, final byte[] inResponse);  }