use of org.dbflute.util.Srl.ScopeInfo in project dbflute-core by dbflute.
the class EmbeddedVariableNode method processDynamicBinding.
protected boolean processDynamicBinding(CommandContext ctx, Object firstValue, Class<?> firstType, String embeddedString) {
final ScopeInfo first = Srl.extractScopeFirst(embeddedString, "/*", "*/");
if (first == null) {
return false;
}
// unsupported general purpose options in dynamic for now, e.g. MailFlute, may be almost unneeded
final SqlAnalyzer analyzer = new SqlAnalyzer(embeddedString, _blockNullParameter);
final Node rootNode = analyzer.analyze();
final CommandContextCreator creator = new CommandContextCreator(new String[] { "pmb" }, new Class<?>[] { firstType });
final CommandContext rootCtx = creator.createCommandContext(new Object[] { firstValue });
rootNode.accept(rootCtx);
final String sql = rootCtx.getSql();
ctx.addSql(sql, rootCtx.getBindVariables(), rootCtx.getBindVariableTypes());
return true;
}
use of org.dbflute.util.Srl.ScopeInfo in project dbflute-core by dbflute.
the class DfSql2EntityTask method extractSql2EntityHintedClassification.
protected String extractSql2EntityHintedClassification(String entityName, DfCustomizeEntityInfo entityInfo, Column column) {
final String comment = column.getComment();
final ScopeInfo scopeInfo = Srl.extractScopeFirst(comment, "cls(", ")");
if (scopeInfo != null) {
final String classification = scopeInfo.getContent().trim();
if (!getProperties().getClassificationProperties().hasClassificationTop(classification)) {
throwUnknownClassificationSpecifiedInHintException(entityName, entityInfo, column, classification);
}
return classification;
}
return null;
}
Aggregations