1 22 23 package org.xquark.extractor.sybase; 24 25 import org.xquark.extractor.algebra.*; 26 import org.xquark.extractor.metadata.MetaDataManager; 27 import org.xquark.extractor.runtime.QueryFactory; 28 import org.xquark.extractor.runtime.Query; 29 import org.xquark.xml.xdbc.XMLDBCException; 30 import org.xquark.xquery.metadata.resolver.MetadataAccess; 31 import org.xquark.xquery.parser.XQueryExpression; 32 33 public class SybaseQueryFactory extends QueryFactory 34 { 35 private static final String RCSRevision = "$Revision: 1.5 $"; 36 private static final String RCSName = "$Name: $"; 37 38 protected TempTableIDGenerator _tmpTableIDProvider; 39 41 47 48 public SybaseQueryFactory(MetaDataManager metadataManager, MetadataAccess metadata) 49 throws XMLDBCException { 50 super(metadataManager, metadata); 51 } 52 53 protected void createVisitors() 54 { 55 TypeInterpreter ti = new TypeInterpreter(); 56 _genAlgebraVisitor = new GenAlgebraVisitor( ti,_metadataManager, _attIDProvider, _relIDProvider); 57 58 _algebraTypeVisitor = new AlgebraTypeVisitor(); 59 _removeProjectVisitor = new RemoveIntermediateProjectVisitor(); 60 _brav = new BuildReferredAttributes(); 61 _apv = new AnalyzePredicateVisitor(); 62 63 _tmpTableIDProvider = new TempTableIDGenerator(); 64 _genSqlVisitor = new org.xquark.extractor.sybase.SybaseGenSqlVisitor(_relIDProvider, _tmpTableIDProvider); 65 _genSqlVisitor.setMetadataManager(_metadataManager); 66 } 67 68 public Query.CompiledExpression compileQuery(XQueryExpression xExpr) throws XMLDBCException { 69 _tmpTableIDProvider.reset(); 70 return super.compileQuery(xExpr); 71 } 72 } 73 | Popular Tags |