Package com.hp.hpl.jena.sdb.core.sqlexpr

Examples of com.hp.hpl.jena.sdb.core.sqlexpr.SqlColumn


            // Access nodes table.
            SqlTable nTable = new SqlTable(getRequest().genId(NodeConstBase),
                                           nodeTableDesc.getTableName()) ;
           
            nTable.addNote("Const: "+FmtUtils.stringForNode(n, getRequest().getPrefixMapping())) ;
            SqlColumn cHash = new SqlColumn(nTable, nodeTableDesc.getHashColName()) ;
            // Record
            constantCols.put(n, new SqlColumn(nTable, nodeTableDesc.getIdColName())) ;
            SqlExpr c = new S_Equal(cHash, hashValue) ;
            sqlNode = SqlBuilder.innerJoin(getRequest(), sqlNode, nTable) ;
            sqlNode = SqlBuilder.restrict(getRequest(), sqlNode, c;
        }
        return sqlNode ;
View Full Code Here


       
        for ( Var v : sqlNode.getCoalesceVars()  )
        {
            if ( ! first ) out.print(" ") ;
            first = false ;
            SqlColumn col = sqlNode.getIdScope().findScopeForVar(v).getColumn() ;
            out.print(v.toString()) ;
            SqlColumn leftCol = join.getLeft().getIdScope().findScopeForVar(v).getColumn() ;
            SqlColumn rightCol = join.getRight().getIdScope().findScopeForVar(v).getColumn() ;
            out.print("["+leftCol+"/"+rightCol+"]") ;
        }
        for ( Var v : sqlNode.getNonCoalesceVars()  )
        {
            if ( ! first ) out.print(" ") ;
            first = false ;
            out.print(v.toString()) ;
            // and where is came from.
            SqlColumn col = join.getIdScope().findScopeForVar(v).getColumn() ;
            out.print("["+col+"]") ;
        }
       
        out.ensureStartOfLine() ;
        visitJoin(sqlNode.getJoinNode()) ;
View Full Code Here

    {
        String str = "" ;
        String sep = "" ;
        for ( Var v : frame.keySet() )
        {
            SqlColumn c = frame.get(v) ;
            str = str + sep + v + ":"+c ;
            sep = " " ;
        }
        if ( parent != null )
            str = str + "=>" + parent.toString() ;
View Full Code Here

    }
   
    @Override
    protected SqlColumn getLexSqlColumn(SqlTable table) {
       
        return new SqlColumn(table, "lex") {
            @Override
            public String getFullColumnName() {
                String col = getTable().getAliasName()+"."+getColumnName();
                return  "CASE WHEN LENGTH("+col+
                        ") <= 2000 THEN NULL ELSE "+col+" END";             
View Full Code Here

    }
   
    @Override
    protected SqlColumn getLexNCharSqlColumn(SqlTable table) {
       
        return new SqlColumn(table, "lexNChar") {
            @Override
            public String getFullColumnName() {
                String col = getTable().getAliasName()+".lex";
                return "CASE WHEN LENGTH("+col+") <= 2000 THEN TO_NCHAR("+
                       col+") ELSE NULL END ";             
View Full Code Here

                return expr ;

            // Find the column for this variable.
            ScopeEntry sc = ssb.getNodeScope().findScopeForVar(v) ;
            // Get the lexical column : this is layout2 specific.
            SqlColumn col = new SqlColumn(sc.getColumn().getTable(), "lex") ;
           
            S_Like sreg = new S_Like(col, patternLike, caseInsensitive) ;
            ssb.getConditions().add(sreg) ;
           
            // Completely replace the filter - so remove from OpFilter.
View Full Code Here

   
    public final void processSlot(SDBRequest request,
                                  SqlTable table, SqlExprList conditions,
                                  Node node, String colName)
{
     SqlColumn thisCol = new SqlColumn(table, colName) ;
     if ( ! node.isVariable() )
     {
         constantSlot(request, node, thisCol, conditions) ;
         return ;
     }
    
     Var var = Var.alloc(node) ;
     if ( table.getIdScope().hasColumnForVar(var) )
     {
         ScopeEntry e = table.getIdScope().findScopeForVar(var) ;
         SqlColumn otherCol = e.getColumn() ;
         SqlExpr c = new S_Equal(otherCol, thisCol) ;
         conditions.add(c) ;
         c.addNote("processVar: "+node) ;
         return ;
     }
View Full Code Here

   
    protected void addProject(SqlColumn col, String colOutName)
    {
        sqlNode = SqlBuilder.project(request,
                                     sqlNode,
                                     new ColAlias(col, new SqlColumn(null, colOutName))) ;
    }
View Full Code Here

            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);
View Full Code Here

     * @param table
     * @author skagels
     *
     */
    protected SqlColumn getLexSqlColumn(SqlTable table) {
        return new SqlColumn(table, "lex") ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sdb.core.sqlexpr.SqlColumn

Copyright © 2018 www.massapicom. 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.