Package de.terrestris.shoguncore.service
Class TreeNodeService<E extends TreeNode,D extends TreeNodeDao<E>>
- java.lang.Object
-
- de.terrestris.shoguncore.service.AbstractDaoService<E,D>
-
- de.terrestris.shoguncore.service.AbstractCrudService<E,D>
-
- de.terrestris.shoguncore.service.PermissionAwareCrudService<E,D>
-
- de.terrestris.shoguncore.service.TreeNodeService<E,D>
-
@Service("treeNodeService") public class TreeNodeService<E extends TreeNode,D extends TreeNodeDao<E>> extends PermissionAwareCrudService<E,D>Service class for theTreeNodemodel.- Author:
- Nils Bühner
- See Also:
AbstractCrudService
-
-
Field Summary
-
Fields inherited from class de.terrestris.shoguncore.service.PermissionAwareCrudService
permissionCollectionService
-
Fields inherited from class de.terrestris.shoguncore.service.AbstractDaoService
dao, logger
-
-
Constructor Summary
Constructors Modifier Constructor Description TreeNodeService()Default constructor, which calls the type-constructorprotectedTreeNodeService(Class<E> entityClass)Constructor that sets the concrete entity class for the service.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EcloneAndPersistTreeNode(E node)This unproxies and eagerly fetches the whole node/tree and detaches it from the hibernate session before persisting a new "clone" instance in the database.voidsetDao(D dao)We have to useQualifierto define the correct dao here.-
Methods inherited from class de.terrestris.shoguncore.service.PermissionAwareCrudService
addAndSaveGroupPermissions, addAndSaveUserPermissions, findAllUserGroupPermissionsOfUserGroup, findAllUserPermissionsOfUser, getPermissionCollectionService, removeAndSaveGroupPermissions, removeAndSaveUserPermissions, setPermissionCollectionService
-
Methods inherited from class de.terrestris.shoguncore.service.AbstractCrudService
delete, findAll, findAllRestricted, findAllWhereFieldEquals, findAllWithCollectionContaining, findById, findBySimpleFilter, loadById, saveOrUpdate, updatePartialWithJsonNode
-
Methods inherited from class de.terrestris.shoguncore.service.AbstractDaoService
getDao, getEntityClass
-
-
-
-
Method Detail
-
cloneAndPersistTreeNode
public E cloneAndPersistTreeNode(E node) throws Exception
This unproxies and eagerly fetches the whole node/tree and detaches it from the hibernate session before persisting a new "clone" instance in the database. In case of a TreeFolder, each child node will also be re-persisted (as a new database entry).- Parameters:
node-- Returns:
- Throws:
IllegalAccessExceptionNoSuchFieldExceptionException
-
setDao
@Autowired @Qualifier("treeNodeDao") public void setDao(D dao)We have to useQualifierto define the correct dao here. Otherwise, spring can not decide which dao has to be autowired here as there are multiple candidates.- Overrides:
setDaoin classPermissionAwareCrudService<E extends TreeNode,D extends TreeNodeDao<E>>- Parameters:
dao- the dao to set
-
-