DatabaseMapping xdm = xdesc.getMappingForAttributeName(attributeName);
dm.setAttributeAccessor(new BaseEntityAccessor(attributeName, idx));
if (xdm != null) {
if (dm.isForeignReferenceMapping()) {
ForeignReferenceMapping frm = (ForeignReferenceMapping)dm;
if (frm.usesIndirection() && frm.getIndirectionPolicy().getClass().
isAssignableFrom(BasicIndirectionPolicy.class)) {
xdm.setAttributeAccessor(new BaseEntityVHAccessor(attributeName, idx));
} else {
// no indirection or indirection that is transparent enough (!) to work
xdm.setAttributeAccessor(new BaseEntityAccessor(attributeName, idx));