it.eng.spagobi.kpi.model.dao
Class ModelResourceDAOImpl

java.lang.Object
  extended by it.eng.spagobi.commons.dao.AbstractHibernateDAO
      extended by it.eng.spagobi.kpi.model.dao.ModelResourceDAOImpl
All Implemented Interfaces:
ISpagoBIDao, IModelResourceDAO

public class ModelResourceDAOImpl
extends AbstractHibernateDAO
implements IModelResourceDAO


Constructor Summary
ModelResourceDAOImpl()
           
 
Method Summary
 void addModelResource(java.lang.Integer modelId, java.lang.Integer resourceId)
          Add an association between a model instance and a resource.
 boolean isSelected(java.lang.Integer modelId, java.lang.Integer resourceId)
          Check if a resources is associated with a modelInstance.
 java.util.List loadModelResourceByModelId(java.lang.Integer modelInstId)
          Load all couples .
 void removeAllModelResource(java.lang.Integer modelId)
          Remove all association between a model and same resources.
 void removeModelResource(java.lang.Integer modelId, java.lang.Integer resourceId)
          Remove an association between a model instance and a resource.
 Resource toResource(SbiKpiModelResources re)
           
 
Methods inherited from class it.eng.spagobi.commons.dao.AbstractHibernateDAO
getSession, getUserProfile, logException, rollbackIfActiveAndClose, setUserID, setUserProfile, updateSbiCommonInfo4Insert, updateSbiCommonInfo4Update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.eng.spagobi.commons.dao.ISpagoBIDao
getUserProfile, setUserID, setUserProfile
 

Constructor Detail

ModelResourceDAOImpl

public ModelResourceDAOImpl()
Method Detail

toResource

public Resource toResource(SbiKpiModelResources re)
                    throws it.eng.spago.error.EMFUserError
Specified by:
toResource in interface IModelResourceDAO
Throws:
it.eng.spago.error.EMFUserError

loadModelResourceByModelId

public java.util.List loadModelResourceByModelId(java.lang.Integer modelInstId)
                                          throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelResourceDAO
Load all couples .

Specified by:
loadModelResourceByModelId in interface IModelResourceDAO
Returns:
list of modelResource Id
Throws:
it.eng.spago.error.EMFUserError

addModelResource

public void addModelResource(java.lang.Integer modelId,
                             java.lang.Integer resourceId)
                      throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelResourceDAO
Add an association between a model instance and a resource.

Specified by:
addModelResource in interface IModelResourceDAO
Parameters:
modelId - the id of modelInstance.
resourceId - the id of the resource.
Throws:
it.eng.spago.error.EMFUserError

isSelected

public boolean isSelected(java.lang.Integer modelId,
                          java.lang.Integer resourceId)
                   throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelResourceDAO
Check if a resources is associated with a modelInstance.

Specified by:
isSelected in interface IModelResourceDAO
Parameters:
modelId - the id of modelInstance to check.
resourceId - the id of resources to check.
Returns:
true if exist an association between the model instance id and the resources id, false otherwise.
Throws:
it.eng.spago.error.EMFUserError

removeModelResource

public void removeModelResource(java.lang.Integer modelId,
                                java.lang.Integer resourceId)
                         throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelResourceDAO
Remove an association between a model instance and a resource.

Specified by:
removeModelResource in interface IModelResourceDAO
Parameters:
modelId - the id of modelInstance.
resourceId - the id of the resource.
Throws:
it.eng.spago.error.EMFUserError

removeAllModelResource

public void removeAllModelResource(java.lang.Integer modelId)
                            throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelResourceDAO
Remove all association between a model and same resources.

Specified by:
removeAllModelResource in interface IModelResourceDAO
Parameters:
modelId - the id of modelInstance.
Throws:
it.eng.spago.error.EMFUserError