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

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

public class BIObjectDAOHibImpl
extends AbstractHibernateDAO
implements IBIObjectDAO

Defines the Hibernate implementations for all DAO methods, for a BI Object.

Author:
Zoppello

Constructor Summary
BIObjectDAOHibImpl()
           
 
Method Summary
 void eraseBIObject(BIObject obj, java.lang.Integer idFunct)
          Deletes a BIObject from a functionality.
 void gatherCMSInformation(BIObject biObject)
          Load the CMS Information of the biObject
 java.util.List getBIObjectParameters(BIObject aBIObject)
          Gets the biparameters associated with to a biobject
private  java.util.List getCorrectRoles(java.lang.Integer id, java.util.Collection roles)
          Gets a list of correct role according to the report at input, identified by its id
 java.util.List getCorrectRolesForExecution(java.lang.Integer id)
          Gets the correct roles for Report execution, given only the Report's id.
 java.util.List getCorrectRolesForExecution(java.lang.Integer id, it.eng.spago.security.IEngUserProfile profile)
          Given the id for a report and the user profile, gets the corret roles for execution.
 void insertBIObject(BIObject obj)
          Implements the query to insert a BIObject.
private  void internalModify(BIObject biObject, boolean version)
          Updates the CMS repository if the user has loaded a file template.
 java.util.List loadAllBIObjects()
          Given all parameters for the input hibernate BI object, fills the other BIObject at input with these parameters.
 java.util.List loadAllBIObjectsFromInitialPath(java.lang.String initialPath)
          Loads all the BIObjects that belong to sub functionalities of the given functionality path
 BIObject loadBIObjectById(java.lang.Integer biObjectID)
          Loads all detail information for a BI Object identified by its biObjectID identifier.
 BIObject loadBIObjectByLabel(java.lang.String label)
          Loads all detail information for a BI Object identified by its label identifier.
 BIObject loadBIObjectForDetail(java.lang.Integer id)
          Loads all detail information for a BI Object identified by its id identifier integer.
 BIObject loadBIObjectForDetail(java.lang.String path)
          Loads all detail information for a BI Object identified by its path in the cms.
 BIObject loadBIObjectForExecutionByIdAndRole(java.lang.Integer id, java.lang.String role)
          Loads all information for the execution of a BI Object identified by its id and its role.
 BIObject loadBIObjectForTree(java.lang.Integer id)
          Loads all tree information for a BI Object identified by its id identifier Integer.
 void modifyBIObject(BIObject obj)
          Implements the query to modify a BI Object.
 void modifyBIObjectWithoutVersioning(BIObject obj)
          Implements the query to modify a BI Object, but without updating versioning.
 BIObject toBIObject(SbiObjects hibBIObject)
          From the Hibernate BI object at input, gives the corrispondent BI 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

BIObjectDAOHibImpl

public BIObjectDAOHibImpl()
Method Detail

loadBIObjectForExecutionByIdAndRole

public BIObject loadBIObjectForExecutionByIdAndRole(java.lang.Integer id,
                                                    java.lang.String role)
                                             throws EMFUserError
Description copied from interface: IBIObjectDAO
Loads all information for the execution of a BI Object identified by its id and its role. All these information, achived by a query to the DB, are stored into a BIObject object, which is returned.

Specified by:
loadBIObjectForExecutionByIdAndRole in interface IBIObjectDAO
Parameters:
id - The BI object id
role - The BI object role
Returns:
The BIobject execution information, stored into a BIObject
Throws:
EMFUserError - If an Exception occurs
See Also:
IBIObjectDAO.loadBIObjectForExecutionByIdAndRole(java.lang.Integer, java.lang.String)

loadBIObjectById

public BIObject loadBIObjectById(java.lang.Integer biObjectID)
                          throws EMFUserError
Description copied from interface: IBIObjectDAO
Loads all detail information for a BI Object identified by its biObjectID identifier. All these information, achived by a query to the DB, are stored into a BIObject object, which is returned.

Specified by:
loadBIObjectById in interface IBIObjectDAO
Parameters:
biObjectID - the BI object identifier
Returns:
The BI object detail information, stored into a BIObject
Throws:
EMFUserError - If an Exception occurs
See Also:
IBIObjectDAO.loadBIObjectById(java.lang.Integer)

