public static AssignToMember_c createProxy( ModelRoot modelRoot, java.util.UUID p_m_statement_id, java.util.UUID p_m_r_value_id, java.util.UUID p_m_l_value_id, int p_m_attributelinenumber, int p_m_attributecolumn, String p_contentPath, IPath p_localPath) { ModelRoot resolvedModelRoot = ModelRoot.findModelRoot(modelRoot, p_contentPath, p_localPath); // if a model root was not resolved it is most likely // due to a missing file of the proxy, defualt back to // the original model root if (resolvedModelRoot != null) modelRoot = resolvedModelRoot; InstanceList instances = modelRoot.getInstanceList(AssignToMember_c.class); AssignToMember_c new_inst = null; synchronized (instances) { Object[] key = {p_m_statement_id}; new_inst = (AssignToMember_c) instances.get(key); } String contentPath = PersistenceUtil.resolveRelativePath(p_localPath, new Path(p_contentPath)); if (modelRoot.isNewCompareRoot()) { // for comparisons we do not want to change // the content path contentPath = p_contentPath; } if (new_inst != null && !modelRoot.isCompareRoot()) { PersistableModelComponent pmc = new_inst.getPersistableComponent(); if (pmc == null) { // dangling reference, redo this instance new_inst.batchUnrelate(); // pre-process the uuid so that we re-use null uuid instance rather then creating a new one. new_inst.m_statement_id = IdAssigner.preprocessUUID(p_m_statement_id); // pre-process the uuid so that we re-use null uuid instance rather then creating a new one. new_inst.m_r_value_id = IdAssigner.preprocessUUID(p_m_r_value_id); new_inst.m_attributelinenumber = p_m_attributelinenumber; new_inst.m_attributecolumn = p_m_attributecolumn; // pre-process the uuid so that we re-use null uuid instance rather then creating a new one. new_inst.m_l_value_id = IdAssigner.preprocessUUID(p_m_l_value_id); } } if (new_inst == null) { // there is no instance matching the id, create a proxy // if the resource doesn't exist then this will be a dangling reference new_inst = new AssignToMember_c( modelRoot, p_m_statement_id, p_m_r_value_id, p_m_l_value_id, p_m_attributelinenumber, p_m_attributecolumn); new_inst.m_contentPath = contentPath; } return new_inst; }
public static AssignToMember_c resolveInstance( ModelRoot modelRoot, java.util.UUID p_m_statement_id, java.util.UUID p_m_r_value_id, java.util.UUID p_m_l_value_id, int p_m_attributelinenumber, int p_m_attributecolumn) { InstanceList instances = modelRoot.getInstanceList(AssignToMember_c.class); AssignToMember_c source = null; synchronized (instances) { Object[] key = {p_m_statement_id}; source = (AssignToMember_c) instances.get(key); if (source != null && !modelRoot.isCompareRoot()) { source.convertFromProxy(); source.batchUnrelate(); // pre-process the uuid so that we re-use null uuid instance rather then creating a new one. source.m_statement_id = IdAssigner.preprocessUUID(p_m_statement_id); // pre-process the uuid so that we re-use null uuid instance rather then creating a new one. source.m_r_value_id = IdAssigner.preprocessUUID(p_m_r_value_id); source.m_attributelinenumber = p_m_attributelinenumber; source.m_attributecolumn = p_m_attributecolumn; // pre-process the uuid so that we re-use null uuid instance rather then creating a new one. source.m_l_value_id = IdAssigner.preprocessUUID(p_m_l_value_id); return source; } } // there is no instance matching the id AssignToMember_c new_inst = new AssignToMember_c( modelRoot, p_m_statement_id, p_m_r_value_id, p_m_l_value_id, p_m_attributelinenumber, p_m_attributecolumn); return new_inst; }