Creates an empty attribute.<p>

@param parentEntity the parent entity
@param attributeName the attribute name
@param handler the attribute handler
@param minOccurrence the minimum occurrence of the attribute

@return the entity attribute
770427
protected CmsEntityAttribute createEmptyAttribute(
        CmsEntity parentEntity,
        String attributeName,
        CmsAttributeHandler handler,
        int minOccurrence) {

        CmsEntityAttribute result = null;
        CmsType attributeType = m_entityBackEnd.getType(parentEntity.getTypeName()).getAttributeType(attributeName);
        if (attributeType.isSimpleType()) {
            for (int i = 0; i < minOccurrence; i++) {
                parentEntity.addAttributeValue(
                    attributeName,
                    m_widgetService.getDefaultAttributeValue(attributeName, handler.getSimplePath(i)));
            }
            result = parentEntity.getAttribute(attributeName);
        } else {
            for (int i = 0; i < minOccurrence; i++) {
                parentEntity.addAttributeValue(
                    attributeName,
                    m_entityBackEnd.createEntity(null, attributeType.getId()));
            }
            result = parentEntity.getAttribute(attributeName);
        }
        return result;
    }
889925
@Override
  public ExecutionEntity createChildExecution(ExecutionEntity parentExecutionEntity) {
    ExecutionEntity childExecution = executionDataManager.create();
    inheritCommonProperties(parentExecutionEntity, childExecution);
    childExecution.setParent(parentExecutionEntity);
    childExecution.setProcessDefinitionId(parentExecutionEntity.getProcessDefinitionId());
    childExecution.setProcessDefinitionKey(parentExecutionEntity.getProcessDefinitionKey());
    childExecution.setProcessInstanceId(parentExecutionEntity.getProcessInstanceId() != null 
        ? parentExecutionEntity.getProcessInstanceId() : parentExecutionEntity.getId());
    childExecution.setParentProcessInstanceId(parentExecutionEntity.getParentProcessInstanceId());
    childExecution.setScope(false);

    // manage the bidirectional parent-child relation
    parentExecutionEntity.addChildExecution(childExecution);
    
    // Insert the child execution
    insert(childExecution, false);

    if (logger.isDebugEnabled()) {
      logger.debug("Child execution {} created with parent {}", childExecution, parentExecutionEntity.getId());
    }

    if (getEventDispatcher().isEnabled()) {
      getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_CREATED, childExecution));
      getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.ENTITY_INITIALIZED, childExecution));
    }

    return childExecution;
  }
991667
private void addAttributeInternal(EntityType entityType, Attribute attr) {
    if (!isPersisted(attr)) {
      return;
    }

    if (isMultipleReferenceType(attr)) {
      createJunctionTable(entityType, attr);

      if (attr.getDefaultValue() != null && !attr.isNillable()) {
        @SuppressWarnings("unchecked")
        Iterable<Entity> defaultRefEntities =
            (Iterable<Entity>) AttributeUtils.getDefaultTypedValue(attr);
        if (!Iterables.isEmpty(defaultRefEntities)) {
          createJunctionTableRows(entityType, attr, defaultRefEntities);
        }
      }
    } else {
      createColumn(entityType, attr);
    }
  }
1365752
public void addAttributeValueEntity(String attributeName, CmsEntityWrapper value) {

        m_entity.addAttributeValue(attributeName, value.getEntity());
    }
783225
private AstNode attributeAccess()
        throws IOException
    {
        int tt = nextToken(), atPos = ts.tokenBeg;

        switch (tt) {
          // handles: @name, @ns::name, @ns::*, @ns::[expr]
          case Token.NAME:
              return propertyName(atPos, ts.getString(), 0);

          // handles: @*, @*::name, @*::*, @*::[expr]
          case Token.MUL:
              saveNameTokenData(ts.tokenBeg, "*", ts.lineno);
              return propertyName(atPos, "*", 0);

          // handles @[expr]
          case Token.LB:
              return xmlElemRef(atPos, null, -1);

          default:
              reportError("msg.no.name.after.xmlAttr");
              return makeErrorNode();
        }
    }
1123139
protected static CmsEntity createDefaultValueEntity(
        CmsType entityType,
        Map<String, CmsType> entityTypes,
        Map<String, CmsAttributeConfiguration> attributeConfigurations) {

        CmsEntity result = new CmsEntity(null, entityType.getId());
        for (String attributeName : entityType.getAttributeNames()) {
            CmsType attributeType = entityTypes.get(entityType.getAttributeTypeName(attributeName));
            for (int i = 0; i < entityType.getAttributeMinOccurrence(attributeName); i++) {
                if (attributeType.isSimpleType()) {
                    result.addAttributeValue(
                        attributeName,
                        attributeConfigurations.get(attributeName).getDefaultValue());
                } else {
                    result.addAttributeValue(
                        attributeName,
                        createDefaultValueEntity(attributeType, entityTypes, attributeConfigurations));
                }
            }
        }
        return result;
    }
