Closed LauraWilhelm closed 4 years ago
Hi,
here below is an XML code snippet in your EnvPlannADE:
<element name="age" substitutionGroup="veg:_GenericApplicationPropertyOfVegetationObject" type="integer"/>
In this example, a new ADE Attribute age
is added to the class AbstractVegetationObject
, not SolitaryVegetationObject
. Since the class AbstractVegetationObject
is logically mapped to the database table CITYOBJECT
, the new table EP_CITYOBJECT
is created, instead of EP_SOLITARY_VEGETAT_OBJECT
.
The native syntax of XML schema is not able to reflect M:N-relations. They must be annotated in the your ADE's XML schema using the gml:reversePropertyName
annotation element. You can find examples in the EnergyADE . With this annotation element, the ADE-Manager can create a new table to join the M- and N- tables.
Zhihang
Hello Zhihang,
thanks so much for your fast reply and for pointing out the adding-mistake. I overlooked that.
Also thanks for the annotation hint.
I have a follow-up question: One of my relations is recursive with an additional element like CityObjectGroup
and role
.
<element maxOccurs="unbounded" minOccurs="0" name="predecessorMeasure" type="envplan:PredecessorMeasureType"/>
<complexType name="PredecessorMeasureType">
<sequence minOccurs="0">
<element ref="envplan:EnvironmentalMeasure"/>
</sequence>
<attribute name="daysAfterPredecessorMeasure" type="integer"/>
<attributeGroup ref="gml:AssociationAttributeGroup"/>
</complexType>
daysAfterPredecessorMeasure
is lost during the translation and I added it manually. For this case is there also a specific annotation to add?
Thanks in advance. Laura
Hi Laura,
unforunately, The ADE-Manager can not handle such kind of association attribute. which is not supported by the "UML-to-GML application schema encoding rules" of ISO19137_2007 (Annex E).
Zhihang
Hello Zhihang, thanks a lot for your help! Laura
Hello,
I have two more questions regarding the transformation of my ADE (ep_) with the ADE Manger.
For the new attributes of SolitaryVegetationObject a new table ep_cityobject with ep_cityobject_fk referencing cityobject (id) is created instead of ep_solitary_vegetat_object. I adjusted it manually but I was wondering if there is a bug with the handling of SolitaryVegetationObject as it works fine with other ADEElements.
For the M:N-relations there is no new table created. The id of the M-end is added as a foreign key to the N-table and vise versa. Adding a new table with the relating foreign key solves that issue, but is there a way that the relations are automatically mapped with a new table?
Thanks a lot in advance! Laura