@Override public void initialize() { // TODO : this really needs to be delayed until after we definitively know the operand node type; // where this is currently a problem is parameters for which where we cannot unequivocally // resolve an expected type Type operandType = extractDataType( getOperand() ); if ( operandType == null ) { return; } SessionFactoryImplementor sessionFactory = getSessionFactoryHelper().getFactory(); int operandColumnSpan = operandType.getColumnSpan( sessionFactory ); if ( operandColumnSpan > 1 ) { mutateRowValueConstructorSyntax( operandColumnSpan ); } }
private void mutateRowValueConstructorSyntax(int operandColumnSpan) { final int comparisonType = getType(); final String comparisonText = getText(); final int expansionConnectorType = getExpansionConnectorType(); final String expansionConnectorText = getExpansionConnectorText(); setType( expansionConnectorType ); setText( expansionConnectorText ); String[] mutationTexts = extractMutationTexts( getOperand(), operandColumnSpan ); AST op1 = getASTFactory().create( comparisonType, comparisonText ); AST operand1 = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[0] ); op1.setFirstChild( operand1 ); container.setFirstChild( op1 ); AST op2 = getASTFactory().create( comparisonType, comparisonText ); AST operand2 = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[1] ); op2.setFirstChild( operand2 ); op1.setNextSibling( op2 ); AST op = getASTFactory().create( comparisonType, comparisonText ); AST operand = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[i] ); op.setFirstChild( operand ); AST newContainer = getASTFactory().create( expansionConnectorType, expansionConnectorText ); container.setFirstChild( newContainer ); newContainer.setNextSibling( op );
private void mutateRowValueConstructorSyntax(int operandColumnSpan) { final int comparisonType = getType(); final String comparisonText = getText(); final int expansionConnectorType = getExpansionConnectorType(); final String expansionConnectorText = getExpansionConnectorText(); setType( expansionConnectorType ); setText( expansionConnectorText ); String[] mutationTexts = extractMutationTexts( getOperand(), operandColumnSpan ); AST op1 = getASTFactory().create( comparisonType, comparisonText ); AST operand1 = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[0] ); op1.setFirstChild( operand1 ); container.setFirstChild( op1 ); AST op2 = getASTFactory().create( comparisonType, comparisonText ); AST operand2 = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[1] ); op2.setFirstChild( operand2 ); op1.setNextSibling( op2 ); AST op = getASTFactory().create( comparisonType, comparisonText ); AST operand = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[i] ); op.setFirstChild( operand ); AST newContainer = getASTFactory().create( expansionConnectorType, expansionConnectorText ); container.setFirstChild( newContainer ); newContainer.setNextSibling( op );
/** * {@inheritDoc} */ @Override public void initialize() { // TODO : this really needs to be delayed unitl after we definitively know the operand node type; // where this is currently a problem is parameters for which where we cannot unequivocally // resolve an expected type Type operandType = extractDataType( getOperand() ); if ( operandType == null ) { return; } SessionFactoryImplementor sessionFactory = getSessionFactoryHelper().getFactory(); int operandColumnSpan = operandType.getColumnSpan( sessionFactory ); if ( operandColumnSpan > 1 ) { mutateRowValueConstructorSyntax( operandColumnSpan ); } }
private void mutateRowValueConstructorSyntax(int operandColumnSpan) { final int comparisonType = getType(); final String comparisonText = getText(); final int expansionConnectorType = getExpansionConnectorType(); final String expansionConnectorText = getExpansionConnectorText(); setType( expansionConnectorType ); setText( expansionConnectorText ); String[] mutationTexts = extractMutationTexts( getOperand(), operandColumnSpan ); AST op1 = getASTFactory().create( comparisonType, comparisonText ); AST operand1 = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[0] ); op1.setFirstChild( operand1 ); container.setFirstChild( op1 ); AST op2 = getASTFactory().create( comparisonType, comparisonText ); AST operand2 = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[1] ); op2.setFirstChild( operand2 ); op1.setNextSibling( op2 ); AST op = getASTFactory().create( comparisonType, comparisonText ); AST operand = getASTFactory().create( HqlSqlTokenTypes.SQL_TOKEN, mutationTexts[i] ); op.setFirstChild( operand ); AST newContainer = getASTFactory().create( expansionConnectorType, expansionConnectorText ); container.setFirstChild( newContainer ); newContainer.setNextSibling( op );
/** * {@inheritDoc} */ @Override public void initialize() { // TODO : this really needs to be delayed unitl after we definitively know the operand node type; // where this is currently a problem is parameters for which where we cannot unequivocally // resolve an expected type Type operandType = extractDataType( getOperand() ); if ( operandType == null ) { return; } SessionFactoryImplementor sessionFactory = getSessionFactoryHelper().getFactory(); int operandColumnSpan = operandType.getColumnSpan( sessionFactory ); if ( operandColumnSpan > 1 ) { mutateRowValueConstructorSyntax( operandColumnSpan ); } }