public class HibernateMenuDAO extends HibernatePersistentObjectDAO<Menu> implements MenuDAO
MenuDAOentityClass, log, sessionFactory| Modifier | Constructor and Description |
|---|---|
protected |
HibernateMenuDAO() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
applyRithtToTree(long id)
Propagates the security policies of a node to the whole subree
|
String |
computePathExtended(long menuId)
Dynamically computes the path extended for the specified menu.
|
boolean |
delete(long menuId)
This method deletes an entity.
|
void |
deleteAll(List<Menu> menus)
For each menu, save the folder delete history entry for each folder and
delete the folder
|
List<Menu> |
findByGroupId(long groupId)
Finds all menus accessible by the passed group
|
List<Menu> |
findByParentId(long parentId)
Finds all children(direct and indirect) by parentId
|
List<Menu> |
findByText(Menu parent,
String text,
boolean caseSensitive)
Finds all menus by menu text, contained in the parent menu
|
List<Menu> |
findByText(String text)
Finds all menus by menu text.
|
List<Menu> |
findByTextAndParentId(String text,
long parentId)
Finds that folder that lies under a specific parent (given by the id) an
with a given text(like operator is used)
|
List<Menu> |
findByUserId(long userId)
Finds authorized menus for a user.
|
List<Menu> |
findByUserId(long userId,
long parentId)
Finds direct children of a menu.
|
List<Menu> |
findByUserId(long userId,
long parentId,
Integer type) |
List<Menu> |
findChildren(long parentId,
Integer max)
Finds direct children of a menu.
|
List<Menu> |
findChildren(long parentId,
long userId)
Finds direct children of a menu accessible by the given user.
|
List<Long> |
findIdByUserId(long userId,
long parentId)
This method selects only the menuId from the menus for which a user is
authorized.
|
List<Long> |
findIdByUserId(long userId,
long parentId,
Integer type) |
List<Long> |
findMenuIdByUserId(long userId)
This method selects only the menuId from the menus for which a user is
authorized.
|
List<Long> |
findMenuIdByUserIdAndPermission(long userId,
Permission permission)
Finds all menus ids with a specific permission enabled on the specifies
user
|
List<Menu> |
findParents(long menuId)
Returns a List of menus being a parent of the given menu.
|
String |
findTextById(long menuId)
This method selects only the menu text from a menu.
|
UserDAO |
getUserDAO() |
boolean |
hasWriteAccess(Menu menu,
long userId)
Checks that the user has access to the menu and all its sub-items
|
int |
isMenuWriteable(long menuId,
long userId)
Returns if a menu is writeable for a user
|
boolean |
isReadEnable(long menuId,
long userId) |
boolean |
isWriteEnable(long menuId,
long userId)
This method is looking up for writing rights for a menu and an user.
|
void |
restore(long menuId,
boolean parents)
Restores a previously deleted menu
|
void |
setUserDAO(UserDAO userDAO) |
boolean |
store(Menu menu)
This method persists the entity object.
|
bulkUpdate, deleteAll, evict, findAll, findAllIds, findById, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, flush, getConnection, getCurrentSession, getDbms, getSessionFactory, initialize, isHsql, isMySQL, isOracle, isSqlServer, jdbcUpdate, jdbcUpdate, merge, prepareQuery, query, queryForInt, queryForList, queryForList, queryForLong, queryForRowSet, refresh, saveOrUpdate, setSessionFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbulkUpdate, deleteAll, findAll, findAllIds, findById, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForRowSetpublic UserDAO getUserDAO()
public void setUserDAO(UserDAO userDAO)
public boolean store(Menu menu)
PersistentObjectDAOstore in interface PersistentObjectDAO<Menu>store in interface MenuDAOstore in class HibernatePersistentObjectDAO<Menu>menu - entity to be stored.public List<Menu> findByUserId(long userId)
MenuDAOfindByUserId in interface MenuDAOuserId - ID of the user.public List<Menu> findByUserId(long userId, long parentId)
MenuDAOfindByUserId in interface MenuDAOparentId - MenuId of the menu which children are wanted.public List<Menu> findChildren(long parentId, Integer max)
MenuDAOfindChildren in interface MenuDAOparentId - MenuId of the menu which children are wantedmax - Optional, maximum number of childrenpublic List<Menu> findChildren(long parentId, long userId)
MenuDAOfindChildren in interface MenuDAOparentId - MenuId of the menu which children are wanteduserId - Identifier of the user that mush have read accesspublic List<Menu> findByParentId(long parentId)
MenuDAOfindByParentId in interface MenuDAOMenuDAO.findByParentId(long)public boolean isWriteEnable(long menuId,
long userId)
MenuDAOisWriteEnable in interface MenuDAOmenuId - ID of the menu.userId - ID of the user.public boolean isReadEnable(long menuId,
long userId)
isReadEnable in interface MenuDAOpublic String findTextById(long menuId)
MenuDAOfindTextById in interface MenuDAOmenuId - Id of the menu.public List<Long> findMenuIdByUserId(long userId)
MenuDAOfindMenuIdByUserId in interface MenuDAOuserId - ID of the user.public int isMenuWriteable(long menuId,
long userId)
MenuDAOisMenuWriteable in interface MenuDAOmenuId - check this menuuserId - privileges for this should be checkedMenuDAO.isMenuWriteable(long, long)public boolean hasWriteAccess(Menu menu, long userId)
MenuDAOhasWriteAccess in interface MenuDAOpublic List<Menu> findByGroupId(long groupId)
MenuDAOfindByGroupId in interface MenuDAOgroupId - The group idpublic List<Menu> findByText(String text)
MenuDAOfindByText in interface MenuDAOpublic List<Menu> findByText(Menu parent, String text, boolean caseSensitive)
MenuDAOfindByText in interface MenuDAOparent - The parent menu(optional)text - The menutext to search forpublic String computePathExtended(long menuId)
MenuDAOcomputePathExtended in interface MenuDAOpublic List<Menu> findByTextAndParentId(String text, long parentId)
MenuDAOfindByTextAndParentId in interface MenuDAOpublic List<Menu> findParents(long menuId)
MenuDAOfindParents in interface MenuDAOpublic void restore(long menuId,
boolean parents)
MenuDAOpublic List<Long> findMenuIdByUserIdAndPermission(long userId, Permission permission)
MenuDAOfindMenuIdByUserIdAndPermission in interface MenuDAOuserId - The user identifierpermission - The permission to checkpublic void deleteAll(List<Menu> menus)
MenuDAOpublic boolean delete(long menuId)
PersistentObjectDAOdelete in interface PersistentObjectDAO<Menu>delete in class HibernatePersistentObjectDAO<Menu>menuId - ID of the entity which should be deleted.public boolean applyRithtToTree(long id)
MenuDAOapplyRithtToTree in interface MenuDAOpublic List<Long> findIdByUserId(long userId, long parentId)
MenuDAOfindIdByUserId in interface MenuDAOuserId - ID of the user.parentId - Parent menuCopyright © 2008-2014 Logical Objects. All Rights Reserved.