try {
Class valueClass = ClickUtils.classForName(classField.getValue());
String classname = getClassname(valueClass);
ClassMetadata metadata = getSessionFactory().getClassMetadata(classname);
String[] propertyNames = metadata.getPropertyNames();
boolean[] propertyNullability = metadata.getPropertyNullability();
for (int i = 0; i < propertyNames.length; i++) {
Field field = getField(propertyNames[i]);
if (field != null) {
field.setRequired(propertyNullability[i]);