class ClientWithNullableParentKeyValueProvider
implements ValueProvider<PersonProxy, Long>
{
PersonProxy object;
ClientWithNullableParentKeyValueProvider(PersonProxy object){
this.object=object;
}

@Override
public Long getValue(PersonProxy object) {
return object.getParentKey() == null ? null : object.getParent().getParentKey();
}


@Override
public void setValue(PersonProxy object, Long value) {
if (object.getParent() == null) {
object.setParent(cproxy);
}
object.getParent().setParentKey(value);
}


@Override
public String getPath() {
return "parent.parentKey";
}
}Its working with Proxy.

Real credit goes to Colin!