Does the data in the tables you are querying via BlazeDS match fields in your map service?For example, what I do is use BlazeDS/WebOrb to query various tables of land use and property information, get back a list of say parcel numbers, then I perform a QueryTask on the map service of parcels using those parcel numbers. For various reasons, this data sits outside an SDE, but I can use the remote service to tie everthing together.I've gotten very comfortable working with my data in this manner and because I can customize the queries to my hearts content, I actually prefer it to Relationship queries provided by the ESRI Flex API.For example, I have a java query in BlazeDS to queries some Flow data for our sewer system.public static ArrayList<FlowControl> getFlowControlList() {
ArrayList<FlowControl> flows = new ArrayList<FlowControl>();
ResultSet resultSet;
try {
connection = ConnectionHelper.sdeConnection();
Statement stmt = connection.createStatement();
String sql = "SELECT CSDAssetID, CSDFeatureID, '' AS PipeCSDAssetID, '' AS PipeCSDFeatureID, UpstreamPipeCSDAssetID, UpstreamPipeCSDFeatureID, "
+ "DownstreamPipeCSDAssetID, DownstreamPipeCSDFeatureID, FlowControlInputDate, FlowAllowed, FlowControlPosition, Subtype "
+ "FROM sde.SSCOMPLEXFLOWCONTROLHISTORY AS cf "
+ "WHERE (FlowControlInputDate = "
+ "(SELECT MAX(FlowControlInputDate) AS Expr1 "
+ "FROM sde.SSCOMPLEXFLOWCONTROLHISTORY AS cf2 "
+ "WHERE (CSDAssetID = cf.CSDAssetID) AND (CSDFeatureID = cf.CSDFeatureID))) "
+ "UNION "
+ "SELECT CSDAssetID, CSDFeatureID, PipeCSDAssetID, PipeCSDFeatureID, '' AS UpstreamPipeCSDAssetID, '' AS UpstreamPipeCSDFeatureID, "
+ "'' AS DownstreamPipeCSDAssetID, '' AS DownstreamPipeCSDFeatureID, FlowControlInputDate, FlowAllowed, FlowControlPosition, Subtype "
+ "FROM sde.SSFLOWCONTROLHISTORY AS f "
+ "WHERE (FlowControlInputDate = "
+ "(SELECT MAX(FlowControlInputDate) AS Expr1 "
+ "FROM sde.SSFLOWCONTROLHISTORY AS f2 "
+ "WHERE (CSDAssetID = f.CSDAssetID) AND (CSDFeatureID = f.CSDFeatureID))) "
+ "ORDER BY CSDAssetID";
resultSet = stmt.executeQuery(sql);
while (resultSet.next()) {
FlowControl flow = new FlowControl();
flow.setCsdAssetId(resultSet.getString(CSD_ASSET_ID));
flow.setCsdFeatureId(resultSet.getString("CSDFeatureID"));
flow.setDownstreamPipeCsdAssetId(resultSet
.getString("DownstreamPipeCSDAssetID"));
flow.setDownstreamPipeCsdFeatureId(resultSet
.getString("DownstreamPipeCSDFeatureID"));
flow.setFlowAllowed(resultSet.getBoolean("FlowAllowed"));
flow.setFlowControlInputDate(resultSet
.getDate("FlowControlInputDate"));
flow.setFlowControlPosition(resultSet
.getString("FlowControlPosition"));
flow.setPipeCsdAssetId(resultSet.getString("PipeCSDAssetID"));
flow.setSubType(resultSet.getString("Subtype"));
flow.setUpstreamPipeCsdAssetId(resultSet
.getString("UpstreamPipeCSDAssetID"));
flow.setUpstreamPipeCsdFeatureId(resultSet
.getString("UpstreamPipeCSDFeatureID"));
flows.add(flow);
System.out.println("FlowList = " + flow.getCsdAssetId() + " : "
+ flow.getCsdFeatureId());
} // end while statement
} catch (SQLException ex) {
System.out.println(ex.getMessage());
} // end try-catch block
finally {
closeConnection();
}
return flows;
}
Then in my Flex project, I can use the ArrayList as a DataProvider for a table or iterate the list to build a query that will use an existing map service in my application.