1 6 7 package com.hp.hpl.jena.db.impl; 8 9 import java.util.ArrayList ; 10 import java.util.List ; 11 12 15 16 public class DBQuery 17 { 18 int argCnt; String argType; List argIndex; int varCnt; int aliasCnt; String stmt; VarDesc[] vars; int[] resList; int graphId; String table; IPSet pset; IRDBDriver driver; boolean qryOnlyStmt; boolean qryOnlyReif; boolean qryFullReif; DriverRDB.GenSQLAnd sqlAnd; 34 35 boolean isMultiModel; boolean isSingleValued; boolean isCacheable; boolean isReifier; boolean isEmpty; 41 42 public DBQuery ( SpecializedGraph sg, List varList, 43 boolean queryOnlyStmt, boolean queryOnlyReif, boolean queryFullReif ) { 44 45 argCnt = 0; 46 argType = ""; 47 argIndex = new ArrayList (); 48 aliasCnt = 0; 49 stmt = ""; 50 isMultiModel = true; isSingleValued = false; isCacheable = true; 53 if ( sg != null ) { 54 pset = sg.getPSet(); 55 isReifier = sg instanceof SpecializedGraphReifier; 56 isEmpty = false; 57 graphId = sg.getGraphId(); 58 table = pset.getTblName(); 59 driver = pset.driver(); 60 } else { 61 pset = null; 62 isReifier = false; 63 isEmpty = true; 64 driver = null; 65 } 66 sqlAnd = new IRDBDriver.GenSQLAnd(); 67 qryOnlyStmt = queryOnlyStmt; 68 qryOnlyReif = queryOnlyReif; 69 qryFullReif = queryFullReif; 70 vars = new VarDesc[varList.size()]; 72 for ( varCnt=0; varCnt<varList.size(); varCnt++ ) { 73 vars[varCnt] = (VarDesc) varList.get(varCnt); 74 } 75 76 } 77 78 public VarDesc getBinding ( int i ) { 79 return vars[i]; 80 } 81 82 public VarDesc findBinding ( String v ) { 83 int i; 84 for ( i=0; i<vars.length; i++ ) { 85 if ( vars[i].var.getName().equals(v) ) 86 return vars[i]; 87 } 88 return null; 89 } 90 91 public void newAlias() { 92 aliasCnt++; 93 } 94 95 } 96 97 126 | Popular Tags |