use of org.apache.jena.sdb.core.ScopeEntry in project jena by apache.
the class SQLBridge2 method buildProject.
@Override
protected void buildProject() {
for (Var v : getProject()) {
if (!v.isNamedVar())
continue;
ScopeEntry e = getSqlNode().getNodeScope().findScopeForVar(v);
if (e == null) {
// Should be a column mentioned in the SELECT which is not mentioned in this block
continue;
}
SqlColumn vCol = e.getColumn();
SqlTable table = vCol.getTable();
String sqlVarName = allocSqlName(v);
// Need to allocate aliases because otherwise we need to access
// "table.column" as a label and "." is illegal in a label
String vLex = SQLUtils.gen(sqlVarName, "lex");
// Call overrideable helper method for lex column (Oracle)
SqlColumn cLex = getLexSqlColumn(table);
String vLexNChar = SQLUtils.gen(sqlVarName, "lexNChar");
// Call overrideable helper method for lex column (Oracle)
SqlColumn cLexNChar = getLexNCharSqlColumn(table);
String vDatatype = SQLUtils.gen(sqlVarName, "datatype");
SqlColumn cDatatype = new SqlColumn(table, "datatype");
String vLang = SQLUtils.gen(sqlVarName, "lang");
SqlColumn cLang = new SqlColumn(table, "lang");
String vType = SQLUtils.gen(sqlVarName, "type");
SqlColumn cType = new SqlColumn(table, "type");
addProject(cLex, vLex);
// Oracle NCLOB support
if (cLexNChar != null) {
addProject(cLexNChar, vLexNChar);
}
addProject(cDatatype, vDatatype);
addProject(cLang, vLang);
addProject(cType, vType);
addAnnotation(sqlVarName + "=" + v.toString());
}
setAnnotation();
}
Aggregations