@PersistenceContext
EntityManager em;
@Test
public void embeddedidTest() {
EmbeddableIdCar car = new EmbeddableIdCar(new EmbeddableCarIdentifier("Kia", 2012));
car.setSerialNo("6675");
em.persist(car);
em.flush();
em.clear();
EmbeddableIdCar loaded = em.find(EmbeddableIdCar.class, car.getId());
assertThat(loaded).isNotNull();
assertThat(loaded.getId()).isNotNull();
assertThat(loaded.getId().getBrand()).isEqualTo("Kia");
loaded.setSerialNo("5081");
em.persist(loaded);
em.flush();
em.clear();
loaded = em.find(EmbeddableIdCar.class, new EmbeddableCarIdentifier("Kia", 2012));