1105600
@Nullable
  public HtmlAttributeNode getDirectAttributeNamed(String attrName) {
    // the child at index 0 is the tag name
    for (int i = 1; i < numChildren(); i++) {
      StandaloneNode child = getChild(i);
      if (child instanceof HtmlAttributeNode) {
        HtmlAttributeNode attr = (HtmlAttributeNode) child;
        if (attr.definitelyMatchesAttributeName(attrName)) {
          return attr;
        }
      }
    }
    return null;
  }
1040704
public ManagedEntity findChild(ManagedEntity parent, String name) throws RuntimeFault, RemoteException {
        if (parent == null) {
            throw new IllegalArgumentException("parent entity must not be null.");
        }
        ManagedObjectReference mor = getVimService().findChild(getMOR(), parent.getMOR(), name);
        return MorUtil.createExactManagedEntity(getServerConnection(), mor);
    }
383412
@Override
    public S createFrom(
        TimeSource<?> clock,
        AttributeQuery attributes
    ) {

        T temporal = this.delegate.createFrom(clock, attributes);
        return ((temporal == null) ? null : this.converter.from(temporal));

    }
867775
private AttributeWrapper wrap(EntityMetadata entityMetadata, Object entity)
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());

        EntityType entityType = metaModel.entity(entityMetadata.getEntityClazz());
        Set<Attribute> attributes = entityType.getAttributes();

        // attributes can be null??? i guess NO
        AttributeWrapper wrapper = new AttributeWrapper(attributes.size());

        List<String> relationNames = entityMetadata.getRelationNames();

        // PropertyAccessorHelper.get(entity,
        for (Attribute attr : attributes)
        {
            if (/* !entityMetadata.getIdAttribute().equals(attr) && */!attr.isAssociation())
            {
                if (metaModel.isEmbeddable(((AbstractAttribute) attr).getBindableJavaType()))
                {
                    EmbeddableType embeddableAttribute = metaModel.embeddable(((AbstractAttribute) attr)
                            .getBindableJavaType());

                    Object embeddedObject = PropertyAccessorHelper.getObject(entity, (Field) attr.getJavaMember());

                    Set<Attribute> embeddedAttributes = embeddableAttribute.getAttributes();

                    for (Attribute attrib : embeddedAttributes)
                    {
                        addToWrapper(entityMetadata, wrapper, embeddedObject, attrib, attr);
                    }

                }
                else
                {
                    addToWrapper(entityMetadata, wrapper, entity, attr);
                }
            }
            else if (attributes.size() == 1) // means it is only a key! weird
                                             // but possible negative
                                             // scenario
            {
                byte[] value = PropertyAccessorHelper.get(entity, (Field) attr.getJavaMember());
                byte[] name;
                name = getEncodedBytes(((AbstractAttribute) attr).getJPAColumnName());

                // add column name as key and value as value
                wrapper.addColumn(name, value);

            }
        }

        return wrapper;
    }
183860
public static String concatMetaAttributeHref(
      String baseUri, String entityParentName, String attributeName) {
    return String.format(
        "%s/%s/meta/%s",
        baseUri, encodePathSegment(entityParentName), encodePathSegment(attributeName));
  }
871797
public Namer getInverseOneToOneNamer(Attribute fromAttribute, Namer fromEntityNamer) {
        Namer result = getInverseOneToOneNamerFromConf(fromAttribute.getColumnConfig(), fromEntityNamer);

        if (result == null) {
            result = fromEntityNamer;
        }

        return result;
    }
403792
public static void addAttributes(SerializationHandler handler, int src)
        throws TransformerException
    {

        TransformerImpl transformer =
            (TransformerImpl) handler.getTransformer();
        DTM dtm = transformer.getXPathContext().getDTM(src);

        for (int node = dtm.getFirstAttribute(src);
            DTM.NULL != node;
            node = dtm.getNextAttribute(node))
        {
            addAttribute(handler, node);
        }
    }
230294
private AuditEntityAttribute attributes(Entity e) {
        AuditEntityAttribute auditEntityAttributes = new AuditEntityAttribute();
        matchCreationAuthor(e, auditEntityAttributes);
        matchCreationDate(e, auditEntityAttributes);
        matchLastModificationAuthor(e, auditEntityAttributes);
        matchLastModificationDate(e, auditEntityAttributes);
        return auditEntityAttributes;
    }
322302
private void buildEntityFromCursor(Object entity, HashMap obj, EntityType entityType)
    {
        Iterator<Attribute> iter = entityType.getAttributes().iterator();
        while (iter.hasNext())
        {
            Attribute attribute = iter.next();
            Field field = (Field) attribute.getJavaMember();
            if (field.isAnnotationPresent(Id.class))
            {
                PropertyAccessorHelper.set(entity, field, obj.get(ID));
            }
            else
            {
                PropertyAccessorHelper.set(entity, field, obj.get(((AbstractAttribute) attribute).getJPAColumnName()));
            }

        }
    }
1213708
static Stream<Attribute> getPersistedAttributes(EntityType entityType) {
    return stream(entityType.getAtomicAttributes())
        .filter(atomicAttr -> atomicAttr.getExpression() == null);
  }
505892
@Nullable
  public static DefaultEntityResolver createOnDemand (@Nonnull final IReadableResource aBaseResource)
  {
    final URL aURL = aBaseResource.getAsURL ();
    return aURL == null ? null : new DefaultEntityResolver (aURL);
  }