Package org.aksw.commons.util.jdbc
Class Schema
java.lang.Object
org.aksw.commons.util.jdbc.Schema
- Author:
- Claus Stadler Date: 11/9/12 Time: 4:36 PM
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Schemacreate(Connection conn) static Schemacreate(Connection conn, String schema, Iterable<String> tableNames) static Schemacreate(DatabaseMetaData meta, String catalog) static Schemastatic SchemacreateSchema(DataSource dataSource) com.google.common.collect.Multimap<String,ForeignKey>
-
Constructor Details
-
Schema
public Schema(Map<String, Relation> relations, Map<String, PrimaryKey> primaryKeys, com.google.common.collect.Multimap<String, ForeignKey> foreignKeys, com.google.common.collect.Multimap<String, Index> indexes)
-
-
Method Details
-
getRelations
- Returns:
- A Map from relation names to relation objects
-
getPrimaryKeys
- Returns:
- A Map from relation names to their primary key. No entry for relations without a primary key.
-
getForeignKeys
- Returns:
- A Multimap from relation names to their sets of foreign keys. Empty set if there are none.
-
getIndexes
-
create
- Throws:
SQLException
-
create
public static Schema create(Connection conn, String schema, Iterable<String> tableNames) throws SQLException - Throws:
SQLException
-
create
public static Schema create(DatabaseMetaData meta, String catalog, String schema, Iterable<String> tableNames) throws SQLException - Throws:
SQLException
-
create
- Throws:
SQLException
-
createSchema
- Throws:
SQLException
-