public class OwnedEntityRepositoryDecorator extends AbstractRepositoryDecorator<Entity>
Ensures that when an Entity is created the owner is set to the current user, users can only view, update, delete their own entities.
Admins are not effected.
| Constructor and Description |
|---|
OwnedEntityRepositoryDecorator(Repository<Entity> delegateRepository) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Entity entity) |
Integer |
add(Stream<Entity> entities) |
AggregateResult |
aggregate(AggregateQuery aggregateQuery) |
long |
count() |
long |
count(Query<Entity> q) |
void |
delete(Entity entity) |
void |
delete(Stream<Entity> entities) |
void |
deleteAll() |
void |
deleteAll(Stream<Object> ids) |
void |
deleteById(Object id) |
Stream<Entity> |
findAll(Query<Entity> q) |
Stream<Entity> |
findAll(Stream<Object> ids) |
Stream<Entity> |
findAll(Stream<Object> ids,
Fetch fetch) |
Entity |
findOne(Query<Entity> q) |
Entity |
findOneById(Object id) |
Entity |
findOneById(Object id,
Fetch fetch) |
void |
forEachBatched(Fetch fetch,
Consumer<List<Entity>> consumer,
int batchSize) |
Iterator<Entity> |
iterator() |
Query<Entity> |
query() |
void |
update(Entity entity) |
void |
update(Stream<Entity> entities) |
close, delegate, getCapabilities, getEntityType, getName, getQueryOperatorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEachBatched, getExistingIDs, upsertBatchforEach, spliteratorpublic OwnedEntityRepositoryDecorator(Repository<Entity> delegateRepository)
public Query<Entity> query()
query in interface Repository<Entity>query in class AbstractRepositoryDecorator<Entity>public void forEachBatched(Fetch fetch, Consumer<List<Entity>> consumer, int batchSize)
forEachBatched in interface Repository<Entity>forEachBatched in class AbstractRepositoryDecorator<Entity>public long count()
count in interface Repository<Entity>count in class AbstractRepositoryDecorator<Entity>public long count(Query<Entity> q)
count in interface Repository<Entity>count in class AbstractRepositoryDecorator<Entity>public Stream<Entity> findAll(Query<Entity> q)
findAll in interface Repository<Entity>findAll in class AbstractRepositoryDecorator<Entity>public Entity findOne(Query<Entity> q)
findOne in interface Repository<Entity>findOne in class AbstractRepositoryDecorator<Entity>public Entity findOneById(Object id)
findOneById in interface Repository<Entity>findOneById in class AbstractRepositoryDecorator<Entity>public Entity findOneById(Object id, Fetch fetch)
findOneById in interface Repository<Entity>findOneById in class AbstractRepositoryDecorator<Entity>public Stream<Entity> findAll(Stream<Object> ids)
findAll in interface Repository<Entity>findAll in class AbstractRepositoryDecorator<Entity>public Stream<Entity> findAll(Stream<Object> ids, Fetch fetch)
findAll in interface Repository<Entity>findAll in class AbstractRepositoryDecorator<Entity>public AggregateResult aggregate(AggregateQuery aggregateQuery)
aggregate in interface Repository<Entity>aggregate in class AbstractRepositoryDecorator<Entity>public void update(Entity entity)
update in interface Repository<Entity>update in class AbstractRepositoryDecorator<Entity>public void update(Stream<Entity> entities)
update in interface Repository<Entity>update in class AbstractRepositoryDecorator<Entity>public void delete(Entity entity)
delete in interface Repository<Entity>delete in class AbstractRepositoryDecorator<Entity>public void delete(Stream<Entity> entities)
delete in interface Repository<Entity>delete in class AbstractRepositoryDecorator<Entity>public void deleteById(Object id)
deleteById in interface Repository<Entity>deleteById in class AbstractRepositoryDecorator<Entity>public void deleteAll(Stream<Object> ids)
deleteAll in interface Repository<Entity>deleteAll in class AbstractRepositoryDecorator<Entity>public void deleteAll()
deleteAll in interface Repository<Entity>deleteAll in class AbstractRepositoryDecorator<Entity>public void add(Entity entity)
add in interface Repository<Entity>add in class AbstractRepositoryDecorator<Entity>public Integer add(Stream<Entity> entities)
add in interface Repository<Entity>add in class AbstractRepositoryDecorator<Entity>Copyright © 2017. All rights reserved.