Strabon

changeset 653:413e2e0f4b4b temporals

added preparted statements for creating period table and inserting records in it
author Konstantina Bereta <Konstantina.Bereta@di.uoa.gr>
date Wed Oct 24 17:20:57 2012 +0300 (2012-10-24)
parents 0c88d7c2a066
children ce586092b475
files generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBSqlTable.java generaldb/src/main/java/org/openrdf/sail/generaldb/schema/GeoValueTable.java monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBSqlTable.java postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java
line diff
     1.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBSqlTable.java	Wed Oct 24 11:42:23 2012 +0300
     1.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/GeneralDBSqlTable.java	Wed Oct 24 17:20:57 2012 +0300
     1.3 @@ -35,7 +35,9 @@
     1.4  	protected abstract String buildClear();
     1.5  
     1.6  	public abstract String buildGeometryCollumn();
     1.7 -	
     1.8 +
     1.9 +	public abstract String buildPeriodCollumn();
    1.10 +
    1.11  	public abstract String buildIndexOnGeometryCollumn();
    1.12  
    1.13  	public abstract String buildInsertGeometryValue();
    1.14 @@ -50,4 +52,14 @@
    1.15  	public abstract String buildDynamicParameterInteger();
    1.16  	
    1.17  	public abstract String buildWhere();
    1.18 +
    1.19 +	public String buildIndexOnPeriodCollumn() {
    1.20 +		// TODO Auto-generated method stub
    1.21 +		return null;
    1.22 +	}
    1.23 +
    1.24 +	public String buildInsertPeriodValue() {
    1.25 +		// TODO Auto-generated method stub
    1.26 +		return null;
    1.27 +	}
    1.28  }
     2.1 --- a/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/GeoValueTable.java	Wed Oct 24 11:42:23 2012 +0300
     2.2 +++ b/generaldb/src/main/java/org/openrdf/sail/generaldb/schema/GeoValueTable.java	Wed Oct 24 17:20:57 2012 +0300
     2.3 @@ -152,7 +152,6 @@
     2.4  			sb.append("WHERE NOT EXISTS (SELECT id FROM ").append(table.getName());
     2.5  			sb.append(" val WHERE val.id = tmp.id)");
     2.6  			INSERT_SELECT = sb.toString();
     2.7 -
     2.8  		}
     2.9  		if (!table.isCreated()) {
    2.10  			createTable(table);
     3.1 --- a/monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBSqlTable.java	Wed Oct 24 11:42:23 2012 +0300
     3.2 +++ b/monetdb/src/main/java/org/openrdf/sail/monetdb/MonetDBSqlTable.java	Wed Oct 24 17:20:57 2012 +0300
     3.3 @@ -79,4 +79,10 @@
     3.4  	public String buildWhere() {
     3.5  		return " WHERE (1=1 OR 1=1) ";
     3.6  	}
     3.7 +
     3.8 +	@Override
     3.9 +	public String buildPeriodCollumn() {
    3.10 +		// TODO Auto-generated method stub
    3.11 +		return null;
    3.12 +	}
    3.13  }
    3.14 \ No newline at end of file
     4.1 --- a/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java	Wed Oct 24 11:42:23 2012 +0300
     4.2 +++ b/postgis/src/main/java/org/openrdf/sail/postgis/PostGISSqlTable.java	Wed Oct 24 17:20:57 2012 +0300
     4.3 @@ -40,11 +40,18 @@
     4.4  	}
     4.5  	
     4.6  	@Override
     4.7 -	public String buildIndexOnGeometryCollumn() {
     4.8 -		return "CREATE INDEX geoindex ON geo_values USING GIST (strdfgeo)";
     4.9 +	public String buildIndexOnPeriodCollumn() {
    4.10 +		//return "CREATE INDEX geoindex ON geo_values USING GIST (strdfgeo)";
    4.11 +		return "CREATE INDEX test_period_idx ON periodvalues USING GiST (period)";
    4.12  	}
    4.13  	
    4.14  	@Override
    4.15 +	public String buildInsertPeriodValue() {
    4.16 +		return " (id, period) VALUES (?,period_in(?))";
    4.17 +	}
    4.18 +	
    4.19 +	
    4.20 +	@Override
    4.21  	public String buildInsertGeometryValue() {
    4.22  		Integer srid=  GeoConstants.defaultSRID;
    4.23  		return " (id, strdfgeo,srid) VALUES (?,ST_Transform(ST_GeomFromWKB(?,?),"+srid+"),?)";
    4.24 @@ -80,4 +87,16 @@
    4.25  	public String buildWhere() {
    4.26  		return " WHERE (1=1) ";
    4.27  	}
    4.28 +
    4.29 +	@Override
    4.30 +	public String buildPeriodCollumn() {
    4.31 +		// TODO Auto-generated method stub
    4.32 +		return null;
    4.33 +	}
    4.34 +
    4.35 +	@Override
    4.36 +	public String buildIndexOnGeometryCollumn() {
    4.37 +		// TODO Auto-generated method stub
    4.38 +		return null;
    4.39 +	}
    4.40  }
    4.41 \ No newline at end of file