Files of this type are used to register non-persistent entities and assign meta annotations, see Section 4.2.2, “Metadata Framework”.
XML schema is available at http://schemas.haulmont.com/cuba/5.6/metadata.xsd.
A set of metadata.xml files, including the ones defined in base projects, is declared in the cuba.metadataConfig application property.
The file has the following structure:
metadata – root element.
metadata elements:
-
metadata-model– the project's meta model descriptor.metadata-modelattribute:-
root-package– the project’s root package.
metadata-modelelements:-
class– a non-persistent entity class.
-
-
annotations– contains assignments of entity meta annotations.annotationselements:-
entity– entity to assign meta annotation to.entityattributes:-
class– entity class.
entityelements:-
annotation– meta annotation element.annotationattributes:-
name– meta annotation name. -
value– meta annotation value.
-
-
-
Example:
<metadata xmlns="http://schemas.haulmont.com/cuba/metadata.xsd">
<metadata-model root-package="com.sample.sales">
<class>com.sample.sales.entity.SomeTransientEntity</class>
<class>com.sample.sales.entity.OtherTransientEntity</class>
</metadata-model>
<annotations>
<entity class="com.haulmont.cuba.security.entity.User">
<annotation name="com.haulmont.cuba.core.entity.annotation.TrackEditScreenHistory"
value="true"/>
<annotation name="com.haulmont.cuba.core.entity.annotation.EnableRestore"
value="true"/>
</entity>
</annotations>
</metadata>
