* @see nexj.core.persistence.GenericPersistenceAdapter#addClassWork(nexj.core.runtime.UnitOfWork, nexj.core.runtime.Instance, nexj.core.persistence.Work, nexj.core.meta.persistence.ClassMapping)
*/
protected Work addClassWork(UnitOfWork uow, Instance instance,
Work primaryWork, ClassMapping assocMapping)
{
PersistenceMapping mapping = instance.getPersistenceMapping();
RelationalClassMapping relAssocMapping = (RelationalClassMapping)assocMapping;
SQLWork work = findWork(uow, instance, relAssocMapping.getSourceKey().getTable());
if (work == null)
{
if (primaryWork.getType() == SQLWork.UPDATE)
{
((SQLUpdate)primaryWork).touch();
}
work = addWork(uow, primaryWork.getType(), instance, relAssocMapping.getSourceKey().getTable());
primaryWork.addSuccessor(work, relAssocMapping.getSourceKey().getTable().getPrimaryKey(), mapping.getObjectKey());
}
return work;
}