public static JPAModelProperty of(String role) { int lastDotIndex = role.lastIndexOf('.'); String className = role.substring(0, lastDotIndex); String propertyName = role.substring(lastDotIndex +1); Class<?> javaType; try { javaType = Class.forName(className); } catch (ClassNotFoundException ex) { throw new AssertionError("Internal bug", ex); } return (JPAModelProperty)ModelClass.of(javaType).getProperties().get(propertyName); }
public static JPAModelClass of(Class<?> javaType) { ModelClass modelClass = ModelClass.of(javaType); if (!(modelClass instanceof JPAModelClass)) { throw new IllegalArgumentException( onlyUsesObjectModel4Java(javaType, Model.class, JPAModel.class) ); } return (JPAModelClass)modelClass; }
modelClass = ModelClass.of(mappedClass); } catch (RuntimeException | Error ex) { throw new IllegalProgramException(
@SuppressWarnings("rawtypes") @Override public Getter getGetter(Class theClass, String propertyName) throws PropertyNotFoundException { ModelClass modelClass= ModelClass.of(theClass); JPAModelProperty property = (JPAModelProperty)modelClass.getProperties().get(propertyName); switch (property.getPropertyType()) {
@SuppressWarnings("rawtypes") @Override public Setter getSetter(Class theClass, String propertyName) throws PropertyNotFoundException { ModelClass modelClass= ModelClass.of(theClass); JPAModelProperty property = (JPAModelProperty)modelClass.getProperties().get(propertyName); switch (property.getPropertyType()) {