| You're code is missing the @NaturalId annotation on the field in MyEntity class. I'm also not sure if your query in the test case will fail. For me it fails with:
Session session = entityManager.unwrap(Session.class);
Section section = session.bySimpleNaturalId(MyEntity.class).load(name);
|