use of org.apache.jena.sdb.layout2.TableDescTriples in project jena by apache.
the class StoreTriplesNodesHashDB2 method loaderSimple.
static StoreLoader loaderSimple(SDBConnection connection) {
// Temporary - simple loader for development.
//new LoaderTuplesNodes(connection, TupleLoaderHashDerby.class),
TupleLoader tLoader = new TupleLoaderOneHash(connection, new TableDescTriples());
StoreLoader sLoader = new TupleGraphLoader(tLoader);
return sLoader;
}
use of org.apache.jena.sdb.layout2.TableDescTriples in project jena by apache.
the class FmtLayout2IndexDerby method formatTableTriples.
@Override
protected void formatTableTriples() {
// TODO Generalize : return a template
TableDescTriples desc = new TableDescTriples();
dropTable(desc.getTableName());
try {
String x = sqlStr("CREATE TABLE %s (", " %2$s int NOT NULL,", " %3$s int NOT NULL,", " %4$s int NOT NULL,", " PRIMARY KEY (%2$s, %3$s, %4$s)", ")");
x = String.format(x, desc.getTableName(), desc.getSubjectColName(), desc.getPredicateColName(), desc.getObjectColName());
connection().exec(sqlStr("CREATE TABLE " + desc.getTableName() + " (", " s int NOT NULL,", " p int NOT NULL,", " o int NOT NULL,", " PRIMARY KEY (s, p, o)", ")"));
} catch (SQLException ex) {
throw new SDBExceptionSQL("SQLException formatting table '" + TableDescTriples.name() + "'", ex);
}
}
Aggregations