loadBIObjectForDetail

public BIObject loadBIObjectForDetail(java.lang.Integer id)
                               throws EMFUserError
Description copied from interface: IBIObjectDAO
Loads all detail information for a BI Object identified by its id identifier integer. All these information, achived by a query to the DB, are stored into a BIObject object, which is returned.

Specified by:
loadBIObjectForDetail in interface IBIObjectDAO
Parameters:
id - The Integer representing the BI object id
Returns:
The BI object detail information, stored into a BIObject
Throws:
EMFUserError - If an Exception occurs
See Also:
IBIObjectDAO.loadBIObjectForDetail(java.lang.Integer)

loadBIObjectByLabel

public BIObject loadBIObjectByLabel(java.lang.String label)
                             throws EMFUserError
Description copied from interface: IBIObjectDAO
Loads all detail information for a BI Object identified by its label identifier. All these information, achived by a query to the DB, are stored into a BIObject object, which is returned.

Specified by:
loadBIObjectByLabel in interface IBIObjectDAO
Parameters:
label - The BI object label identifier
Returns:
The BI object detail information, stored into a BIObject
Throws:
EMFUserError - If an Exception occurs
See Also:
IBIObjectDAO.loadBIObjectByLabel(java.lang.String)

gatherCMSInformation

public void gatherCMSInformation(BIObject biObject)
                          throws EMFUserError
Load the CMS Information of the biObject

Parameters:
biObject -
Throws:
EMFUserError

loadBIObjectForTree

public BIObject loadBIObjectForTree(java.lang.Integer id)
                             throws EMFUserError
Description copied from interface: IBIObjectDAO
Loads all tree information for a BI Object identified by its id identifier Integer. All these information, achived by a query to the DB, are stored into a BIObject object, which is returned.

Specified by:
loadBIObjectForTree in interface IBIObjectDAO
Parameters:
id - The Integer representing the BI object id
Returns:
The BI object tree information, stored into a BIObject
Throws:
EMFUserError - If an Exception occurs
See Also:
IBIObjectDAO.loadBIObjectForTree(java.lang.Integer)

modifyBIObject

public void modifyBIObject(BIObject obj)
                    throws EMFUserError
Description copied from interface: IBIObjectDAO
Implements the query to modify a BI Object. All information needed is stored into the input BIObject object.

Specified by:
modifyBIObject in interface IBIObjectDAO
Parameters:
obj - The BIobject containing all modify information
Throws:
EMFUserError - If an Exception occurred
See Also:
IBIObjectDAO.modifyBIObject(it.eng.spagobi.bo.BIObject)

modifyBIObjectWithoutVersioning

public void modifyBIObjectWithoutVersioning(BIObject obj)
                                     throws EMFUserError
Description copied from interface: IBIObjectDAO
Implements the query to modify a BI Object, but without updating versioning. All information needed is stored into the input BIObject object.

Specified by:
modifyBIObjectWithoutVersioning in interface IBIObjectDAO
Parameters:
obj - The BIobject containing all modify information
Throws:
EMFUserError - If an Exception occurred
See Also:
IBIObjectDAO.modifyBIObjectWithoutVersioning(it.eng.spagobi.bo.BIObject)

internalModify

private void internalModify(BIObject biObject,
                            boolean version)
                     throws EMFUserError
Updates the CMS repository if the user has loaded a file template. If he has, the boolean input parameter version is true and the CNS is uploaded, else not.

Parameters:
biObject - The BI Object as input
version - The boolean input parameter
Throws:
EMFUserError - If any exception occurred

insertBIObject

public void insertBIObject(BIObject obj)
                    throws EMFUserError
Description copied from interface: IBIObjectDAO
Implements the query to insert a BIObject. All information needed is stored into the input BIObject object.

Specified by:
insertBIObject in interface IBIObjectDAO
Parameters:
obj - The object containing all insert information
Throws:
EMFUserError - If an Exception occurred
See Also:
IBIObjectDAO.insertBIObject(it.eng.spagobi.bo.BIObject)

eraseBIObject

public void eraseBIObject(BIObject obj,
                          java.lang.Integer idFunct)
                   throws EMFUserError
