Create default entity fetch that fetches all attributes.

@return default entity fetch or null
357982
public static Fetch createDefaultEntityFetch(EntityType entityType, String languageCode) {
    boolean hasRefAttr = false;
    Fetch fetch = new Fetch();
    for (Attribute attr : entityType.getAtomicAttributes()) {
      Fetch subFetch = createDefaultAttributeFetch(attr, languageCode);
      if (subFetch != null) {
        hasRefAttr = true;
      }
      fetch.field(attr.getName(), subFetch);
    }
    return hasRefAttr ? fetch : null;
  }
657937
public function createEmpty()
    {
        $entity = new Entity($this->definition);
        $fields = $this->definition->getEditableFieldNames();
        foreach ($fields as $field) {
            $value = null;
            if ($this->definition->getType($field) == 'fixed') {
                $value = $this->definition->getField($field, 'value');
            }
            $entity->set($field, $value);
        }
        $entity->set('id', null);
        return $entity;
    }
906703
public function fetch($type=SQLAnywhereClient::FETCH_ASSOC)
	{
		$data = null;
		if ($this->result) {
			switch ($type) {
				case 'array':
					$data = sasql_fetch_array( $this->result );
				break;

				case 'assoc':
					$data = sasql_fetch_assoc( $this->result );
				break;

				case 'row':
					$data = sasql_fetch_row( $this->result );
				break;

				case 'field':
					$data = sasql_fetch_field( $this->result );
				break;

				case 'object':
					$data = sasql_fetch_object( $this->result );
				break;
				
				default:
					$data = sasql_fetch_array( $this->result );
				break;
			}		
		}
		return $data;
	}
655485
public function getCreatedBy()
    {
        $createdByAttribute = $this->createdByAttribute;
        return (!is_string($createdByAttribute) || empty($createdByAttribute)) ? null : $this->$createdByAttribute->getData();
    }
1044679
public static function getGeneral()
	{
		$user = new User();
		$entity = self::createGeneral();
		$user->setEntity($entity);
		return $user;
	}
914686
public void populate(Entity entity) {
    stream(entity.getEntityType().getAllAttributes())
        .filter(Attribute::hasDefaultValue)
        .forEach(attr -> populateDefaultValues(entity, attr));
  }
267379
public Attributes<Entity<T>> getOrCreateAttributes()
   {
      Node node = childNode.getOrCreate("attributes");
      Attributes<Entity<T>> attributes = new AttributesImpl<Entity<T>>(this, "attributes", childNode, node);
      return attributes;
   }
1373436
public final FillEntityFromReq
    lazyGetFillEntityFromReq() throws Exception {
    String beanName = getFillEntityFromReqName();
    FillEntityFromReq fillEntityFromReq =
      (FillEntityFromReq) this.beansMap.get(beanName);
    if (fillEntityFromReq == null) {
      fillEntityFromReq = new FillEntityFromReq();
      fillEntityFromReq.setLogger(lazyGetLogger());
      fillEntityFromReq
        .setFillersFieldsFactory(lazyGetFctFillersObjectFields());
      fillEntityFromReq
        .setFieldConverterNamesHolder(lazyGetHldFieldsCnvTfsNames());
      fillEntityFromReq
        .setConvertersFieldsFatory(lazyGetFctConvertersToFromString());
      this.beansMap.put(beanName, fillEntityFromReq);
      lazyGetLogger().info(null, AFactoryAppBeans.class, beanName
        + " has been created.");
    }
    return fillEntityFromReq;
  }
1028354
function fetchAll()
    {
        if ( $this->items !== null )
            return $this->items;

        if ( $this->query === null )
        {
            $this->query = $this->generateSQL();
        }
        if ( $this->query === false )
            return array();
        $query = "SELECT * {$this->query} ORDER BY {$this->order}";
        $params = array( 'offset' => $this->offset,
                         'limit'  => $this->limit );
        $db = eZDB::instance();
        $rows = $db->arrayQuery( $query, $params );
        if ( count( $rows ) == 0 )
            $this->items = array();
        else
            $this->items = eZURLAliasQuery::makeList( $rows );
        return $this->items;
    }
