Modifier and Type | Field and Description |
---|---|
protected AttributeSecuritySupport |
attributeSecurity |
protected DynamicAttributesManagerAPI |
dynamicAttributesManagerAPI |
protected EntityChangedEventManager |
entityChangedEventManager |
protected EntityFetcher |
entityFetcher |
protected EntityStates |
entityStates |
protected Metadata |
metadata |
protected MetadataTools |
metadataTools |
static java.lang.String |
NAME |
protected Persistence |
persistence |
protected QueryResultsManagerAPI |
queryResultsManager |
protected QueryTransformerFactory |
queryTransformerFactory |
protected PersistenceSecurity |
security |
protected ServerConfig |
serverConfig |
protected java.lang.String |
storeName |
protected UserSessionSource |
userSessionSource |
protected ViewRepository |
viewRepository |
Constructor and Description |
---|
RdbmsStore(java.lang.String storeName) |
Modifier and Type | Method and Description |
---|---|
protected <E extends Entity> |
checkAndReorderLoadedEntities(java.util.List<?> ids,
java.util.List<E> entities,
MetaClass metaClass) |
protected void |
checkOperationPermitted(Entity entity,
ConstraintOperationType operationType) |
protected void |
checkPermission(MetaClass metaClass,
EntityOp operation) |
protected void |
checkPermission(java.util.Set<MetaClass> cache,
MetaClass metaClass,
EntityOp operation) |
protected void |
checkPermissions(CommitContext context) |
protected boolean |
checkValueQueryPermissions(QueryParser queryParser) |
protected java.util.Set<java.lang.Class> |
collectEntityClasses(View view,
java.util.Set<View> visited) |
protected java.util.Set<java.lang.Class> |
collectEntityClassesWithDynamicAttributes(View view) |
java.util.Set<Entity> |
commit(CommitContext context)
Commits a collection of new or detached entity instances to the storage.
|
protected Query |
createQuery(EntityManager em,
LoadContext<?> context,
boolean singleResult,
boolean countQuery) |
protected View |
createRestrictedView(LoadContext<?> context) |
protected <E extends Entity> |
detachEntity(EntityManager em,
E rootEntity,
View view) |
protected boolean |
entityHasDynamicAttributes(Entity entity) |
protected boolean |
entityHasEmbeddedId(MetaClass metaClass) |
protected <E extends Entity> |
executeQuery(Query query,
boolean singleResult) |
long |
getCount(LoadContext<? extends Entity> context)
Returns the number of entity instances for the given query passed in the
LoadContext . |
protected Transaction |
getLoadTransaction(boolean useCurrentTransaction) |
protected java.util.List<java.lang.Integer> |
getNotPermittedSelectIndexes(QueryParser queryParser) |
protected <E extends Entity> |
getResultList(LoadContext<E> context,
Query query,
boolean ensureDistinct) |
protected <E extends Entity> |
getResultListIteratively(LoadContext<E> context,
Query query,
java.util.Collection<E> filteredCollection,
int initialSize,
boolean needToFilterByInMemoryReadConstraints) |
protected Transaction |
getSaveTransaction(java.lang.String storeName,
boolean useCurrentTransaction) |
protected View |
getViewFromContext(CommitContext context,
Entity entity) |
protected View |
getViewFromContextOrNull(CommitContext context,
Entity entity) |
protected boolean |
isAuthorizationRequired(CommitContext context) |
protected boolean |
isAuthorizationRequired(LoadContext context) |
protected boolean |
isAuthorizationRequired(ValueLoadContext context) |
protected boolean |
isEntityAttrViewPermitted(MetaPropertyPath metaPropertyPath) |
protected boolean |
isEntityOpPermitted(MetaClass metaClass,
EntityOp operation) |
<E extends Entity> |
load(LoadContext<E> context)
Loads a single entity instance.
|
<E extends Entity> |
loadList(LoadContext<E> context)
Loads collection of entity instances.
|
protected <E extends Entity> |
loadListByBatchesOfIds(LoadContext<E> context,
EntityManager em,
View view,
int batchSize) |
protected <E extends Entity> |
loadListBySingleIds(LoadContext<E> context,
EntityManager em,
View view) |
java.util.List<KeyValueEntity> |
loadValues(ValueLoadContext context)
Loads list of key-value pairs.
|
protected void |
mergeDynamicAttributes(BaseGenericIdEntity entity,
BaseGenericIdEntity saved) |
protected boolean |
needToApplyAttributeAccess(LoadContext context) |
protected boolean |
needToApplyByPredicate(LoadContext context,
java.util.function.Predicate<MetaClass> hasConstraints) |
protected boolean |
needToApplyInMemoryReadConstraints(LoadContext context) |
protected boolean |
needToFilterByInMemoryReadConstraints(LoadContext context) |
protected void |
updateReferences(java.util.Collection<Entity> persisted,
java.util.Collection<Entity> committed)
Update references from newly persisted entities to merged detached entities.
|
protected void |
updateReferences(Entity entity,
Entity refEntity,
java.util.Set<Entity> visited) |
public static final java.lang.String NAME
@Inject protected Metadata metadata
@Inject protected MetadataTools metadataTools
@Inject protected ViewRepository viewRepository
@Inject protected ServerConfig serverConfig
@Inject protected PersistenceSecurity security
@Inject protected AttributeSecuritySupport attributeSecurity
@Inject protected Persistence persistence
@Inject protected UserSessionSource userSessionSource
@Inject protected QueryResultsManagerAPI queryResultsManager
@Inject protected DynamicAttributesManagerAPI dynamicAttributesManagerAPI
@Inject protected QueryTransformerFactory queryTransformerFactory
@Inject protected EntityFetcher entityFetcher
@Inject protected EntityStates entityStates
@Inject protected EntityChangedEventManager entityChangedEventManager
protected java.lang.String storeName
@Nullable public <E extends Entity> E load(LoadContext<E> context)
DataStore
public <E extends Entity> java.util.List<E> loadList(LoadContext<E> context)
DataStore
protected boolean entityHasEmbeddedId(MetaClass metaClass)
protected <E extends Entity> java.util.List<E> loadListBySingleIds(LoadContext<E> context, EntityManager em, View view)
protected <E extends Entity> java.util.List<E> checkAndReorderLoadedEntities(java.util.List<?> ids, java.util.List<E> entities, MetaClass metaClass)
protected <E extends Entity> java.util.List<E> loadListByBatchesOfIds(LoadContext<E> context, EntityManager em, View view, int batchSize)
public long getCount(LoadContext<? extends Entity> context)
DataStore
LoadContext
.public java.util.Set<Entity> commit(CommitContext context)
DataStore
public java.util.List<KeyValueEntity> loadValues(ValueLoadContext context)
DataStore
loadValues
in interface DataStore
context
- defines a query for scalar values and a list of keys for returned KeyValueEntityprotected View getViewFromContext(CommitContext context, Entity entity)
@Nullable protected View getViewFromContextOrNull(CommitContext context, Entity entity)
protected void checkOperationPermitted(Entity entity, ConstraintOperationType operationType)
protected boolean entityHasDynamicAttributes(Entity entity)
protected Query createQuery(EntityManager em, LoadContext<?> context, boolean singleResult, boolean countQuery)
protected View createRestrictedView(LoadContext<?> context)
protected <E extends Entity> java.util.List<E> getResultList(LoadContext<E> context, Query query, boolean ensureDistinct)
protected <E extends Entity> java.util.List<E> getResultListIteratively(LoadContext<E> context, Query query, java.util.Collection<E> filteredCollection, int initialSize, boolean needToFilterByInMemoryReadConstraints)
protected <E extends Entity> java.util.List<E> executeQuery(Query query, boolean singleResult)
protected void checkPermissions(CommitContext context)
protected void checkPermission(java.util.Set<MetaClass> cache, MetaClass metaClass, EntityOp operation)
protected boolean checkValueQueryPermissions(QueryParser queryParser)
protected boolean isEntityAttrViewPermitted(MetaPropertyPath metaPropertyPath)
protected boolean isAuthorizationRequired(LoadContext context)
protected boolean isAuthorizationRequired(ValueLoadContext context)
protected boolean isAuthorizationRequired(CommitContext context)
protected java.util.List<java.lang.Integer> getNotPermittedSelectIndexes(QueryParser queryParser)
protected void updateReferences(java.util.Collection<Entity> persisted, java.util.Collection<Entity> committed)
persisted
- persisted entitiescommitted
- all committed entitiesprotected void updateReferences(Entity entity, Entity refEntity, java.util.Set<Entity> visited)
protected boolean needToFilterByInMemoryReadConstraints(LoadContext context)
protected boolean needToApplyInMemoryReadConstraints(LoadContext context)
protected boolean needToApplyAttributeAccess(LoadContext context)
protected boolean needToApplyByPredicate(LoadContext context, java.util.function.Predicate<MetaClass> hasConstraints)
protected java.util.Set<java.lang.Class> collectEntityClassesWithDynamicAttributes(@Nullable View view)
protected java.util.Set<java.lang.Class> collectEntityClasses(View view, java.util.Set<View> visited)
protected Transaction getLoadTransaction(boolean useCurrentTransaction)
protected Transaction getSaveTransaction(java.lang.String storeName, boolean useCurrentTransaction)
protected <E extends Entity> void detachEntity(EntityManager em, @Nullable E rootEntity, View view)
protected void mergeDynamicAttributes(BaseGenericIdEntity entity, BaseGenericIdEntity saved)