public Metadata get(Class<?> klass) {
return JPAAnnotationMetadata.getMetadata(klass);
}
public Metadata get(Class<?> rootEntityClass, String propertyPath) {
Metadata md = get(rootEntityClass);
if (propertyPath == null || propertyPath.equals("")) {
return md;
} else {
for (String prop : propertyPath.split("\\.")) {
if ("id".equals(prop)) {
md = md.getIdType();
} else {
md = md.getPropertyType(prop);
}
if (md == null)
throw new IllegalArgumentException("Property path '" + propertyPath + "' invalid for type " + rootEntityClass.getName());
}
return md;