O método entitySelection.extract( ) retorna uma coleção contendo valores propriedadeRota extraídos da seleção de entidades.
propriedadeRota podem referir a:
- um atributo de classe de dados escalar,
- entidade relacionada,
- entidades relacionadas.
Se propriedadeRota é inválida, uma coleção vazia é retornada.
Este método aceita duas sintaxes.
With this syntax, entitySelection.extract( ) populates the returned collection with the propertyPath values of the entity selection.
By default, entities for which propertyPath is null or undefined are ignored in the resulting collection. You can pass the ck keep null constant in the option parameter to include these values as null elements in the returned collection.
- Dataclass attributes with dataClassAttribute.kind = "relatedEntity" are extracted as a collection of entities (duplications are kept).
- Dataclass attributes with dataClassAttribute.kind = "relatedEntities" are extracted as a collection of entity selections.
With this syntax, entitySelection.extract( ) populates the returned collection with the propertyPath properties. Each element of the returned collection is an object with targetPath properties filled with the corresponding propertyPath properties. Null values are kept (option parameter is ignored with this syntax).
If several propertyPath are given, a targetPath must be given for each. Only valid pairs [propertyPath, targetPath] are extracted.
Note: Entities of a collection of entities accessed by [ ] are not reloaded from the database.
Dada a tabela abaixo e relação:

C_COLLECTION($firstnames;$addresses;$mailing;$teachers)
C_OBJECT($status)
$firstnames:=ds.Teachers.all().extract("firstname")
$addresses:=ds.Teachers.all().extract("address";ck keep null)
$mailing:=ds.Teachers.all().extract("lastname";"who";"address";"to")
$mailing:=ds.Teachers.all().extract("lastname";"who";"address.city";"city")
$teachers:=ds.Address.all().extract("city";"where";"teachers";"who")
$teachers:=ds.Address.all().extract("teachers")