Examples of MixedSqlNode


Examples of org.apache.ibatis.builder.xml.dynamic.MixedSqlNode

      sql.append(fragment);
      sql.append(" ");
    }
    ArrayList<SqlNode> contents = new ArrayList<SqlNode>();
    contents.add(new TextSqlNode(sql.toString()));
    MixedSqlNode rootSqlNode = new MixedSqlNode(contents);
    return new DynamicSqlSource(configuration, rootSqlNode);
  }
View Full Code Here

Examples of org.apache.ibatis.builder.xml.dynamic.MixedSqlNode

          sql.append(fragment);
          sql.append(" ");
        }
        ArrayList<SqlNode> contents = new ArrayList<SqlNode>();
        contents.add(new TextSqlNode(sql.toString()));
        MixedSqlNode rootSqlNode = new MixedSqlNode(contents);
        return new DynamicSqlSource(configuration, rootSqlNode);
      } else if (sqlProviderAnnotationType != null) {
        Annotation sqlProviderAnnotation = method.getAnnotation(sqlProviderAnnotationType);
        return new ProviderSqlSource(assistant.getConfiguration(), sqlProviderAnnotation);
      }
View Full Code Here

Examples of org.apache.ibatis.builder.xml.dynamic.MixedSqlNode

          sql.append(fragment);
          sql.append(" ");
        }
        ArrayList<SqlNode> contents = new ArrayList<SqlNode>();
        contents.add(new TextSqlNode(sql.toString()));
        MixedSqlNode rootSqlNode = new MixedSqlNode(contents);
        return new DynamicSqlSource(configuration, rootSqlNode);
      } else if (sqlProviderAnnotationType != null) {
        Annotation sqlProviderAnnotation = method.getAnnotation(sqlProviderAnnotationType);
        return new ProviderSqlSource(assistant.getConfiguration(), sqlProviderAnnotation);
      }
View Full Code Here

Examples of org.apache.ibatis.builder.xml.dynamic.MixedSqlNode

      sql.append(fragment);
      sql.append(" ");
    }
    ArrayList<SqlNode> contents = new ArrayList<SqlNode>();
    contents.add(new TextSqlNode(sql.toString()));
    MixedSqlNode rootSqlNode = new MixedSqlNode(contents);
    return new DynamicSqlSource(configuration, rootSqlNode);
  }
View Full Code Here

Examples of org.apache.ibatis.scripting.xmltags.MixedSqlNode

public class DynamicSqlSourceTest extends BaseDataTest {

  @Test
  public void shouldDemonstrateSimpleExpectedTextWithNoLoopsOrConditionals() throws Exception {
    final String expected = "SELECT * FROM BLOG";
    final MixedSqlNode sqlNode = mixedContents(new TextSqlNode(expected));
    DynamicSqlSource source = createDynamicSqlSource(sqlNode);
    BoundSql boundSql = source.getBoundSql(null);
    assertEquals(expected, boundSql.getSql());
  }
View Full Code Here

Examples of org.apache.ibatis.scripting.xmltags.MixedSqlNode

    createBlogDataSource();
    final String resource = "org/apache/ibatis/builder/MapperConfig.xml";
    final Reader reader = Resources.getResourceAsReader(resource);
    SqlSessionFactory sqlMapper = new SqlSessionFactoryBuilder().build(reader);
    Configuration configuration = sqlMapper.getConfiguration();
    MixedSqlNode sqlNode = mixedContents(contents);
    return new DynamicSqlSource(configuration, sqlNode);
  }
View Full Code Here

Examples of org.apache.ibatis.scripting.xmltags.MixedSqlNode

    MixedSqlNode sqlNode = mixedContents(contents);
    return new DynamicSqlSource(configuration, sqlNode);
  }

  private MixedSqlNode mixedContents(SqlNode... contents) {
    return new MixedSqlNode(Arrays.asList(contents));
  }
View Full Code Here

Examples of org.apache.ibatis.scripting.xmltags.MixedSqlNode

  }

  @Test
  public void shouldMapNullStringsToEmptyStrings() {
    final String expected = "id=${id}";
    final MixedSqlNode sqlNode = mixedContents(new TextSqlNode(expected));
    final DynamicSqlSource source = new DynamicSqlSource(new Configuration(), sqlNode);
    String sql = source.getBoundSql(new Bean(null)).getSql();
    Assert.assertEquals("id=", sql);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.