final GrailsDomainClass domainClass = property.getDomainClass();
// only apply default nullable to Groovy entities not legacy Java ones
if (!GroovyObject.class.isAssignableFrom(domainClass.getClazz())) return false;
final GrailsDomainClassProperty versionProperty = domainClass.getVersion();
final boolean isVersion = versionProperty != null && versionProperty.equals(property);
return !constrained.hasAppliedConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT) &&
isConstrainableProperty(property, propertyName) && !property.isIdentity() && !isVersion && !property.isDerived();
}