tempExp1.setLiteral("Main St.");
AttributeExpression tempExp2 = factory.createAttributeExpression((FeatureType)null,"Person/Address/StreetName");
//tempExp2.setAttributePath("Person/Address/StreetName");
CompareFilter tempFilter = factory.createCompareFilter(AbstractFilter.COMPARE_EQUALS);
tempFilter.addRightValue(tempExp1);
tempFilter.addLeftValue(tempExp2);
Filter logicFilter = factory.createLogicFilter(tempFilter,
AbstractFilter.LOGIC_AND);
LOGGER.fine("filter: " + logicFilter);
tempFilter = factory.createCompareFilter(AbstractFilter.COMPARE_EQUALS);
tempExp1 = factory.createLiteralExpression(DefaultExpression.LITERAL_STRING);
tempExp2 = factory.createAttributeExpression((FeatureType)null,"Person/Address/City");
tempExp1.setLiteral("Main St.");
tempExp1.setLiteral("SomeTown");
//tempExp2.setAttributePath("Person/Address/City"); // done at creations time
tempFilter.addRightValue(tempExp1);
tempFilter.addLeftValue(tempExp2);
logicFilter = logicFilter.and(tempFilter);
LOGGER.fine("filter: " + logicFilter);
tempFilter = factory.createCompareFilter(AbstractFilter.COMPARE_EQUALS);
tempExp1 = factory.createLiteralExpression(DefaultExpression.LITERAL_STRING);
tempExp2 = factory.createAttributeExpression((FeatureType)null,"Person/Sex");
tempExp1.setLiteral("Female");
// tempExp2.setAttributePath("Person/Sex");
tempFilter.addRightValue(tempExp1);
tempFilter.addLeftValue(tempExp2);
logicFilter = logicFilter.and(tempFilter);
LOGGER.fine("filter: " + logicFilter);
tempFilter = factory.createCompareFilter(AbstractFilter.COMPARE_GREATER_THAN);
tempExp1 = factory.createLiteralExpression(DefaultExpression.LITERAL_INTEGER);
tempExp2 = factory.createAttributeExpression((FeatureType)null,"Person/Salary");
tempExp1.setLiteral("35000");
// tempExp2.setAttributePath("Person/Salary");
tempFilter.addLeftValue(tempExp2);
tempFilter.addRightValue(tempExp1);
logicFilter = logicFilter.and(tempFilter);
Filter finalFilter = factory.createLogicFilter(logicFilter,
AbstractFilter.LOGIC_AND);
LOGGER.fine("filter: " + finalFilter);
tempFilter = factory.createCompareFilter(AbstractFilter.COMPARE_GREATER_THAN_EQUAL);
tempExp1 = factory.createLiteralExpression(DefaultExpression.LITERAL_INTEGER);
tempExp2 = factory.createAttributeExpression((FeatureType)null,"Person/Address/StreetNumber");
tempExp1.setLiteral("10000");
//tempExp2.setAttributePath("Person/Address/StreetNumber");
tempFilter.addLeftValue(tempExp2);
tempFilter.addRightValue(tempExp1);
finalFilter = finalFilter.and(tempFilter);
LOGGER.fine("filter: " + finalFilter);
tempFilter = factory.createCompareFilter(AbstractFilter.COMPARE_LESS_THAN_EQUAL);
tempExp1 = factory.createLiteralExpression(DefaultExpression.LITERAL_INTEGER);
tempExp2 = factory.createAttributeExpression((FeatureType)null,"Person/Address/StreetNumber");
tempExp1.setLiteral("10999");
//tempExp2.setAttributePath("Person/Address/StreetNumber");
tempFilter.addLeftValue(tempExp2);
tempFilter.addRightValue(tempExp1);
finalFilter = finalFilter.and(tempFilter);
LOGGER.fine("filter: " + finalFilter);
FeatureRequest baseRequest = new FeatureRequest();
Query query = new Query();