Search in sources :

Example 1 with SqlParser

use of org.jdbi.v3.core.statement.SqlParser in project jdbi by jdbi.

the class UseSqlParserImpl method configureForType.

@Override
public void configureForType(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType) {
    UseSqlParser anno = (UseSqlParser) annotation;
    try {
        final SqlParser parser = instantiate(anno.value(), sqlObjectType, null);
        registry.get(SqlStatements.class).setSqlParser(parser);
    } catch (Exception e) {
        throw new IllegalStateException(e);
    }
}
Also used : UseSqlParser(org.jdbi.v3.sqlobject.config.UseSqlParser) SqlStatements(org.jdbi.v3.core.statement.SqlStatements) SqlParser(org.jdbi.v3.core.statement.SqlParser) UseSqlParser(org.jdbi.v3.sqlobject.config.UseSqlParser)

Example 2 with SqlParser

use of org.jdbi.v3.core.statement.SqlParser in project jdbi by jdbi.

the class UseSqlParserImpl method configureForMethod.

@Override
public void configureForMethod(ConfigRegistry registry, Annotation annotation, Class<?> sqlObjectType, Method method) {
    UseSqlParser anno = (UseSqlParser) annotation;
    try {
        final SqlParser parser = instantiate(anno.value(), sqlObjectType, method);
        registry.get(SqlStatements.class).setSqlParser(parser);
    } catch (Exception e) {
        throw new IllegalStateException(e);
    }
}
Also used : UseSqlParser(org.jdbi.v3.sqlobject.config.UseSqlParser) SqlStatements(org.jdbi.v3.core.statement.SqlStatements) SqlParser(org.jdbi.v3.core.statement.SqlParser) UseSqlParser(org.jdbi.v3.sqlobject.config.UseSqlParser)

Aggregations

SqlParser (org.jdbi.v3.core.statement.SqlParser)2 SqlStatements (org.jdbi.v3.core.statement.SqlStatements)2 UseSqlParser (org.jdbi.v3.sqlobject.config.UseSqlParser)2