According the following tables :
PARENT (ID, X1, X2);
CHILD (ID, Y1, Y2, FK_PARENT_ID);
and the following XML Schema :
<element name="Child">
<complexType>
<sequence>
<element name="id" type="string" />
<element name="y1" type="string" />
<element name="y2" type="string" />
</sequence>
</complexType>
</element>
<element name="Parent">
<complexType>
<sequence>
<element name="id" type="string" />
<element name="x1" type="string" />
<element name="x2" type="string" />
<element name="child" maxOccurs="unbounded">
<complexType>
<sequence>
<element ref="Child" />
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
Application Schema plugin is used to map table “PARENT” on xml element “Parent”, and table “CHILD” on xml element “Child”.
A FEATURE_LINK is configured between these two mapping files.
After deployment, the following request works:
<wfs:GetFeature service="WFS" version="2.0.0" outputFormat="gml32"
xmlns:myNs="http://www.myNs.org/schema"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/2.0/wfs.xsd">
<wfs:Query typeNames="myNs:Parent">
</wfs:Query>
</wfs:GetFeature>
and return something like
<Parent>
<x1>...</x1>
<x2>...</x2>
<child>
<Child>
<y1>...</y1>
<y2>...</y2>
</Child>
</child>
</Parent>
If I use a WFS filter on a parent property, it works :
<wfs:GetFeature service="WFS" version="2.0.0" outputFormat="gml32"
xmlns:myNs="http://www.myNs.org/schema"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/2.0/wfs.xsd">
<wfs:Query typeNames="myNs:Parent">
<fes:Filter>
<fes:PropertyIsEqualTo>
<fes:ValueReference>myNs:x1</fes:ValueReference>
<fes:Literal>bob</fes:Literal>
</fes:PropertyIsEqualTo>
</fes:Filter>
</wfs:Query>
</wfs:GetFeature>
A problem appears when I use a WFS filter on a child property.
Considering I have records in the database according to the following filter.
<wfs:GetFeature service="WFS" version="2.0.0" outputFormat="gml32"
xmlns:myNs="http://www.myNs.org/schema"
xmlns:wfs="http://www.opengis.net/wfs/2.0"
xmlns:fes="http://www.opengis.net/fes/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/2.0/wfs.xsd">
<wfs:Query typeNames="myNs:Parent">
<fes:Filter>
<fes:PropertyIsEqualTo>
<fes:ValueReference>myNs:x1/mysNs:child/myNs:Child/myNs:y1</fes:ValueReference>
<fes:Literal>bob</fes:Literal>
</fes:PropertyIsEqualTo>
</fes:Filter>
</wfs:Query>
</wfs:GetFeature>
The request does not return any feature.
When I perform the same test on the nightly build (2013/07/11), Geoserver 2.3.x, it does not works.
When I perform the same test on the old release, Geoserver 2.2.5 (App-schema joining for performance is disabled), it works.
So, it seems to be a regression anomaly.
Some developpers can check that ?
|