Description copied from interface: IBIObjectDAO
Deletes a BIObject from a functionality. Then, if the BIObject is no more referenced in any functionality, deletes it completely from db and from CMS

Specified by:
eraseBIObject in interface IBIObjectDAO
Parameters:
obj - The object containing all delete information
idFunct - The Integer representing the functionality id
Throws:
EMFUserError - If an Exception occurred
See Also:
IBIObjectDAO.eraseBIObject(it.eng.spagobi.bo.BIObject, java.lang.Integer)

getCorrectRolesForExecution

public java.util.List getCorrectRolesForExecution(java.lang.Integer id,
                                                  it.eng.spago.security.IEngUserProfile profile)
                                           throws EMFUserError
Description copied from interface: IBIObjectDAO
Given the id for a report and the user profile, gets the corret roles for execution.

Specified by:
getCorrectRolesForExecution in interface IBIObjectDAO
Parameters:
id - The Integer id for the report
profile - The user profile
Returns:
The list of correct roles for execution
Throws:
EMFUserError - If an Exception occurred
See Also:
IBIObjectDAO.getCorrectRolesForExecution(java.lang.Integer, it.eng.spago.security.IEngUserProfile)

getCorrectRolesForExecution

public java.util.List getCorrectRolesForExecution(java.lang.Integer id)
                                           throws EMFUserError
Description copied from interface: IBIObjectDAO
Gets the correct roles for Report execution, given only the Report's id.

Specified by:
getCorrectRolesForExecution in interface IBIObjectDAO
Parameters:
id - The Integer id for the report
Returns:
The list of correct roles for execution
Throws:
EMFUserError - If an Exception occurred
See Also:
IBIObjectDAO.getCorrectRolesForExecution(java.lang.Integer)

getCorrectRoles

private java.util.List getCorrectRoles(java.lang.Integer id,
                                       java.util.Collection roles)
                                throws EMFUserError
Gets a list of correct role according to the report at input, identified by its id

Parameters:
id - The Integer representing report's id
roles - The collection of all roles
Returns:
The correct roles list
Throws:
EMFUserError - if any exception occurred

toBIObject

public BIObject toBIObject(SbiObjects hibBIObject)
From the Hibernate BI object at input, gives the corrispondent BI object

Parameters:
hibBIObject - The Hibernate BI object
Returns:
the corrispondent output BIObject

loadAllBIObjects

public java.util.List loadAllBIObjects()
                                throws EMFUserError
Given all parameters for the input hibernate BI object, fills the other BIObject at input with these parameters.

Specified by:
loadAllBIObjects in interface IBIObjectDAO
Parameters:
aBIObject - The BI object to fill parameters in
hibBIObject - The Hibernate BI object
role -
Returns:
the list of BIObjects
Throws:
EMFUserError - If an Exception occurred

getBIObjectParameters

public java.util.List getBIObjectParameters(BIObject aBIObject)
                                     throws EMFUserError
Gets the biparameters associated with to a biobject

Specified by:
getBIObjectParameters in interface IBIObjectDAO
Parameters:
aBIObject - BIObject the biobject to analize
Returns:
List, list of the biparameters associated with the biobject
Throws:
EMFUserError

loadAllBIObjectsFromInitialPath

public java.util.List loadAllBIObjectsFromInitialPath(java.lang.String initialPath)
                                               throws EMFUserError
Description copied from interface: IBIObjectDAO
Loads all the BIObjects that belong to sub functionalities of the given functionality path

Specified by:
loadAllBIObjectsFromInitialPath in interface IBIObjectDAO
Returns:
the list of BIObjects
Throws:
EMFUserError - If an Exception occurred

loadBIObjectForDetail

public BIObject loadBIObjectForDetail(java.lang.String path)
                               throws EMFUserError
Description copied from interface: IBIObjectDAO
Loads all detail information for a BI Object identified by its path in the cms. All these information, achived by a query to the DB, are stored into a BIObject object, which is returned.

Specified by:
loadBIObjectForDetail in interface IBIObjectDAO
Returns:
The BI object detail information, stored into a BIObject
Throws:
EMFUserError - If an Exception occurs