class HibernateMenuDAO extends HibernatePersistentObjectDAO<Menu> implements MenuDAO {

	@Override
	public void restore(long menuId, boolean parents) throws PersistenceException {
		bulkUpdate("set ld_deleted=0 where ld_id=" + menuId, null);

		// Restore parents
		if (parents) {
			String query = "select ld_parentid from ld_menu where ld_id =" + menuId;

			try {
				List<Long> menus = (List<Long>) super.queryForList(query, Long.class);
				for (Long id : menus) {
					if (id.longValue() != menuId)
						restore(id, parents);
				}
			} catch (PersistenceException e) {
				log.error(e.getMessage(), e);
			}
		}
	}

	protected  HibernateMenuDAO();

}