p1.setBoundName( "p1" );
m.addLhsItem( p1 );
FactPattern p = new FactPattern( "Goober" );
m.addLhsItem( p );
CompositeFieldConstraint comp = new CompositeFieldConstraint();
comp.compositeJunctionType = CompositeFieldConstraint.COMPOSITE_TYPE_OR;
p.addConstraint( comp );
final SingleFieldConstraint X = new SingleFieldConstraint();
X.setFieldName( "goo" );
X.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
X.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
X.setValue( "foo" );
X.setOperator( "==" );
X.connectives = new ConnectiveConstraint[1];
X.connectives[0] = new ConnectiveConstraint();
X.connectives[0].setConstraintValueType( ConnectiveConstraint.TYPE_LITERAL );
X.connectives[0].setFieldType( SuggestionCompletionEngine.TYPE_STRING );
X.connectives[0].setOperator( "|| ==" );
X.connectives[0].setValue( "bar" );
comp.addConstraint( X );
final SingleFieldConstraint Y = new SingleFieldConstraint();
Y.setFieldName( "goo2" );
Y.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
Y.setConstraintValueType( SingleFieldConstraint.TYPE_LITERAL );
Y.setValue( "foo" );
Y.setOperator( "==" );
comp.addConstraint( Y );
CompositeFieldConstraint comp2 = new CompositeFieldConstraint();
comp2.compositeJunctionType = CompositeFieldConstraint.COMPOSITE_TYPE_AND;
final SingleFieldConstraint Q1 = new SingleFieldConstraint();
Q1.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
Q1.setFieldName( "goo" );
Q1.setOperator( "==" );
Q1.setValue( "whee" );
Q1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
comp2.addConstraint( Q1 );
final SingleFieldConstraint Q2 = new SingleFieldConstraint();
Q2.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
Q2.setFieldName( "gabba" );
Q2.setOperator( "==" );
Q2.setValue( "whee" );
Q2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
comp2.addConstraint( Q2 );
// now nest it
comp.addConstraint( comp2 );
final SingleFieldConstraint Z = new SingleFieldConstraint();