public MyEntity findEntity(String id) {
// Uncomment when you have defined your entity
//
if("new".equals(id)) {
return new MyEntity();
} else {
return em.find(MyEntity.class, id);
}
// ...meanwhile here's a fake entity (remove this when the real one is ready)