public static BridgeInvocation_c createProxy(
     ModelRoot modelRoot,
     java.util.UUID p_m_statement_id,
     java.util.UUID p_m_brg_id,
     int p_m_bridgenamelinenumber,
     int p_m_bridgenamecolumn,
     int p_m_externalentitykeyletterslinenumber,
     int p_m_externalentitykeyletterscolumn,
     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(BridgeInvocation_c.class);
   BridgeInvocation_c new_inst = null;
   synchronized (instances) {
     Object[] key = {p_m_statement_id};
     new_inst = (BridgeInvocation_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_brg_id = IdAssigner.preprocessUUID(p_m_brg_id);
       new_inst.m_bridgenamelinenumber = p_m_bridgenamelinenumber;
       new_inst.m_bridgenamecolumn = p_m_bridgenamecolumn;
       new_inst.m_externalentitykeyletterslinenumber = p_m_externalentitykeyletterslinenumber;
       new_inst.m_externalentitykeyletterscolumn = p_m_externalentitykeyletterscolumn;
     }
   }
   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 BridgeInvocation_c(
             modelRoot,
             p_m_statement_id,
             p_m_brg_id,
             p_m_bridgenamelinenumber,
             p_m_bridgenamecolumn,
             p_m_externalentitykeyletterslinenumber,
             p_m_externalentitykeyletterscolumn);
     new_inst.m_contentPath = contentPath;
   }
   return new_inst;
 }
Пример #2
0
 public static ComponentInComponent_c createProxy(
     ModelRoot modelRoot,
     java.util.UUID p_m_id,
     java.util.UUID p_m_parent_id,
     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(ComponentInComponent_c.class);
   ComponentInComponent_c new_inst = null;
   synchronized (instances) {
     Object[] key = {p_m_id};
     new_inst = (ComponentInComponent_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_id = IdAssigner.preprocessUUID(p_m_id);
       // extract 28 bit value only
       new_inst.m_idLongBased = 0xfffffff & p_m_id.getLeastSignificantBits();
       // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
       new_inst.m_parent_id = IdAssigner.preprocessUUID(p_m_parent_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 ComponentInComponent_c(modelRoot, p_m_id, p_m_parent_id);
     new_inst.m_contentPath = contentPath;
   }
   return new_inst;
 }