Interface EntityManagerHandler
-
- All Superinterfaces:
BaseEntityManagerHandler
public interface EntityManagerHandler extends BaseEntityManagerHandler
Handler forEntityManagerandEntityManagerFactoryaccess
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcheckAccess(IEntity entity)IfisAccessible(IEntity)would return false, throw aPermissionDeniedException<E extends IInternalNamedEntity>
Efind(Class<E> entityClass, String internalName)Finds the given entity by internal name in the current network.
If the entity was not found and entityClass is aINamedEntitythen it try to find by name.<E extends IInternalNamedEntity>
Efind(Class<E> entityClass, String internalName, SimpleEntity ownerEntity)Finds the given entity by internal name in the current network filtering by the specified owner entity.
If the entity was not found and entityClass is aINamedEntitythen it try to find by name.StringgetQualifiedInternalName(IInternalNamedEntity entity)Resolves the fully qualified internal name, from the topmost owner entity.booleanisAccessible(IEntity entity)Checks whether the given entity is accessible, that means, the logged user can either directly or indirectly view this entity.-
Methods inherited from interface org.cyclos.impl.utils.persistence.BaseEntityManagerHandler
clear, delete, detach, find, flush, from, fromCacheable, persist, persist, refresh, remove, remove, selectFrom, selectFromCacheable, subQuery, update
-
-
-
-
Method Detail
-
checkAccess
void checkAccess(IEntity entity) throws PermissionDeniedException
IfisAccessible(IEntity)would return false, throw aPermissionDeniedException- Throws:
PermissionDeniedException
-
find
<E extends IInternalNamedEntity> E find(Class<E> entityClass, String internalName) throws EntityNotFoundException
Finds the given entity by internal name in the current network.
If the entity was not found and entityClass is aINamedEntitythen it try to find by name. Supports nesting of internal names, like finding a transfer type by account_type/transfer_type.- Throws:
EntityNotFoundException
-
find
<E extends IInternalNamedEntity> E find(Class<E> entityClass, String internalName, SimpleEntity ownerEntity) throws EntityNotFoundException
Finds the given entity by internal name in the current network filtering by the specified owner entity.
If the entity was not found and entityClass is aINamedEntitythen it try to find by name. Supports nesting of internal names, like finding a transfer type by account_type/transfer_type.- Parameters:
ownerEntity- the entity used as a filter- Throws:
EntityNotFoundException
-
getQualifiedInternalName
String getQualifiedInternalName(IInternalNamedEntity entity)
Resolves the fully qualified internal name, from the topmost owner entity. For example, for a transfer type, would return account_type/transfer_type. If any of the levels has a null internal name, returns null.
-
isAccessible
boolean isAccessible(IEntity entity)
Checks whether the given entity is accessible, that means, the logged user can either directly or indirectly view this entity. For example, a regular user cannot view all group details, but he can work with his own group.
-
-