Pattern for two different EntityReference have member PhysicalEntity in the same Complex, and
the Complex is controlling a Conversion. Complex membership can be through multiple nesting
and/or through homology relations.
@return the pattern
196511
public static Pattern inSameComplexEffectingConversion()
	{
		Pattern p = inSameComplex();

		p.add(peToControl(), "Complex", "Control");
		p.add(controlToConv(), "Control", "Conversion");
		p.add(new NOT(participantER()), "Control", "first ER");
		p.add(new NOT(participantER()), "Control", "second ER");
		return p;
	}
286782
public Map<String, Class<?>> getEntityNameToClassMap()
    {
        if (entityNameToClassMap == null)
        {
            entityNameToClassMap = new HashMap<String, Class<?>>();
        }
        return entityNameToClassMap;
    }
779893
public static Pattern sequence(Pattern pattern1, Pattern pattern2)
   {
      if (pattern1 == null || pattern2 == null)
      {
         throw new IllegalArgumentException("Neither pattern can be null");
      }
      return new SequencePattern(pattern1, pattern2);
   }
1224536
public List<Entity<EntityMappings<T>>> getAllEntity()
   {
      List<Entity<EntityMappings<T>>> list = new ArrayList<Entity<EntityMappings<T>>>();
      List<Node> nodeList = childNode.get("entity");
      for(Node node: nodeList)
      {
         Entity<EntityMappings<T>>  type = new EntityImpl<EntityMappings<T>>(this, "entity", childNode, node);
         list.add(type);
      }
      return list;
   }
706299
public EntityBeanType<EnterpriseBeansType<T>> getOrCreateEntity()
   {
      List<Node> nodeList = childNode.get("entity");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new EntityBeanTypeImpl<EnterpriseBeansType<T>>(this, "entity", childNode, nodeList.get(0));
      }
      return createEntity();
   }
503484
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "ENTITY")
    public org.openprovenance.prov.model.QualifiedName getEntity() {
        return entity;
    }
265771
public Association getAssociation() {
		if ( association == null ) {
			AssociationKey key = getAssociationKey();

			if ( hostingEntity != null ) {
				OgmEntityEntryState entryState = OgmEntityEntryState.getStateFor( session, hostingEntity );
				if ( entryState.hasAssociation( associationKeyMetadata.getCollectionRole() ) ) {
					association = entryState.getAssociation( associationKeyMetadata.getCollectionRole() );
				}
				else {
					association = gridDialect.getAssociation( key, getAssociationContext() );
					OgmEntityEntryState.getStateFor( session, hostingEntity )
							.setAssociation( associationKeyMetadata.getCollectionRole(), association );
				}
			}
			else {
				association = gridDialect.getAssociation( key, getAssociationContext() );
			}

			if ( association == null ) {
				association = gridDialect.createAssociation( key, getAssociationContext() );
				if ( hostingEntity != null ) {
					OgmEntityEntryState.getStateFor( session, hostingEntity )
							.setAssociation( associationKeyMetadata.getCollectionRole(), association );
				}
			}
		}
		return association;
	}
837144
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "GENERATED_ENTITY")
    public org.openprovenance.prov.model.QualifiedName getGeneratedEntity() {
        return generatedEntity;
    }
260590
protected Entity getEntity() throws ConverterException {
        final String _entity = getConfig("entity");
        if (_entity == null) {
            throw new ConverterException("collection.converter.entity.cannot.be.null");
        }
        final Entity entity = PresentationManager.getPm().getEntity(_entity);
        if (entity == null) {
            throw new ConverterException("collection.converter.entity.cannot.be.null");
        }
        return entity;
    }
1116434
public GraphObject getEntity() throws FrameworkException {

		final GraphObject entity = idResource.getEntity();
		if (entity != null) {

			final String type       = SchemaHelper.normalizeEntityName(typeResource.getRawType());
			final String entityType = entity.getClass().getSimpleName();

			if (GenericNode.class.equals(entity.getClass()) || SearchCommand.getAllSubtypesAsStringSet(type).contains(entityType)) {
				return entity;
			}
		}

		throw new NotFoundException("Entity with ID " + idResource.getUuid() + " not found");
	}