914402
final public function fetch()
    {
        if(!isset($this->_entity))
        {
            $context = $this->getContext();

            if ($this->invokeCommand('before.fetch', $context) !== false)
            {
                $context->result = $this->_actionFetch($context);
                $this->invokeCommand('after.fetch', $context);
            }

            $this->_entity = ObjectConfig::unbox($context->result);
        }

        return $this->_entity;
    }
1019965
protected function prepareAttributes()
    {

        // load the ID of the last link
        $linkId = $this->getLastLinkId();

        // load the product link attribute ID
        $productLinkAttributeId = $this->getProductLinkAttributeId();

        // load the position value
        $value = $this->getValue(ColumnKeys::LINK_TYPE_ATTRIBUTE_VALUE);

        // initialize and return the entity
        return $this->initializeEntity(
            array(
                MemberNames::PRODUCT_LINK_ATTRIBUTE_ID => $productLinkAttributeId,
                MemberNames::LINK_ID                   => $linkId,
                MemberNames::VALUE                     => $value
            )
        );
    }
38215
public function loadDefault() {
		foreach($this->getDefinition()->properties() as $name=>$property)
			$this->_set($name, $property->getDefault($this, $name), null, false);
		return $this;
	}
872226
@GetMapping(value = "/{entityTypeId}/{id}/{refAttributeName}", produces = APPLICATION_JSON_VALUE)
  public Object retrieveEntityAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("id") String untypedId,
      @PathVariable("refAttributeName") String refAttributeName,
      @Valid EntityCollectionRequest request,
      @RequestParam(value = "attributes", required = false) String[] attributes,
      @RequestParam(value = "expand", required = false) String[] attributeExpands) {
    Set<String> attributesSet = toAttributeSet(attributes);
    Map<String, Set<String>> attributeExpandSet = toExpandMap(attributeExpands);

    return retrieveEntityAttributeInternal(
        entityTypeId, untypedId, refAttributeName, request, attributesSet, attributeExpandSet);
  }
801241
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return EntityInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
        )
374993
private static String initCreateEntityQuery(EntityKeyMetadata entityKeyMetadata) {
		StringBuilder queryBuilder = new StringBuilder( "CREATE " );
		appendEntityNode( ENTITY_ALIAS, entityKeyMetadata, queryBuilder );
		queryBuilder.append( " RETURN " );
		queryBuilder.append( ENTITY_ALIAS );
		return queryBuilder.toString();
	}
650791
@Override
	public CPOption fetchByPrimaryKey(Serializable primaryKey) {
		Serializable serializable = entityCache.getResult(CPOptionModelImpl.ENTITY_CACHE_ENABLED,
				CPOptionImpl.class, primaryKey);

		if (serializable == nullModel) {
			return null;
		}

		CPOption cpOption = (CPOption)serializable;

		if (cpOption == null) {
			Session session = null;

			try {
				session = openSession();

				cpOption = (CPOption)session.get(CPOptionImpl.class, primaryKey);

				if (cpOption != null) {
					cacheResult(cpOption);
				}
				else {
					entityCache.putResult(CPOptionModelImpl.ENTITY_CACHE_ENABLED,
						CPOptionImpl.class, primaryKey, nullModel);
				}
			}
			catch (Exception e) {
				entityCache.removeResult(CPOptionModelImpl.ENTITY_CACHE_ENABLED,
					CPOptionImpl.class, primaryKey);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return cpOption;
	}
496861
protected function _addDefaultContextProviders()
    {
        $this->addContextProvider('orm', function ($request, $data) {
            if (is_array($data['entity']) || $data['entity'] instanceof \Traversable) {
                $pass = (new Collection($data['entity']))->first() !== null;
                if ($pass) {
                    return new EntityContext($request, $data);
                }
            }

            return $this->_addEntityContent($request, $data);
        });

        $this->_addFormContextProvider();
        $this->_addFormArrayProvider();
    }