1 | private static String[] extractMutationTexts(Node operand, int count) {↵ | | 1 | private static String[] extractMutationTexts(Node operand, int count) {↵
|
2 | if ( operand instanceof ParameterNode ) {↵ | | 2 | if ( operand instanceof ParameterNode ) {↵
|
3 | String[] rtn = new String[count];↵ | | 3 | String[] rtn = new String[count];↵
|
4 | for ( int i = 0; i < count; i++ ) {↵ | | 4 | for ( int i = 0; i < count; i++ ) {↵
|
5 | rtn[i] = "?";↵ | | 5 | rtn[i] = "?";↵
|
6 | }↵ | | 6 | }↵
|
7 | return rtn;↵ | | 7 | return rtn;↵
|
8 | }↵ | | 8 | }↵
|
9 | else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) {↵ | | 9 | else if ( operand.getType() == HqlSqlTokenTypes.VECTOR_EXPR ) {↵
|
10 | String[] rtn = new String[ operand.getNumberOfChildren() ];↵ | | 10 | String[] rtn = new String[ operand.getNumberOfChildren() ];↵
|
11 | int x = 0;↵ | | 11 | int x = 0;↵
|
12 | AST node = operand.getFirstChild();↵ | | 12 | AST node = operand.getFirstChild();↵
|
13 | while ( node != null ) {↵ | | 13 | while ( node != null ) {↵
|
14 | rtn[ x++ ] = node.getText();↵ | | 14 | rtn[ x++ ] = node.getText();↵
|
15 | node = node.getNextSibling();↵ | | 15 | node = node.getNextSibling();↵
|
16 | }↵ | | 16 | }↵
|
17 | return rtn;↵ | | 17 | return rtn;↵
|
18 | }↵ | | 18 | }↵
|
19 | else if ( operand instanceof SqlNode ) {↵ | | 19 | else if ( operand instanceof SqlNode ) {↵
|
20 | String nodeText = operand.getText();↵ | | 20 | String nodeText = operand.getText();↵
|
21 | if ( nodeText.startsWith( "(" ) ) {↵ | | 21 | if ( nodeText.startsWith( "(" ) ) {↵
|
22 | nodeText = nodeText.substring( 1 );↵ | | 22 | nodeText = nodeText.substring( 1 );↵
|
23 | }↵ | | 23 | }↵
|
24 | if ( nodeText.endsWith( ")" ) ) {↵ | | 24 | if ( nodeText.endsWith( ")" ) ) {↵
|
25 | nodeText = nodeText.substring( 0, nodeText.length() - 1 );↵ | | 25 | nodeText = nodeText.substring( 0, nodeText.length() - 1 );↵
|
26 | }↵ | | 26 | }↵
|
27 | String[] splits = StringHelper.split( ", ", nodeText );↵ | | 27 | String[] splits = StringHelper.split( ", ", nodeText );↵
|
28 | if ( count != splits.length ) {↵ | | 28 | if ( count != splits.length ) {↵
|
29 | throw new HibernateException( "SqlNode's text did not reference expected number of columns" );↵ | | 29 | throw new HibernateException( "SqlNode's text did not reference expected number of columns" );↵
|
30 | }↵ | | 30 | }↵
|
31 | return splits;↵ | | 31 | return splits;↵
|
32 | }↵ | | 32 | }↵
|
33 | else {↵ | | 33 | else {↵
|
34 | throw new HibernateException( "dont know how to extract row value elements from node : " + operand );↵ | | 34 | throw new HibernateException( "dont know how to extract row value elements from node : " + operand );↵
|
35 | | | 35 |
|