1 22 23 28 29 package org.xquark.mapper.storage; 30 31 import java.sql.SQLException ; 32 33 import org.xquark.mapper.RepositoryException; 34 import org.xquark.mapper.dbms.AbstractConnection; 35 import org.xquark.mapper.mapping.MappingSetIterator; 36 import org.xquark.mapper.metadata.CollectionMappingInfo; 37 import org.xquark.xml.xdbc.XMLDBCException; 38 39 42 class DocumentExplorer extends TableExplorer 43 { 44 private static final String RCSRevision = "$Revision: 1.1 $"; 45 private static final String RCSName = "$Name: $"; 46 47 private DocumentTuple[] docTuples; 48 private DocumentStructExplorer docNode; 49 private DocumentExtraDataExplorer docExtraNode; 50 51 52 public DocumentExplorer(_RepositoryCollection collection) throws SQLException , XMLDBCException 53 { 54 super(collection); 55 56 wNode = docNode = new DocumentStructExplorer(collection.getMetadata()); 57 extraNode = docExtraNode = new DocumentExtraDataExplorer(collection.getMetadata()); 58 59 tuples = docTuples = new DocumentTuple[collection.getMetadata().getMappingStatementsCount()]; 61 MappingSetIterator it = collection.getMetadata().getMappingSetIterator(); 62 CollectionMappingInfo table; 63 64 while (it.hasNext()) 65 { 66 table = (CollectionMappingInfo)it.next(); 67 docTuples[table.getTableMapping().getTableIndex()] = 68 new DocumentTuple(table); 69 } 70 } 71 72 public void initDocReading(AbstractConnection connection) throws SQLException , RepositoryException 73 { 74 for (int i = 0; i < tuples.length; i++) 76 { 77 docTuples[i].init(connection, collection.getMetadata()); 78 } 79 80 docNode.initDocReading(connection); 81 docExtraNode.initDocReading(connection); 82 } 83 84 public void initDocumentExploration(String ID) throws SQLException , RepositoryException 85 { 86 for (int i = 0; i < tuples.length; i++) 88 { 89 docTuples[i].execQuery(ID); 90 } 91 92 docNode.getDocument(ID); 94 docExtraNode.getDocument(ID); 95 } 96 97 } 98 | Popular Tags |