Examples of SqlSource


Examples of org.apache.ibatis.mapping.SqlSource

        }).build();
  }

  public static MappedStatement prepareSelectBlogByIdAndAuthor(final Configuration config) {
    final TypeHandlerRegistry registry = config.getTypeHandlerRegistry();
    final SqlSource sqlSource = new StaticSqlSource(config,"SELECT b.id, b.author_id, b.title, a.username, a.password, a.email, a.bio" +
        " FROM blog b" +
        " INNER JOIN author a ON b.author_id = a.id" +
        " WHERE b.id = ? and a.id = ?");
    final ParameterMap parameterMap = new ParameterMap.Builder(config, "defaultParameterMap", Map.class,
        new ArrayList<ParameterMapping>() {
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

  }

  public static MappedStatement prepareSelectPostsForBlogMappedStatement(final Configuration config) {
    final TypeHandlerRegistry registry = config.getTypeHandlerRegistry();
    final SqlSource sqlSource = new StaticSqlSource(config,"SELECT p.id, p.created_on, p.blog_id, p.section, p.subject, p.body, pt.tag_id," +
        " t.name as tag_name, c.id as comment_id, c.name as comment_name, c.comment" +
        " FROM post p" +
        " INNER JOIN post_tag pt ON pt.post_id = p.id" +
        " INNER JOIN tag t ON pt.tag_id = t.id" +
        " LEFT OUTER JOIN comment c ON c.post_id = p.id" +
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

        }).build();
  }

  public static MappedStatement prepareSelectPostMappedStatement(final Configuration config) {
    final TypeHandlerRegistry registry = config.getTypeHandlerRegistry();
    final SqlSource sqlSource = new StaticSqlSource(config,"SELECT p.id, p.created_on, p.blog_id, p.section, p.subject, p.body, pt.tag_id," +
        " t.name as tag_name, c.id as comment_id, c.name as comment_name, c.comment" +
        " FROM post p" +
        " LEFT OUTER JOIN post_tag pt ON pt.post_id = p.id" +
        " LEFT OUTER JOIN tag t ON pt.tag_id = t.id" +
        " LEFT OUTER JOIN comment c ON c.post_id = p.id" +
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

  }


  public static MappedStatement prepareSelectPostWithBlogByAuthorMappedStatement(final Configuration config) {
    final TypeHandlerRegistry registry = config.getTypeHandlerRegistry();
    final SqlSource sqlSource = new StaticSqlSource(config,"SELECT p.id, p.created_on, p.blog_id, p.author_id, p.section, p.subject, p.body, pt.tag_id," +
        " t.name as tag_name, c.id as comment_id, c.name as comment_name, c.comment" +
        " FROM post p" +
        " LEFT OUTER JOIN post_tag pt ON pt.post_id = p.id" +
        " LEFT OUTER JOIN tag t ON pt.tag_id = t.id" +
        " LEFT OUTER JOIN comment c ON c.post_id = p.id" +
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

  }

  void parseStatement(Method method) {
    Class<?> parameterTypeClass = getParameterType(method);
    LanguageDriver languageDriver = getLanguageDriver(method);
    SqlSource sqlSource = getSqlSourceFromAnnotations(method, parameterTypeClass, languageDriver);
    if (sqlSource != null) {
      Options options = method.getAnnotation(Options.class);
      final String mappedStatementId = type.getName() + "." + method.getName();
      Integer fetchSize = null;
      Integer timeout = null;
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

    boolean flushCache = false;
    String parameterMap = null;
    String resultMap = null;
    ResultSetType resultSetTypeEnum = null;

    SqlSource sqlSource = buildSqlSourceFromStrings(selectKeyAnnotation.statement(), parameterTypeClass, languageDriver);
    SqlCommandType sqlCommandType = SqlCommandType.SELECT;

    assistant.addMappedStatement(id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterTypeClass, resultMap, resultTypeClass, resultSetTypeEnum,
        flushCache, useCache, false,
        keyGenerator, keyProperty, keyColumn, null, languageDriver, null);
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

    }
  }

  @Override
  public BoundSql getBoundSql(Object parameterObject) {
    SqlSource sqlSource = createSqlSource(parameterObject);
    return sqlSource.getBoundSql(parameterObject);
  }
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

*/
public class RawLanguageDriver extends XMLLanguageDriver {

  @Override
  public SqlSource createSqlSource(Configuration configuration, XNode script, Class<?> parameterType) {
    SqlSource source = super.createSqlSource(configuration, script, parameterType);
    checkIsNotDynamic(source);
    return source;
  }
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

    return source;
  }

  @Override
  public SqlSource createSqlSource(Configuration configuration, String script, Class<?> parameterType) {
    SqlSource source = super.createSqlSource(configuration, script, parameterType);
    checkIsNotDynamic(source);
    return source;
  }
View Full Code Here

Examples of org.apache.ibatis.mapping.SqlSource

  }

  public SqlSource parseScriptNode() {
    List<SqlNode> contents = parseDynamicTags(context);
    MixedSqlNode rootSqlNode = new MixedSqlNode(contents);
    SqlSource sqlSource = null;
    if (isDynamic) {
      sqlSource = new DynamicSqlSource(configuration, rootSqlNode);
    } else {
      sqlSource = new RawSqlSource(configuration, rootSqlNode, parameterType);
    }
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.