public class DatabaseMetaBuilder extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static com.google.common.cache.Cache<String,Long> |
metaCountCache |
protected String |
packageForEnumResolver |
static Pattern |
POSSIBLE_VALUES_PATTERN |
protected Consumer<SqlWork> |
worker |
| Constructor and Description |
|---|
DatabaseMetaBuilder(Connection sqlConnection) |
DatabaseMetaBuilder(Connection sqlConnection,
String packageForEnumResolver) |
DatabaseMetaBuilder(Consumer<SqlWork> worker,
String packageForEnumResolver) |
| Modifier and Type | Method and Description |
|---|---|
protected ColumnRef |
asCommentKey(String tableName,
String columnName) |
protected ColumnRef |
asProcedureKey(String procedureName,
String argTypesString) |
DatabaseMeta |
buildMeta(String schema) |
protected void |
doWork(SqlWork work) |
protected com.google.common.collect.ImmutableSet<String> |
getColumnNames(String schema,
String tableName) |
protected com.google.common.collect.ImmutableSet<String> |
getForeignKeys(com.google.common.collect.Multimap<ColumnRef,ColumnRef> foreignKeys,
ColumnRef columnRef) |
protected com.google.common.cache.Cache<String,Long> |
getMetaCountCache() |
protected com.google.common.collect.ImmutableSet<String> |
getTableNames(String schema,
String type) |
protected Function<String,Class<? extends Enum>> |
packageEnumResolver() |
protected com.google.common.collect.ImmutableList<CustomTypeMeta> |
readCustomTypes(String schema,
Function<String,Class<? extends Enum>> enumResolver) |
protected Map<String,String> |
readCustomTypesComments(String schema) |
protected com.google.common.collect.Multimap<ColumnRef,ColumnRef> |
readForeignKeys(String schema)
Dans la Multimap renvoyée, la clé est constituée d'une Pair de TABLE_NAME, COLUMN_NAME.
|
protected com.google.common.collect.ImmutableSet<ColumnRef> |
readPrimaryKeys(String schema)
Renvoie un ensemble de Pair de TABLE_NAME, COLUMN_NAME représentant les clés primaires de la base.
|
protected Map<ColumnRef,String> |
readProcedureComments(String schema)
Dans la Map renvoyée, la clé est constituée d'une Pair de PROCEDURE_NAME, ATTRIBUTE_NAME.
|
protected com.google.common.collect.ImmutableList<ProcedureMeta> |
readProcedureMetas(String schema) |
protected Map<ColumnRef,String> |
readTableAndViewComments(String schema)
Dans la Map renvoyée, la clé est constituée d'une Pair de TABLE_NAME, COLUMN_NAME.
|
protected com.google.common.collect.ImmutableList<TableMeta> |
readTableMetas(String schema,
com.google.common.collect.ImmutableList<CustomTypeMeta> customTypes) |
protected com.google.common.collect.ImmutableList<TableMeta> |
readTableMetas(String type,
String schema,
Map<ColumnRef,String> comments,
Set<ColumnRef> primaryKeys,
Set<ColumnRef> uniqueColumns,
com.google.common.collect.Multimap<ColumnRef,ColumnRef> foreignKeys,
com.google.common.collect.ImmutableList<CustomTypeMeta> customTypes) |
protected com.google.common.collect.ImmutableSet<ColumnRef> |
readUniqueColumns(String schema)
Renvoie un ensemble de Pair de TABLE_NAME, COLUMN_NAME représentant les colonnes avec une contrainte d'unicité.
|
protected com.google.common.collect.ImmutableList<TableMeta> |
readViewMetas(String schema,
com.google.common.collect.ImmutableList<CustomTypeMeta> customTypes) |
public static final Pattern POSSIBLE_VALUES_PATTERN
protected final String packageForEnumResolver
public DatabaseMetaBuilder(Consumer<SqlWork> worker, String packageForEnumResolver)
public DatabaseMetaBuilder(Connection sqlConnection, String packageForEnumResolver)
public DatabaseMetaBuilder(Connection sqlConnection)
protected void doWork(SqlWork work)
protected com.google.common.collect.ImmutableSet<String> getTableNames(String schema, String type)
protected com.google.common.collect.ImmutableSet<String> getColumnNames(String schema, String tableName)
protected com.google.common.collect.ImmutableList<TableMeta> readTableMetas(String type, String schema, Map<ColumnRef,String> comments, Set<ColumnRef> primaryKeys, Set<ColumnRef> uniqueColumns, com.google.common.collect.Multimap<ColumnRef,ColumnRef> foreignKeys, com.google.common.collect.ImmutableList<CustomTypeMeta> customTypes)
protected com.google.common.collect.ImmutableSet<String> getForeignKeys(com.google.common.collect.Multimap<ColumnRef,ColumnRef> foreignKeys, ColumnRef columnRef)
protected Map<ColumnRef,String> readTableAndViewComments(String schema)
protected Map<ColumnRef,String> readProcedureComments(String schema)
protected com.google.common.collect.ImmutableList<ProcedureMeta> readProcedureMetas(String schema)
protected com.google.common.collect.Multimap<ColumnRef,ColumnRef> readForeignKeys(String schema)
protected com.google.common.collect.ImmutableSet<ColumnRef> readPrimaryKeys(String schema)
protected com.google.common.collect.ImmutableSet<ColumnRef> readUniqueColumns(String schema)
protected com.google.common.collect.ImmutableList<TableMeta> readTableMetas(String schema, com.google.common.collect.ImmutableList<CustomTypeMeta> customTypes)
protected com.google.common.collect.ImmutableList<TableMeta> readViewMetas(String schema, com.google.common.collect.ImmutableList<CustomTypeMeta> customTypes)
protected com.google.common.collect.ImmutableList<CustomTypeMeta> readCustomTypes(String schema, Function<String,Class<? extends Enum>> enumResolver)
public DatabaseMeta buildMeta(String schema)
Copyright © 2019–2021 Nuiton. All rights reserved.