it.eng.spagobi.bo.dao.hibernate
Class LowFunctionalityDAOHibImpl

java.lang.Object
  extended by it.eng.spagobi.bo.dao.hibernate.AbstractHibernateDAO
      extended by it.eng.spagobi.bo.dao.hibernate.LowFunctionalityDAOHibImpl
All Implemented Interfaces:
ILowFunctionalityDAO

public class LowFunctionalityDAOHibImpl
extends AbstractHibernateDAO
implements ILowFunctionalityDAO

Defines the Hibernate implementations for all DAO methods, for a functionality.

Author:
sulis

Constructor Summary
LowFunctionalityDAOHibImpl()
           
 
Method Summary
 void deleteInconsistentRoles(java.util.Set rolesSet)
          Deletes a set of inconsistent roles reference from the database, in order to keep functionalities tree permissions consistence.
 void eraseLowFunctionality(LowFunctionality aLowFunctionality, it.eng.spago.security.IEngUserProfile profile)
          Implements the query to erase a low functionality.
 java.lang.Integer existByCode(java.lang.String code)
          Control if exist a functionality with the given code
 boolean hasChild(java.lang.Integer id)
          Control if the functionality with the given id has childs
 void insertLowFunctionality(LowFunctionality aLowFunctionality, it.eng.spago.security.IEngUserProfile profile)
          Implements the query to insert a low functionality.
 java.util.List loadAllLowFunctionalities(boolean recoverBIObjects)
          Loads all the functionalities
 java.util.List loadChildFunctionalities(java.lang.Integer parentId, boolean recoverBIObjects)
          Loads all the child functionalities of the given parent functionality
 LowFunctionality loadLowFunctionalityByID(java.lang.Integer functionalityID, boolean recoverBIObjects)
          Loads all information for a low functionality identified by its functionalityID.
 LowFunctionality loadLowFunctionalityByPath(java.lang.String functionalityPath, boolean recoverBIObjects)
          Loads all information for a low functionality identified by its functionalityPath.
 java.util.List loadSubLowFunctionalities(java.lang.String initialPath, boolean recoverBIObjects)
          Loads all the sub functionalities of the given initial path
 void modifyLowFunctionality(LowFunctionality aLowFunctionality)
          Implements the query to modify a low functionality.
private  java.util.Set saveRolesFunctionality(org.hibernate.Session aSession, SbiFunctions hibFunct, LowFunctionality aLowFunctionality, java.lang.String state)
          Saves all roles for a functionality, using session and state information.
 LowFunctionality toLowFunctionality(SbiFunctions hibFunct, boolean recoverBIObjects)
          From the Hibernate Low Functionality object at input, gives the corrispondent LowFunctionality object.
 
Methods inherited from class it.eng.spagobi.bo.dao.hibernate.AbstractHibernateDAO
getSession, logException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LowFunctionalityDAOHibImpl

public LowFunctionalityDAOHibImpl()
Method Detail

loadLowFunctionalityByID

public LowFunctionality loadLowFunctionalityByID(java.lang.Integer functionalityID,
                                                 boolean recoverBIObjects)
                                          throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all information for a low functionality identified by its functionalityID. All these information, are stored into a LowFunctionality object, which is returned.

Specified by:
loadLowFunctionalityByID in interface ILowFunctionalityDAO
Parameters:
functionalityID - The id for the low functionality to load
recoverBIObjects - If true the LowFunctionality at output will have the list of contained BIObject objects
Returns:
A LowFunctionality object containing all loaded information
Throws:
EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.bo.dao.ILowFunctionalityDAO#loadLowFunctionalityByID(java.lang.Integer)

loadLowFunctionalityByPath

public LowFunctionality loadLowFunctionalityByPath(java.lang.String functionalityPath,
                                                   boolean recoverBIObjects)
                                            throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all information for a low functionality identified by its functionalityPath. All these information, are stored into a LowFunctionality object, which is returned.

Specified by:
loadLowFunctionalityByPath in interface ILowFunctionalityDAO
Parameters:
functionalityPath - The path for the low functionality to load
recoverBIObjects - If true the LowFunctionality at output will have the list of contained BIObject objects
Returns:
A LowFunctionality object containing all loaded information
Throws:
EMFUserError - If an Exception occurred
See Also:
it.eng.spagobi.bo.dao.ILowFunctionalityDAO#loadLowFunctionalityByPath(java.lang.String)

modifyLowFunctionality

public void modifyLowFunctionality(LowFunctionality aLowFunctionality)
                            throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Implements the query to modify a low functionality. All information needed is stored into the input LowFunctionality object.

Specified by:
modifyLowFunctionality in interface ILowFunctionalityDAO
Parameters:
aLowFunctionality - The object containing all modify information
Throws:
EMFUserError - If an Exception occurred
See Also:
ILowFunctionalityDAO.modifyLowFunctionality(it.eng.spagobi.bo.LowFunctionality)

saveRolesFunctionality

