Search in sources :

Example 1 with TableDescTriples

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;
}
Also used : TupleLoader(org.apache.jena.sdb.store.TupleLoader) TupleGraphLoader(org.apache.jena.sdb.store.TupleGraphLoader) TableDescTriples(org.apache.jena.sdb.layout2.TableDescTriples) StoreLoader(org.apache.jena.sdb.store.StoreLoader)

Example 2 with TableDescTriples

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);
    }
}
Also used : SDBExceptionSQL(org.apache.jena.sdb.sql.SDBExceptionSQL) SQLException(java.sql.SQLException) TableDescTriples(org.apache.jena.sdb.layout2.TableDescTriples)

Aggregations

TableDescTriples (org.apache.jena.sdb.layout2.TableDescTriples)2 SQLException (java.sql.SQLException)1 SDBExceptionSQL (org.apache.jena.sdb.sql.SDBExceptionSQL)1 StoreLoader (org.apache.jena.sdb.store.StoreLoader)1 TupleGraphLoader (org.apache.jena.sdb.store.TupleGraphLoader)1 TupleLoader (org.apache.jena.sdb.store.TupleLoader)1