Hi, I want to connect two types by a string id, but I get the following error:
[ERROR] Failed to execute goal org.jibx:jibx-maven-plugin:1.2.4.5:bind
(compile-binding) on project chimp: No mapping defined for test.Patient
used as IDREF target -> [Help 1]
I do not understand this, as the binding.xml does contain a mapping for the
Patient class, actually.
Here is the relevant part of the schema:
<xs:complexType name="Patient">
<xs:sequence>
<xs:element name="patient_forename" type="xs:string" />
<xs:element name="patient_surname" type="xs:string" />
<xs:element name="dob" type="xs:string" />
<xs:element name="hospital_id" type="xs:string" />
<xs:element name="nhs_number" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:integer" />
</xs:complexType>
...
<xs:complexType name="Attendance">
<xs:sequence>
<xs:element name="hospital_id" type="xs:string" />
<xs:element name="list_code" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:integer" />
</xs:complexType>
And here is the relevant part of the binding:
<binding xmlns:ns1="http://dementia.ion.ucl.ac.uk/chimp/xml" name="binding"
package="test" trim-whitespace="true">
<namespace uri="http://dementia.ion.ucl.ac.uk/chimp/xml"
default="elements"/>
...
<mapping abstract="true" type-name="ns1:Patient" class="test.Patient">
<value style="element" name="hospital_id" field="hospitalId"
ident="def"/>
<value style="element" name="patient_forename"
get-method="getPatientForename" set-method="setPatientForename"/>
<value style="element" name="patient_surname"
get-method="getPatientSurname" set-method="setPatientSurname"/>
<value style="element" name="dob" get-method="getDob"
set-method="setDob"/>
<value style="element" name="nhs_number" get-method="getNhsNumber"
set-method="setNhsNumber"/>
<value style="attribute" name="id" get-method="getId"
set-method="setId" usage="optional"/>
</mapping>
...
<mapping abstract="true" type-name="ns1:Attendance"
class="test.Attendance">
<value style="element" name="hospital_id" field="patient"
type="test.Patient" ident="ref"/>
<value style="element" name="list_code" get-method="getListCode"
set-method="setListCode"/>
<value style="attribute" name="id" get-method="getId"
set-method="setId" usage="optional"/>
</mapping>
</binding>
So, the two types should be connected by the hospital_id attribute of the
patients.
The Attendance class has a reference to the Patient class.
Could someone give me a hint, why I get this error, even if I have mapping
for the Patient class?
I attached the code as a maven project. The error can be reproduced by
running "mvn test" in the extracted folder.
Thank you,
Miklos
jibxtest.tar.bz2
Description: BZip2 compressed data
------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________ jibx-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jibx-users
