int lhsColumnSpan, int rhsColumnSpan ) {
String[] lhsElementTexts = extractMutationTexts( getLeftHandOperand(),
lhsColumnSpan );
Node rhsNode = (Node) getInList().getFirstChild();
ParameterSpecification lhsEmbeddedCompositeParameterSpecification = getLeftHandOperand() == null
|| ( !ParameterNode.class.isInstance( getLeftHandOperand() ) ) ? null
: ( (ParameterNode) getLeftHandOperand() )
.getHqlParameterSpecification();
final boolean negated = getType() == HqlSqlTokenTypes.NOT_IN;
if ( rhsNode != null && rhsNode.getNextSibling() == null ) {
/**
* only one element in the vector grouping.
* <code> where (a,b) in ( (1,2) ) </code> this will be mutated to
* <code>where a=1 and b=2 </code>
*/
String[] rhsElementTexts = extractMutationTexts( rhsNode, rhsColumnSpan );
setType( negated ? HqlTokenTypes.OR : HqlSqlTokenTypes.AND );
setText( negated ? "or" : "and" );
ParameterSpecification rhsEmbeddedCompositeParameterSpecification =
rhsNode == null || ( !ParameterNode.class.isInstance( rhsNode ) )
? null
: ( (ParameterNode) rhsNode ).getHqlParameterSpecification();
translate(
lhsColumnSpan,
negated ? HqlSqlTokenTypes.NE : HqlSqlTokenTypes.EQ,
negated ? "<>" : "=",
lhsElementTexts,
rhsElementTexts,
lhsEmbeddedCompositeParameterSpecification,
rhsEmbeddedCompositeParameterSpecification,
this
);
}
else {
List andElementsNodeList = new ArrayList();
while ( rhsNode != null ) {
String[] rhsElementTexts = extractMutationTexts( rhsNode, rhsColumnSpan );
AST group = getASTFactory().create(
negated ? HqlSqlTokenTypes.OR : HqlSqlTokenTypes.AND,
negated ? "or" : "and"
);
ParameterSpecification rhsEmbeddedCompositeParameterSpecification =
rhsNode == null || ( !ParameterNode.class.isInstance( rhsNode ) )
? null
: ( (ParameterNode) rhsNode ).getHqlParameterSpecification();
translate(
lhsColumnSpan,