@groovy.transform.CompileStatic class EntityFacadeImpl extends java.lang.Object implements EntityFacade
Modifiers | Name | Description |
---|---|---|
static class |
EntityFacadeImpl.DatasourceInfo |
|
static class |
EntityFacadeImpl.EtlLoader |
Modifiers | Name | Description |
---|---|---|
protected java.util.Locale |
databaseLocale |
|
protected java.util.HashMap<java.lang.String, MNode> |
databaseNodeByGroupName |
|
protected java.util.TimeZone |
databaseTimeZone |
|
protected java.lang.ThreadLocal<java.util.Calendar> |
databaseTzLcCalendar |
|
protected java.util.HashMap<java.lang.String, EntityDatasourceFactory> |
datasourceFactoryByGroupMap |
|
protected java.util.HashMap<java.lang.String, MNode> |
datasourceNodeByGroupName |
|
protected EntityDbMeta |
dbMeta |
|
protected ConcurrentHashMap<java.lang.String, Lock> |
dbSequenceLocks |
|
protected static long |
defaultBankSize |
|
protected java.lang.String |
defaultGroupName |
|
ExecutionContextFactoryImpl |
ecfi |
|
protected java.util.HashMap<java.lang.String, java.util.ArrayList<EntityEcaRule>> |
eecaRulesByEntityName |
|
protected EntityListImpl |
emptyList |
|
protected EntityCache |
entityCache |
|
EntityConditionFactoryImpl |
entityConditionFactory |
|
protected EntityDataDocument |
entityDataDocument |
|
protected EntityDataFeed |
entityDataFeed |
|
protected java.util.HashMap<java.lang.String, java.lang.String> |
entityGroupNameMap |
|
protected static java.util.Map<java.lang.String, java.lang.Integer> |
fieldTypeIntMap |
|
protected static java.util.Map<java.lang.String, java.lang.String> |
fieldTypeJavaMap |
|
protected static boolean |
isTraceEnabled |
|
protected static java.util.Map<java.lang.String, java.lang.Integer> |
javaIntTypeMap |
|
protected java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>> |
javaTypeByGroup |
|
protected java.util.concurrent.locks.ReentrantLock |
locationLoadLock |
|
protected static org.slf4j.Logger |
logger |
|
protected java.lang.String |
sequencedIdPrefix |
|
protected java.util.Map<java.lang.String, java.util.Map<java.lang.String, java.lang.String>> |
sqlTypeByGroup |
|
protected ThreadPoolExecutor |
statementExecutor |
|
protected BlockingQueue<java.lang.Runnable> |
statementWorkQueue |
Type | Name and description |
---|---|
static java.util.Set<java.lang.String> |
cachedCountEntities |
static java.util.Set<java.lang.String> |
cachedListEntities |
static java.util.Set<java.lang.String> |
cachedOneEntities |
Cache<java.lang.String, EntityDefinition> |
entityDefinitionCache Cache with entity name as the key and an EntityDefinition as the value; clear this cache to reload entity def |
static java.lang.String |
entityLocSingleEntryName |
Cache<java.lang.String, java.util.Map<java.lang.String, java.util.List<java.lang.String>>> |
entityLocationSingleCache Cache with single entry so can be expired/cleared, contains Map with entity name as the key and List of file location Strings as the value |
Cache<java.lang.String, long[]> |
entitySequenceBankCache Sequence name (often entity name) is the key and the value is an array of 2 Longs the first is the next available value and the second is the highest value reserved/cached in the bank. |
java.util.HashMap<java.lang.String, EntityDefinition> |
frameworkEntityDefinitions Map for framework entity definitions, avoid cache overhead and timeout issues |
static java.util.Map<java.lang.String, java.lang.String> |
operationByMethod |
boolean |
queryStats |
java.util.Map<java.lang.String, EntityJavaUtil.QueryStatsInfo> |
queryStatsInfoMap |
Constructor and description |
---|
EntityFacadeImpl
(ExecutionContextFactoryImpl ecfi) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
addValuesFromPlainMapRecursive(EntityDefinition ed, java.util.Map value, EntityList valueList, java.util.Map<java.lang.String, java.lang.Object> parentPks) |
|
void |
checkAllEntityTables(java.lang.String groupName) |
|
void |
checkInitDatasourceTables() |
|
void |
clearEntityDefinitionFromCache(java.lang.String entityName) |
|
void |
clearQueryStats() |
|
void |
createAllAutoReverseManyRelationships() |
|
protected java.lang.String |
dbSequencedIdPrimary(java.lang.String seqName, long staggerMax, long bankSize) |
|
void |
destroy() |
|
EntityValue |
fastFindOne(java.lang.String entityName, java.lang.Boolean useCache, boolean disableAuthz, java.lang.Object[] values) Simple, fast find by primary key; doesn't filter find based on authz; doesn't use TransactionCache For cached queries this is about 50% faster (6M/s vs 4M/s) for non-cached queries only about 10% faster (500K vs 450K) |
|
EntityValueBase |
fastFindOneExtended(EntityDefinition ed, java.lang.Object[] values) |
|
EntityFind |
find(java.lang.String entityName) |
|
EntityFind |
find(MNode node) |
|
protected MNode |
findDatabaseNode(java.lang.String groupName) |
|
protected MNode |
findDatasourceNode(java.lang.String groupName) |
|
java.lang.String |
formatFieldString(java.lang.String entityName, java.lang.String fieldName, java.lang.String value) For pretty-print of field values based on field type |
|
java.util.ArrayList<java.util.Map<java.lang.String, java.lang.Object>> |
getAllEntitiesInfo(java.lang.String orderByField, java.lang.String filterRegexp, boolean masterEntitiesOnly, boolean excludeViewEntities) |
|
java.util.List<ResourceReference> |
getAllEntityFileLocations() |
|
java.util.List<java.util.Map> |
getAllEntityInfo(int levels, boolean excludeViewEntities) |
|
java.util.Set<java.lang.String> |
getAllEntityNames() |
|
java.util.Set<java.lang.String> |
getAllEntityNames(java.lang.String filterRegexp) |
|
java.util.Set<java.lang.String> |
getAllEntityNamesInGroup(java.lang.String groupName) |
|
java.util.Set<java.lang.String> |
getAllEntityNamesWithMaster() |
|
java.util.ArrayList<java.util.Map<java.lang.String, java.lang.Object>> |
getAllEntityRelatedFields(java.lang.String en, java.lang.String orderByField, java.lang.String dbViewEntityName) |
|
java.util.Set<java.lang.String> |
getAllNonViewEntityNames() |
|
java.util.Calendar |
getCalendarForTzLc() |
|
java.util.List<ResourceReference> |
getComponentEntityFileLocations(java.util.List<java.lang.String> componentNameList) |
|
EntityConditionFactory |
getConditionFactory() |
|
EntityConditionFactoryImpl |
getConditionFactoryImpl() |
|
javax.sql.XAConnection |
getConfConnection(java.util.Map<java.lang.String, java.lang.String> confMap) Get a JDBC Connection based on xa-properties configuration. |
|
java.util.List<ResourceReference> |
getConfEntityFileLocations() |
|
java.sql.Connection |
getConnection(java.lang.String groupName) |
|
java.sql.Connection |
getConnection(java.lang.String groupName, boolean useClone) |
|
java.util.ArrayList<java.util.Map> |
getDataDocuments(java.lang.String dataDocumentId, EntityCondition condition, java.sql.Timestamp fromUpdateStamp, java.sql.Timestamp thruUpdatedStamp) |
|
java.util.ArrayList<java.util.Map> |
getDataFeedDocuments(java.lang.String dataFeedId, java.sql.Timestamp fromUpdateStamp, java.sql.Timestamp thruUpdatedStamp) |
|
java.util.List<java.util.Map<java.lang.String, java.lang.Object>> |
getDataSourcesInfo() |
|
java.lang.String |
getDatabaseConfName(java.lang.String entityName) |
|
java.util.Locale |
getDatabaseLocale() |
|
MNode |
getDatabaseNode(java.lang.String groupName) |
|
protected MNode |
getDatabaseNodeByConf(java.lang.String confName) |
|
java.util.TimeZone |
getDatabaseTimeZone() |
|
java.lang.String |
getDatasourceCloneName(java.lang.String groupName) |
|
EntityDatasourceFactory |
getDatasourceFactory(java.lang.String groupName) |
|
java.util.Set<java.lang.String> |
getDatasourceGroupNames() |
|
MNode |
getDatasourceNode(java.lang.String groupName) |
|
protected java.util.concurrent.locks.Lock |
getDbSequenceLock(java.lang.String seqName) |
|
java.lang.String |
getDefaultGroupName() |
|
int |
getEecaRuleCount() |
|
EntityListImpl |
getEmptyList() |
|
EntityCache |
getEntityCache() |
|
EntityDataDocument |
getEntityDataDocument() |
|
EntityDataFeed |
getEntityDataFeed() |
|
EntityDbMeta |
getEntityDbMeta() |
|
EntityDefinition |
getEntityDefinition(java.lang.String entityName) |
|
MNode |
getEntityFacadeNode() |
|
protected static MNode |
getEntityFileRoot(ResourceReference entityRr) |
|
java.lang.String |
getEntityGroupName(java.lang.String entityName) |
|
java.lang.String |
getFieldJavaType(java.lang.String fieldType, EntityDefinition ed) |
|
protected java.lang.Object |
getFieldJavaTypeFromDbNode(java.lang.String groupName, java.lang.String fieldType, EntityDefinition ed) |
|
protected java.lang.String |
getFieldSqlType(java.lang.String fieldType, EntityDefinition ed) |
|
protected java.lang.Object |
getFieldSqlTypeFromDbNode(java.lang.String groupName, java.lang.String fieldType, EntityDefinition ed) |
|
static int |
getJavaTypeInt(java.lang.String javaType) |
|
java.util.ArrayList<java.util.Map<java.lang.String, java.lang.Object>> |
getQueryStatsList(java.lang.String orderByField, java.lang.String entityFilter, java.lang.String sqlFilter) |
|
static int |
getTxIsolationFromString(java.lang.String isolationLevel) |
|
EntityList |
getValueListFromPlainMap(java.util.Map value, java.lang.String entityName) |
|
boolean |
hasEecaRules(java.lang.String entityName) |
|
protected void |
initAllDatasources() |
|
boolean |
isEntityDefined(java.lang.String entityName) This is used mostly by the service engine to quickly determine whether a noun is an entity. |
|
int |
loadAllEntityDefinitions() |
|
java.util.Map<java.lang.String, java.util.List<java.lang.String>> |
loadAllEntityLocations() |
|
void |
loadEecaRulesAll() |
|
int |
loadEecaRulesFile(ResourceReference rr, java.util.HashMap<java.lang.String, EntityEcaRule> ruleByIdMap, java.util.LinkedList<EntityEcaRule> ruleNoIdList) |
|
protected EntityDefinition |
loadEntityDefinition(java.lang.String entityName) |
|
protected void |
loadEntityFileLocations(ResourceReference entityRr, java.util.Map<java.lang.String, java.util.List<java.lang.String>> entityLocationCache) |
|
void |
loadFrameworkEntities() |
|
EntityDataLoader |
makeDataLoader() |
|
EntityDataWriter |
makeDataWriter() |
|
Loader |
makeEtlLoader() |
|
EntityValue |
makeValue(java.lang.String entityName) |
|
EntityValue |
makeValue(org.w3c.dom.Element element) |
|
void |
postFacadeInit() |
|
java.lang.Object |
rest(java.lang.String operation, java.util.List<java.lang.String> entityPath, java.util.Map parameters, boolean masterNameInPath) |
|
void |
runEecaRules(java.lang.String entityName, java.util.Map fieldValues, java.lang.String operation, boolean before) |
|
long |
runSqlCountConf(java.lang.CharSequence from, java.lang.CharSequence where, java.util.Map<java.lang.String, java.lang.String> confMap) |
|
int |
runSqlUpdateConf(java.lang.CharSequence sql, java.util.Map<java.lang.String, java.lang.String> confMap) |
|
void |
saveQueryStats(EntityDefinition ed, java.lang.String sql, long queryTime, boolean isError) |
|
java.lang.String |
sequencedIdPrimary(java.lang.String seqName, java.lang.Long staggerMax, java.lang.Long bankSize) |
|
java.lang.String |
sequencedIdPrimaryEd(EntityDefinition ed) |
|
EntityListIterator |
sqlFind(java.lang.String sql, java.util.List<java.lang.Object> sqlParameterList, java.lang.String entityName, java.util.List<java.lang.String> fieldList) |
|
void |
tempResetSequencedIdPrimary(java.lang.String seqName) |
|
void |
tempSetSequencedIdPrimary(java.lang.String seqName, long nextSeqNum, long bankSize) |
|
void |
warmCache() |
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() |
Cache with entity name as the key and an EntityDefinition as the value; clear this cache to reload entity def
Cache with single entry so can be expired/cleared, contains Map with entity name as the key and List of file location Strings as the value
Sequence name (often entity name) is the key and the value is an array of 2 Longs the first is the next available value and the second is the highest value reserved/cached in the bank.
Map for framework entity definitions, avoid cache overhead and timeout issues
Simple, fast find by primary key; doesn't filter find based on authz; doesn't use TransactionCache For cached queries this is about 50% faster (6M/s vs 4M/s) for non-cached queries only about 10% faster (500K vs 450K)
For pretty-print of field values based on field type
Get a JDBC Connection based on xa-properties configuration. The Conf Map should contain the default entity_ds properties including entity_ds_db_conf, entity_ds_host, entity_ds_port, entity_ds_database, entity_ds_user, entity_ds_password
This is used mostly by the service engine to quickly determine whether a noun is an entity. Called for all ServiceDefinition init to see if the noun is an entity name. Called by entity auto check if no path and verb is one of the entity-auto supported verbs.
Groovy Documentation