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