272429
public EntityAnnotation getEntityAnnotation(final String entityUri) {
        return Iterables.find(getEntityAnnotations(),
                new Predicate<EntityAnnotation>() {

                    @Override
                    public boolean apply(EntityAnnotation ea) {
                        return ea.getEntityReference().getUri()
                                .equals(entityUri);
                    }

                }
        );
    }
764318
public FacesConfigReferencedBeanType<FacesConfigType<T>> getOrCreateReferencedBean()
   {
      List<Node> nodeList = childNode.get("referenced-bean");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigReferencedBeanTypeImpl<FacesConfigType<T>>(this, "referenced-bean", childNode, nodeList.get(0));
      }
      return createReferencedBean();
   }
1348482
public List<EntityResult<SqlResultSetMapping<T>>> getAllEntityResult()
   {
      List<EntityResult<SqlResultSetMapping<T>>> list = new ArrayList<EntityResult<SqlResultSetMapping<T>>>();
      List<Node> nodeList = childNode.get("entity-result");
      for(Node node: nodeList)
      {
         EntityResult<SqlResultSetMapping<T>>  type = new EntityResultImpl<SqlResultSetMapping<T>>(this, "entity-result", childNode, node);
         list.add(type);
      }
      return list;
   }
365863
public CmsEntity cloneEntity() {

        CmsEntity clone = new CmsEntity(getId(), getTypeName());
        for (CmsEntityAttribute attribute : getAttributes()) {
            if (attribute.isSimpleValue()) {
                List<String> values = attribute.getSimpleValues();
                for (String value : values) {
                    clone.addAttributeValue(attribute.getAttributeName(), value);
                }
            } else {
                List<CmsEntity> values = attribute.getComplexValues();
                for (CmsEntity value : values) {
                    clone.addAttributeValue(attribute.getAttributeName(), value.cloneEntity());
                }
            }
        }
        return clone;
    }
60671
public Expression reference() {
    if (chunk() instanceof VariableDeclaration) {
      return id(((VariableDeclaration) chunk()).varName(), ImmutableSet.of(this));
    } else {
      return dottedIdWithRequires(symbol(), ImmutableSet.of(this));
    }
  }
689668
private PhysicalEntity getMappedPE(physicalEntityParticipant pep, Model newModel)
	{
		String id = pep2PE.get(pep.getUri());
		physicalEntity pe2er = pep.getPHYSICAL_ENTITY();
		
		if(id == null || pe2er == null)
			throw new IllegalAccessError("Illegal pEP (cannot convert): " 
				+ pep.getUri());
		
		BioPAXElement pe = newModel.getByID(id);
		String inf = "pEP " + pep + " that contains " 
			+ pe2er.getModelInterface().getSimpleName();
		if(!isSimplePhysicalEntity(pe2er)) {
			if(pe == null) {
				if(log.isDebugEnabled())
					log.debug(inf + " gets new ID: " + pe2er.getUri());
				pe = newModel.getByID(pe2er.getUri());
			} else { // error: complex and basic p.entity's pEP 
				throw new IllegalAccessError("Illegal conversion of pEP: " + inf); 
			}
		} else if(pe == null){
			// for a pEP having a simple PE, a new PE should be created
			throw new IllegalAccessError("No PE for: " + inf
					+ " found in the new Model");
		}
		
		return (PhysicalEntity) pe;
	}
1189861
public static Pattern neighborOf()
	{
		Pattern p = new Pattern(SequenceEntityReference.class, "Protein 1");
		p.add(linkedER(true), "Protein 1", "generic Protein 1");
		p.add(erToPE(), "generic Protein 1", "SPE1");
		p.add(linkToComplex(), "SPE1", "PE1");
		p.add(peToInter(), "PE1", "Inter");
		p.add(interToPE(), "Inter", "PE2");
		p.add(linkToSpecific(), "PE2", "SPE2");
		p.add(equal(false), "SPE1", "SPE2");
		p.add(type(SequenceEntity.class), "SPE2");
		p.add(peToER(), "SPE2", "generic Protein 2");
		p.add(linkedER(false), "generic Protein 2", "Protein 2");
		p.add(equal(false), "Protein 1", "Protein 2");
		return p;
	}