private void buildImageForSingleReferences(Map imageMap, ClassDescriptor cld)
{
// register all 1:1 references
Iterator iter = cld.getObjectReferenceDescriptors(true).iterator();
ObjectReferenceDescriptor rds;
while(iter.hasNext())
{
rds = (ObjectReferenceDescriptor) iter.next();
/*
arminw:
if a "super-reference" is matched (a 1:1 reference used to represent a super class)
we don't handle it, because this will be done by the PB-api and will never be change
*/
if(!rds.isSuperReferenceDescriptor())
{
Object referenceObject = rds.getPersistentField().get(myObj);
IndirectionHandler handler = ProxyHelper.getIndirectionHandler(referenceObject);
/*
arminw:
if object was serialized and anonymous FK are used in the main object, the FK
values are null, we have to refresh (re-assign) these values before building field images.
This will not touch the main object itself, because we only reassign anonymous FK fields.
*/
if(handler == null && referenceObject != null
&& BrokerHelper.hasAnonymousKeyReference(rds.getClassDescriptor(), rds))
{
getBroker().serviceBrokerHelper().link(myObj, rds, false);
}
Image.SingleRef singleRef = new Image.SingleRef(this, rds, referenceObject);
imageMap.put(rds, singleRef);