return em.find(type, id);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private <T> SingularAttribute<?, ?> getIdProperty(final Class type) {
IdentifiableType entity = em.getMetamodel().entity(type);
Type<?> idType = entity.getIdType();
checkArgument(idType != null, "Entity %s must have an id property for @Load.", type.getSimpleName());
if (hasSupertype(entity)) {
entity = entity.getSupertype();
}
return entity.getDeclaredId(idType.getJavaType());
}