DataProjection
The DataProjection element is used to define a subset of fieldsFieldA property of a DataElement expanded to a database column and user interface input element. of the parent DataElement.
When data is passed through the applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution., it is always represented in the form of a projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view..
For what projectionsProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. are and why they exist, see Data Elements.
Standard Projections
There are 3 projectionsProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. that are always present for each data elementData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept..
| ProjectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. | Contains | Used for |
|---|---|---|
| Details | All fieldsFieldA property of a DataElement expanded to a database column and user interface input element., excluding calculated fieldsFieldA property of a DataElement expanded to a database column and user interface input element. | Create, modify, default backend representation |
| Info | FieldsFieldA property of a DataElement expanded to a database column and user interface input element. marked as info fieldFieldA property of a DataElement expanded to a database column and user interface input element. | Table columns in the user interface, default result of find() |
| DataRef | id, name and functional key fieldsFieldA property of a DataElement expanded to a database column and user interface input element. | References to an instance |
Details Projection
The details projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. is used to create and modify. It is also the default representation for most logic in the backend.
The details projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. is defined by the set of all fieldsFieldA property of a DataElement expanded to a database column and user interface input element. in the DataElement excluding the calculated FieldsFieldA property of a DataElement expanded to a database column and user interface input element..
Info Projection
The info projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. is a reduced set of fieldsFieldA property of a DataElement expanded to a database column and user interface input element. from the DataElement. It defines the columns in the table in the user interface. A fieldFieldA property of a DataElement expanded to a database column and user interface input element. is added to the info projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. with isInfoField.
The find() method defaults to returning the info projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. if no projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. is defined in the SearchDetails. However,
it is better to explicitly define a projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view.. If you are not sure, use the details projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view..
DataRef Projection
The DataRef projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. is used in several places to reference an instance of a DataElement without requiring the entire DataElement projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view..
By default, this projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. only contains the id (and name if possible) of that instance.
It is also possible to define your own FieldsFieldA property of a DataElement expanded to a database column and user interface input element. to add to the DataRef. To do so, add the option functionalKey with the
names of the fieldsFieldA property of a DataElement expanded to a database column and user interface input element. separated with _. Read more in Business keys.
Custom Projections
Developers can also define their own projectionsProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view.. These projectionsProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. define a set of reference fieldsFieldA property of a DataElement expanded to a database column and user interface input element., which point to fieldsFieldA property of a DataElement expanded to a database column and user interface input element. of the DataElement.
<dataElement name="Car">
<dataProjections>
<dataProjection name="CarReservation">
<referenceFields>
<referenceField>
<field name="status"/>
</referenceField>
<referenceField>
<field name="reservedBy"/>
</referenceField>
<referenceField>
<field name="reservedTill"/>
</referenceField>
</referenceFields>
</dataProjection>
</dataProjections>
</dataElement>
ProjectionsProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. also allow the definition of CalculatedFieldsFieldA property of a DataElement expanded to a database column and user interface input element. specific to the projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view.. This representation, however, is not only redundant, but also not easy to migrate to a regular Calculated FieldFieldA property of a DataElement expanded to a database column and user interface input element.. Calculated fieldsFieldA property of a DataElement expanded to a database column and user interface input element. defined as regular Fields do not have this limitation.
Projections as Input
It is possible to use projectionsProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. as input for both create and modify. In this case only the fieldsFieldA property of a DataElement expanded to a database column and user interface input element. defined in the projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. will be updated.
These methods are only generated when the corresponding option is set.
CityMyProjection city = new CityMyProjection();
city.setDescription(newDescription);
CrudsResult<DataRef> result = cityLocalAgent.createWithProjection(city);
Options
ApplicationApplicationInstanceComponentDataElementAdds a method to the DataElement classes to create an instance with a projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. other than details.
<options>
<cruds.createWithProjection/>
</options>
ApplicationApplicationInstanceComponentDataElementAdds a method to the DataElement classes to modify an instance with a projectionProjectionA tailored subset of fields on a DataElement designed to encapsulate data for a specific technical or functional view. other than details.
<options>
<cruds.modifyWithProjection/>
</options>