Search in sources :

Example 1 with UseTemplateEngine

use of org.jdbi.v3.sqlobject.config.UseTemplateEngine in project jdbi by jdbi.

the class UseTemplateEngineImpl method configureForType.

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

Example 2 with UseTemplateEngine

use of org.jdbi.v3.sqlobject.config.UseTemplateEngine in project jdbi by jdbi.

the class UseTemplateEngineImpl method configureForMethod.

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

Aggregations

SqlStatements (org.jdbi.v3.core.statement.SqlStatements)2 TemplateEngine (org.jdbi.v3.core.statement.TemplateEngine)2 UseTemplateEngine (org.jdbi.v3.sqlobject.config.UseTemplateEngine)2