Strabon

changeset 95:31fea69dccba

correct indentation
author George Garbis <ggarbis@di.uoa.gr>
date Thu Apr 05 12:45:48 2012 +0300 (2012-04-05)
parents 807b8e831226
children 00cdb7b244b4
files postgis/src/main/java/org/openrdf/sail/postgis/PostGISConnectionFactory.java
line diff
     1.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/PostGISConnectionFactory.java	Thu Apr 05 12:43:45 2012 +0300
     1.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/PostGISConnectionFactory.java	Thu Apr 05 12:45:48 2012 +0300
     1.3 @@ -67,68 +67,67 @@
     1.4  	@Override
     1.5  	public SailConnection createConnection()
     1.6  	throws SailException
     1.7 -{
     1.8 -	try {
     1.9 -		Connection db = getConnection();
    1.10 -		db.setAutoCommit(true);
    1.11 -		if (db.getTransactionIsolation() != TRANSACTION_READ_COMMITTED) {
    1.12 -			db.setTransactionIsolation(TRANSACTION_READ_COMMITTED);
    1.13 +	{
    1.14 +		try {
    1.15 +			Connection db = getConnection();
    1.16 +			db.setAutoCommit(true);
    1.17 +			if (db.getTransactionIsolation() != TRANSACTION_READ_COMMITTED) {
    1.18 +				db.setTransactionIsolation(TRANSACTION_READ_COMMITTED);
    1.19 +			}
    1.20 +			TripleManager tripleManager = new TripleManager();
    1.21 +			GeneralDBTripleRepository s = new PostGISTripleRepository();
    1.22 +			s.setTripleManager(tripleManager);
    1.23 +			s.setValueFactory(vf);
    1.24 +			s.setConnection(db);
    1.25 +			s.setBNodeTable(bnodeTable);
    1.26 +			s.setURITable(uriTable);
    1.27 +			s.setLiteralTable(literalTable);
    1.28 +			s.setIdSequence(ids);
    1.29 +			DefaultSailChangedEvent sailChangedEvent = new DefaultSailChangedEvent(sail);
    1.30 +			s.setSailChangedEvent(sailChangedEvent);
    1.31 +			TableFactory tables = createTableFactory();
    1.32 +			TransTableManager trans = createTransTableManager();
    1.33 +			trans.setIdSequence(ids);
    1.34 +			tripleManager.setTransTableManager(trans);
    1.35 +			trans.setBatchQueue(tripleManager.getQueue());
    1.36 +			trans.setSailChangedEvent(sailChangedEvent);
    1.37 +			trans.setConnection(db);
    1.38 +			trans.setTemporaryTableFactory(tables);
    1.39 +			trans.setStatementsTable(tripleTableManager);
    1.40 +			trans.setFromDummyTable(getFromDummyTable());
    1.41 +			trans.initialize();
    1.42 +			s.setTransaction(trans);
    1.43 +			GeneralDBQueryBuilderFactory bfactory = createQueryBuilderFactory();
    1.44 +			bfactory.setValueFactory(vf);
    1.45 +			bfactory.setUsingHashTable(hashManager != null);
    1.46 +			s.setQueryBuilderFactory(bfactory);
    1.47 +			GeneralDBConnection conn = new GeneralDBConnection(sail, s);
    1.48 +			conn.setNamespaces(namespaces);
    1.49 +			GeneralDBEvaluationFactory efactory = new PostGISEvaluationFactory();
    1.50 +			efactory.setQueryBuilderFactory(bfactory);
    1.51 +			efactory.setRdbmsTripleRepository(s);
    1.52 +			efactory.setIdSequence(ids);
    1.53 +			conn.setRdbmsEvaluationFactory(efactory);
    1.54 +			GeneralDBQueryOptimizer optimizer = createOptimizer();
    1.55 +			GeneralDBSelectQueryOptimizerFactory selectOptimizerFactory = createSelectQueryOptimizerFactory();
    1.56 +			selectOptimizerFactory.setTransTableManager(trans);
    1.57 +			selectOptimizerFactory.setValueFactory(vf);
    1.58 +			selectOptimizerFactory.setIdSequence(ids);
    1.59 +			optimizer.setSelectQueryOptimizerFactory(selectOptimizerFactory);
    1.60 +			optimizer.setValueFactory(vf);
    1.61 +			optimizer.setBnodeTable(bnodeTable);
    1.62 +			optimizer.setUriTable(uriTable);
    1.63 +			optimizer.setLiteralTable(literalTable);
    1.64 +			optimizer.setHashTable(hashTable);
    1.65 +			conn.setRdbmsQueryOptimizer(optimizer);
    1.66 +			conn.setLockManager(lock);
    1.67 +			return conn;
    1.68  		}
    1.69 -		TripleManager tripleManager = new TripleManager();
    1.70 -		GeneralDBTripleRepository s = new PostGISTripleRepository();
    1.71 -		s.setTripleManager(tripleManager);
    1.72 -		s.setValueFactory(vf);
    1.73 -		s.setConnection(db);
    1.74 -		s.setBNodeTable(bnodeTable);
    1.75 -		s.setURITable(uriTable);
    1.76 -		s.setLiteralTable(literalTable);
    1.77 -		s.setIdSequence(ids);
    1.78 -		DefaultSailChangedEvent sailChangedEvent = new DefaultSailChangedEvent(sail);
    1.79 -		s.setSailChangedEvent(sailChangedEvent);
    1.80 -		TableFactory tables = createTableFactory();
    1.81 -		TransTableManager trans = createTransTableManager();
    1.82 -		trans.setIdSequence(ids);
    1.83 -		tripleManager.setTransTableManager(trans);
    1.84 -		trans.setBatchQueue(tripleManager.getQueue());
    1.85 -		trans.setSailChangedEvent(sailChangedEvent);
    1.86 -		trans.setConnection(db);
    1.87 -		trans.setTemporaryTableFactory(tables);
    1.88 -		trans.setStatementsTable(tripleTableManager);
    1.89 -		trans.setFromDummyTable(getFromDummyTable());
    1.90 -		trans.initialize();
    1.91 -		s.setTransaction(trans);
    1.92 -		GeneralDBQueryBuilderFactory bfactory = createQueryBuilderFactory();
    1.93 -		bfactory.setValueFactory(vf);
    1.94 -		bfactory.setUsingHashTable(hashManager != null);
    1.95 -		s.setQueryBuilderFactory(bfactory);
    1.96 -		GeneralDBConnection conn = new GeneralDBConnection(sail, s);
    1.97 -		conn.setNamespaces(namespaces);
    1.98 -		GeneralDBEvaluationFactory efactory = new PostGISEvaluationFactory();
    1.99 -		efactory.setQueryBuilderFactory(bfactory);
   1.100 -		efactory.setRdbmsTripleRepository(s);
   1.101 -		efactory.setIdSequence(ids);
   1.102 -		conn.setRdbmsEvaluationFactory(efactory);
   1.103 -		GeneralDBQueryOptimizer optimizer = createOptimizer();
   1.104 -		GeneralDBSelectQueryOptimizerFactory selectOptimizerFactory = createSelectQueryOptimizerFactory();
   1.105 -		selectOptimizerFactory.setTransTableManager(trans);
   1.106 -		selectOptimizerFactory.setValueFactory(vf);
   1.107 -		selectOptimizerFactory.setIdSequence(ids);
   1.108 -		optimizer.setSelectQueryOptimizerFactory(selectOptimizerFactory);
   1.109 -		optimizer.setValueFactory(vf);
   1.110 -		optimizer.setBnodeTable(bnodeTable);
   1.111 -		optimizer.setUriTable(uriTable);
   1.112 -		optimizer.setLiteralTable(literalTable);
   1.113 -		optimizer.setHashTable(hashTable);
   1.114 -		conn.setRdbmsQueryOptimizer(optimizer);
   1.115 -		conn.setLockManager(lock);
   1.116 -		return conn;
   1.117 +		catch (SQLException e) {
   1.118 +			throw new RdbmsException(e);
   1.119 +		}
   1.120  	}
   1.121 -	catch (SQLException e) {
   1.122 -		throw new RdbmsException(e);
   1.123 -	}
   1.124 -}
   1.125  
   1.126 -	
   1.127  	/**
   1.128  	 * FROM DUAL
   1.129  	 *