private java.util.Set saveRolesFunctionality(org.hibernate.Session aSession,
                                             SbiFunctions hibFunct,
                                             LowFunctionality aLowFunctionality,
                                             java.lang.String state)
                                      throws EMFUserError
Saves all roles for a functionality, using session and state information. The state for a functionality can be Developing, Testing and execution and each state has its own roles.

Parameters:
aSession - The current session object
hibFunct - The functionality hibernate object
aLowFunctionality - The Low Functionality object
state - The string defining the state
Returns:
A collection object containing all roles
Throws:
EMFUserError

insertLowFunctionality

public void insertLowFunctionality(LowFunctionality aLowFunctionality,
                                   it.eng.spago.security.IEngUserProfile profile)
                            throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Implements the query to insert a low functionality. All information needed is stored into the input LowFunctionality object.

Specified by:
insertLowFunctionality in interface ILowFunctionalityDAO
Parameters:
aLowFunctionality - The object containing all insert information
Throws:
EMFUserError - If an Exception occurred
See Also:
ILowFunctionalityDAO.insertLowFunctionality(it.eng.spagobi.bo.LowFunctionality, it.eng.spago.security.IEngUserProfile)

eraseLowFunctionality

public void eraseLowFunctionality(LowFunctionality aLowFunctionality,
                                  it.eng.spago.security.IEngUserProfile profile)
                           throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Implements the query to erase a low functionality. All information needed is stored into the input LowFunctionality object.

Specified by:
eraseLowFunctionality in interface ILowFunctionalityDAO
Parameters:
aLowFunctionality - The object containing all erase information
Throws:
EMFUserError - If an Exception occurred
See Also:
ILowFunctionalityDAO.eraseLowFunctionality(it.eng.spagobi.bo.LowFunctionality, it.eng.spago.security.IEngUserProfile)

toLowFunctionality

public LowFunctionality toLowFunctionality(SbiFunctions hibFunct,
                                           boolean recoverBIObjects)
From the Hibernate Low Functionality object at input, gives the corrispondent LowFunctionality object.

Parameters:
hibFunct - The Hibernate Low Functionality object
recoverBIObjects - If true the LowFunctionality at output will have the list of contained BIObject objects
Returns:
the corrispondent output LowFunctionality

existByCode

public java.lang.Integer existByCode(java.lang.String code)
                              throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Control if exist a functionality with the given code

Specified by:
existByCode in interface ILowFunctionalityDAO
Parameters:
code - The code of the functionality
Returns:
The functionality ID
Throws:
EMFUserError
See Also:
ILowFunctionalityDAO.existByCode(java.lang.String)

loadAllLowFunctionalities

public java.util.List loadAllLowFunctionalities(boolean recoverBIObjects)
                                         throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all the functionalities

Specified by:
loadAllLowFunctionalities in interface ILowFunctionalityDAO
Parameters:
recoverBIObjects - If true each LowFunctionality at output will have the list of contained BIObject objects
Returns:
the list of functionalities
Throws:
EMFUserError
See Also:
ILowFunctionalityDAO.loadAllLowFunctionalities(boolean)

loadSubLowFunctionalities

public java.util.List loadSubLowFunctionalities(java.lang.String initialPath,
                                                boolean recoverBIObjects)
                                         throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all the sub functionalities of the given initial path

Specified by:
loadSubLowFunctionalities in interface ILowFunctionalityDAO
Parameters:
initialPath - The String representing the initial path
recoverBIObjects - If true each LowFunctionality at output will have the list of contained BIObject objects
Returns:
the list of functionalities
Throws:
EMFUserError
See Also:
ILowFunctionalityDAO.loadSubLowFunctionalities(java.lang.String, boolean)

hasChild

public boolean hasChild(java.lang.Integer id)
                 throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Control if the functionality with the given id has childs

Specified by:
hasChild in interface ILowFunctionalityDAO
Parameters:
id - Integer id of the functionality
Throws:
EMFUserError
See Also:
it.eng.spagobi.bo.dao.ILowFunctionalityDAO#hasChild(java.lang.String)

deleteInconsistentRoles

public void deleteInconsistentRoles(java.util.Set rolesSet)
                             throws EMFUserError
Deletes a set of inconsistent roles reference from the database, in order to keep functionalities tree permissions consistence.

Specified by:
deleteInconsistentRoles in interface ILowFunctionalityDAO
Parameters:
rolesSet - the set containing the roles to erase
Throws:
EMFUserError

loadChildFunctionalities

public java.util.List loadChildFunctionalities(java.lang.Integer parentId,
                                               boolean recoverBIObjects)
                                        throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all the child functionalities of the given parent functionality

Specified by:
loadChildFunctionalities in interface ILowFunctionalityDAO
Parameters:
parentId - The Integer representing the parent id
recoverBIObjects - If true each LowFunctionality at output will have the list of contained BIObject objects
Returns:
the list of functionalities
Throws:
EMFUserError