final String userId = "1";
final int tweetId = 12;
final UUID timeLineId = UUID.randomUUID();
final Date tweetDate = new Date();
CouchDBCompoundKey embeddable = new CouchDBCompoundKey(userId, tweetId, timeLineId);
CouchDBEmbeddedUser user = new CouchDBEmbeddedUser(userId);
user.setTweetBody("My tweet");
user.setTweetDate(tweetDate);
user.setEmbeddable(embeddable);
em.persist(user);
em.clear(); // clear cache.
CouchDBEmbeddedUser found = em.find(CouchDBEmbeddedUser.class, userId);
Assert.assertNotNull(found);
Assert.assertNotNull(found.getUserId());
Assert.assertEquals(userId, found.getEmbeddable().getUserId());
Assert.assertEquals(tweetDate, found.getTweetDate());
em.remove(found);
em.clear(); // clear cache.
found = em.find(CouchDBEmbeddedUser.class, userId);