public class SqlSchemaBuilder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SqlSchemaBuilder.ForeignKeyBuilder |
(package private) static class |
SqlSchemaBuilder.ParsedSchema |
Constructor and Description |
---|
SqlSchemaBuilder(SqlDataManager dm,
java.lang.String schemaName)
Generates the schemas from the database meta data
|
SqlSchemaBuilder(SqlDataManager dm,
java.lang.String schemaName,
boolean rebuild)
Generates the schemas from the database meta data
|
Modifier and Type | Method and Description |
---|---|
static void |
cleanupStoredSchemas()
Cleans up the current schema entries, removing expired schemas.
|
static void |
clearParsedSchemas()
Clears all the currently known schemas for all databases
|
static boolean |
hasParsedSchema(java.lang.String url,
java.lang.String parsedSchemaName)
Returns whether or not there is a currently known parsed schema for the specified url
|
void |
parseForeignKeys(RelationalSchema relationalSchema,
DatabaseSchema schemas,
java.sql.DatabaseMetaData meta)
Parses the foreign keys for the given schema from the database.
|
DatabaseSchema |
parseSchemasFromDb()
returns constructs and returns the Schemas for the database
|
DatabaseSchema |
parseSchemasFromDb(java.util.List<java.lang.String> tables)
returns constructs and returns the Schemas for the database for the specified tables.
|
public SqlSchemaBuilder(@NotNull SqlDataManager dm, @Nullable java.lang.String schemaName)
dm
- The data managerschemaName
- The name of the schema to parse for (or to parse all)public SqlSchemaBuilder(@NotNull SqlDataManager dm, @Nullable java.lang.String schemaName, boolean rebuild)
dm
- The data managerschemaName
- The name of the schema to parse for (or to parse all)rebuild
- True if the schema should be rebuilt if it was already knownpublic static void cleanupStoredSchemas()
public static boolean hasParsedSchema(@NotNull java.lang.String url, @Nullable java.lang.String parsedSchemaName)
url
- The url for connecting to the databaseparsedSchemaName
- The parsed schema name if one was specified (for PostegreSQL mainly)public static void clearParsedSchemas()
@Nullable public DatabaseSchema parseSchemasFromDb()
@Nullable public DatabaseSchema parseSchemasFromDb(@NotNull java.util.List<java.lang.String> tables)
tables
- The tables for which to parse a schemapublic void parseForeignKeys(@NotNull RelationalSchema relationalSchema, @NotNull DatabaseSchema schemas, @NotNull java.sql.DatabaseMetaData meta) throws java.sql.SQLException
relationalSchema
- The schema for which to parse foreign keysschemas
- The schemas in the databasemeta
- The database meta datajava.sql.SQLException
- On error reading the data