@Test
public void testEmbeddable()
{
SingularEntityEmbeddable entity = new SingularEntityEmbeddable();
entity.setKey(1);
entity.setName("entity");
entity.setField("name");
EmbeddableEntity embed1 = new EmbeddableEntity();
embed1.setField("embeddedField1");
EmbeddableEntityTwo embed2 = new EmbeddableEntityTwo();
embed2.setField(1f);
embed2.setName("name");
entity.setEmbeddableEntity(embed1);
entity.setEmbeddableEntityTwo(embed2);
em.persist(entity);
SingularEntityEmbeddable p = em.find(SingularEntityEmbeddable.class, 1);
Assert.assertNotNull(p);
p.getEmbeddableEntity().setField("embeddedFieldChange");
em.merge(p);
p = em.find(SingularEntityEmbeddable.class, 1);
Assert.assertEquals("embeddedFieldChange", p.getEmbeddableEntity().getField());
}