Hi all,

I'm trying to use an Embeddable object with Single Table Inheritance pattern, 
but receive a < ObjAttribute 'X' has no DBAttribute mapping > for each 
overriding objects, at project validation.

Embeddable is added to the parent abstract object.

Reproduced in the BOOK example 
https://cayenne.apache.org/docs/3.0/modeling-single-table-inheritance.html, in 
the attached configuration.
Using 4.0B2 modeler.

Should I change my configuration to make it work, or is this a not supported 
feature ?
By the way at every click on < Sync objEntity with DbEntity > all BOOK columns 
even those mapped on Embeddable reappear.

Thanks for any hint.

Regards,
Fred



<data-map xmlns="http://cayenne.apache.org/schema/9/modelMap";
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
               xsi:schemaLocation="http://cayenne.apache.org/schema/9/modelMap 
http://cayenne.apache.org/schema/9/modelMap.xsd";
               project-version="9">
               <property name="defaultPackage" 
value="org.example.cayenne.persistent"/>
               <embeddable className="org.example.cayenne.persistent.Reference">
                              <embeddable-attribute name="isbn" 
type="java.lang.String" db-attribute-name="isbn"/>
                              <embeddable-attribute name="title" 
type="java.lang.String" db-attribute-name="title"/>
               </embeddable>
               <db-entity name="BOOK">
                              <db-attribute name="TYPE" type="CHAR" 
isMandatory="true" length="1"/>
                              <db-attribute name="author" type="VARCHAR" 
isMandatory="true" length="128"/>
                              <db-attribute name="downloadurl" type="VARCHAR" 
length="128"/>
                              <db-attribute name="id" type="INTEGER" 
isPrimaryKey="true" isMandatory="true" length="8"/>
                              <db-attribute name="isbn" type="VARCHAR" 
length="128"/>
                              <db-attribute name="title" type="VARCHAR" 
length="128"/>
                              <db-attribute name="weight" type="VARCHAR" 
length="128"/>
               </db-entity>
               <obj-entity name="Book" 
className="org.example.cayenne.persistent.Book" dbEntityName="BOOK">
                              <obj-attribute name="downloadurl" 
type="java.lang.String" db-attribute-path="downloadurl"/>
                              <obj-attribute name="isbn" 
type="java.lang.String" db-attribute-path="isbn"/>
                              <embedded-attribute name="reference" 
type="org.example.cayenne.persistent.Reference"/>
                              <obj-attribute name="type" 
type="java.lang.String" db-attribute-path="TYPE"/>
                              <obj-attribute name="weight" 
type="java.lang.String" db-attribute-path="weight"/>
               </obj-entity>
               <obj-entity name="EBook" superEntityName="Book" 
className="org.example.cayenne.persistent.EBook">
                              <qualifier><![CDATA[type = "E"]]></qualifier>
                              <obj-attribute name="author" 
type="java.lang.String" db-attribute-path="author"/>
                              <obj-attribute name="title" 
type="java.lang.String" db-attribute-path="title"/>
               </obj-entity>
               <obj-entity name="PaperBook" superEntityName="Book" 
className="org.example.cayenne.persistent.PaperBook">
                              <qualifier><![CDATA[type = "P"]]></qualifier>
                              <obj-attribute name="author" 
type="java.lang.String" db-attribute-path="author"/>
                              <obj-attribute name="title" 
type="java.lang.String" db-attribute-path="title"/>
               </obj-entity>
</data-map>



Attachment: datamap.map.xml
Description: datamap.map.xml

Reply via email to