{
inst = (Instance)value;
bNull = (inst == null);
}
ClassMapping assocMapping = (ClassMapping)attributeMapping;
boolean bSuccessor;
// TODO: Update composition mappings
if (assocMapping.getKey(false).isObjectKey())
{
bSuccessor = true;
}
else if (assocMapping.getKey(true).isObjectKey())
{
bSuccessor = false;
}
else if (attribute.isCollection())
{
bSuccessor = true;
}
else
{
bSuccessor = false;
}
if (bSuccessor)
{
if (!bNull)
{
if (list == null)
{
inst.getAdapter().addDependency(uow, primaryWork, inst,
assocMapping.getKey(true), assocMapping.getKey(false), true);
}
else
{
for (int k = 0; k < list.getCount(); ++k)
{
inst = list.getInstance(k);
if (inst != null)
{
inst.getAdapter().addDependency(uow, primaryWork, inst,
assocMapping.getKey(true), assocMapping.getKey(false), true);
}
}
}
}
}
else
{
Work work = addClassWork(uow, instance, primaryWork, assocMapping);
if (bNull)
{
if (assocMapping.getKey(false) != mapping.getObjectKey())
{
work.setKeyValue(assocMapping.getKey(false), assocMapping.getKey(true), null);
}
}
else
{
if (list != null)
{
inst = list.getInstance(0);
}
if (inst.getOID() != null)
{
if (assocMapping.getKey(false) != mapping.getObjectKey())
{
work.setKeyValue(assocMapping.getKey(false), assocMapping.getKey(true), inst);
}
}
else
{
inst.getAdapter().addDependency(uow, work, inst,
assocMapping.getKey(false), assocMapping.getKey(true), false);
}
}
}
}