@Nullable protected View getViewFromContextOrNull(CommitContext context, Entity entity) { View view = context.getViews().get(entity); if (view == null) { return null; } return isAuthorizationRequired(context) ? attributeSecurity.createRestrictedView(view) : view; }
protected View getViewFromContext(CommitContext context, Entity entity) { View view = context.getViews().get(entity); if (view == null) { view = viewRepository.getView(entity.getClass(), View.LOCAL); } return isAuthorizationRequired(context) ? attributeSecurity.createRestrictedView(view) : view; }
View view = context.getViews().get(entity); if (view != null) cc.getViews().put(entity, view); View view = context.getViews().get(entity); if (view != null) cc.getViews().put(entity, view); for (Entity entity : result) { if (toRepeat.contains(entity)) { cc.addInstanceToCommit(entity, context.getViews().get(entity));
protected CommitContext createCommitContext(DataSupplier dataservice, Map<DataSupplier, Collection<Datasource<Entity>>> commitData) { CommitContext context = new CommitContext(); context.setDiscardCommitted(discardCommitted); for (Datasource<Entity> datasource : commitData.get(dataservice)) { if (datasource instanceof DatasourceImplementation) { DatasourceImplementation<Entity> implementation = (DatasourceImplementation) datasource; boolean listenersEnabled = implementation.enableListeners(false); try { for (Entity entity : implementation.getItemsToCreate()) { addToContext(entity, datasource, context.getCommitInstances(), context.getViews()); } for (Entity entity : implementation.getItemsToUpdate()) { addToContext(entity, datasource, context.getCommitInstances(), context.getViews()); } for (Entity entity : implementation.getItemsToDelete()) { addToContext(entity, datasource, context.getRemoveInstances(), context.getViews()); } } finally { implementation.enableListeners(listenersEnabled); } } } repairReferences(context); return context; }