@groovy.transform.CompileStatic class EntityDbMeta extends java.lang.Object
Modifiers | Name | Description |
---|---|---|
protected EntityFacadeImpl |
efi |
|
protected java.util.HashMap<java.lang.String, Timestamp> |
entityTablesChecked |
|
protected java.util.HashMap<java.lang.String, java.lang.Boolean> |
entityTablesExist |
|
protected static org.slf4j.Logger |
logger |
|
protected java.util.HashMap<java.lang.String, java.lang.Boolean> |
runtimeAddMissingMap |
Type | Name and description |
---|---|
java.util.concurrent.locks.ReentrantLock |
sqlLock |
static boolean |
useTxForMetaData |
Constructor and description |
---|
EntityDbMeta
(EntityFacadeImpl efi) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addColumn(EntityDefinition ed, FieldInfo fi, java.sql.Connection sharedCon) |
|
int |
checkAndAddAllTables(java.lang.String groupName) |
|
boolean |
checkTableRuntime(EntityDefinition ed) |
|
boolean |
checkTableStartup(EntityDefinition ed) |
|
void |
createForeignKey(EntityDefinition ed, RelationshipInfo relInfo, EntityDefinition relEd, java.sql.Connection sharedCon) |
|
int |
createForeignKeys(EntityDefinition ed, boolean checkFkExists, java.util.Set<java.lang.String> existingTableNames, java.sql.Connection sharedCon) |
|
int |
createForeignKeysForExistingTables() Loop through all known entities and for each that has an existing table check each foreign key to see if it exists in the database, and if it doesn't but the related table does exist then add the foreign key. |
|
int |
createIndexes(EntityDefinition ed, boolean checkIdxExists, java.sql.Connection sharedCon) |
|
int |
createIndexesForExistingTables() |
|
void |
createTable(EntityDefinition ed, java.sql.Connection sharedCon) |
|
int |
dropAllForeignKeys() |
|
int |
dropForeignKeys(EntityDefinition ed) |
|
void |
forceCheckExistingTables() |
|
void |
forceCheckTableRuntime(EntityDefinition ed) |
|
java.lang.Boolean |
foreignKeyExists(EntityDefinition ed, RelationshipInfo relInfo) |
|
java.lang.String |
getForeignKeyName(EntityDefinition ed, RelationshipInfo relInfo) |
|
java.util.ArrayList<FieldInfo> |
getMissingColumns(EntityDefinition ed) |
|
java.lang.Boolean |
indexExists(EntityDefinition ed, java.lang.String indexName, java.util.Collection<java.lang.String> indexFields) |
|
boolean |
internalCheckTable(EntityDefinition ed, boolean startup) |
|
MNode |
liquibaseDiffChangelog(java.lang.String filterRegexp) |
|
MNode |
liquibaseInitChangelog(java.lang.String filterRegexp) Generate a Liquibase Changelog for a set of entity definitions |
|
static java.lang.String |
makeFkConstraintName(EntityDefinition ed, RelationshipInfo relInfo, int constraintNameClipLength) |
|
static java.lang.String |
makeFkIndexName(EntityDefinition ed, RelationshipInfo relInfo, int constraintNameClipLength) |
|
java.lang.Integer |
runSqlUpdate(java.lang.CharSequence sql, java.lang.String groupName, java.sql.Connection sharedCon) |
|
static boolean |
shouldCreateFks(ExecutionContextFactoryImpl ecfi) |
|
static void |
shrinkName(java.lang.StringBuilder name, int maxLength) |
|
boolean |
tableExists(EntityDefinition ed) |
|
boolean |
tableExistsInternal(EntityDefinition ed) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Loop through all known entities and for each that has an existing table check each foreign key to see if it exists in the database, and if it doesn't but the related table does exist then add the foreign key.
Generate a Liquibase Changelog for a set of entity definitions
Groovy Documentation