|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.nsdl.mptstore.core.BasicTableManager
public class BasicTableManager
A TableManager designed to perform DDL operations
on separate connections from those used for DML.
The DDL-in-a-separate-connection strategy employed by this
implementation should work with a wide variety of databases.
| Constructor Summary | |
|---|---|
BasicTableManager(javax.sql.DataSource dataSource,
DDLGenerator ddlGenerator,
java.lang.String mapTable,
java.lang.String soTablePrefix)
Initialize the table manager. |
|
| Method Summary | |
|---|---|
int |
dropAllPredicateTables()
Drop all predicate tables and mappings, effectively re-initializing the triplestore. |
int |
dropEmptyPredicateTables()
Drop all unused predicate tables and mappings. |
java.lang.String |
getOrMapTableFor(PredicateNode predicate)
Get the name of the table reserved for relationships of the given type. |
PredicateNode |
getPredicateFor(java.lang.String table)
Get the predicate that's mapped to the given table, if such a mapping exists. |
java.util.Set<PredicateNode> |
getPredicates()
Get the set of predicates for which a table mapping exists. |
java.lang.String |
getTableFor(PredicateNode predicate)
Get the name of the table reserved for relationships of the given type, if it exists. |
java.util.Set<java.lang.String> |
getTables()
Get the set of tables that store per-predicate relationships. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicTableManager(javax.sql.DataSource dataSource,
DDLGenerator ddlGenerator,
java.lang.String mapTable,
java.lang.String soTablePrefix)
throws java.sql.SQLException
dataSource - The DataSource from which to obtain
connections for DDL operations.ddlGenerator - The DDLGenerator to use when DDL is needed.mapTable - The name of the table in which the table-to-predicate
mappings are persisted.soTablePrefix - The prefix for all predicate table names.
java.sql.SQLException - if any kind of database error occurs.| Method Detail |
|---|
public java.lang.String getOrMapTableFor(PredicateNode predicate)
throws java.sql.SQLException
If such a table does not yet exist, it will be automatically created and permanently associated with the given predicate.
getOrMapTableFor in interface TableManagerpredicate - The type of relationship.
null.
java.sql.SQLException - if a database error occurs while the table ispublic java.lang.String getTableFor(PredicateNode predicate)
getTableFor in interface TableManagerpredicate - The type of relationship.
null
if no such predicate exists in the graph.public PredicateNode getPredicateFor(java.lang.String table)
getPredicateFor in interface TableManagertable - The name of the table.
null if no such mapping exists.public java.util.Set<java.lang.String> getTables()
getTables in interface TableManagerpublic java.util.Set<PredicateNode> getPredicates()
getPredicates in interface TableManager
public int dropEmptyPredicateTables()
throws java.sql.SQLException
dropEmptyPredicateTables in interface TableManagerjava.sql.SQLException - if a database error occured during the operation.
public int dropAllPredicateTables()
throws java.sql.SQLException
dropAllPredicateTables in interface TableManagerjava.sql.SQLException - if a database error occured during the operation.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||