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

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

public class ModelDAOImpl
extends AbstractHibernateDAO
implements IModelDAO


Field Summary
 
Fields inherited from class it.eng.spagobi.commons.dao.AbstractHibernateDAO
TENANT_FILTER_NAME
 
Constructor Summary
ModelDAOImpl()
           
 
Method Summary
 boolean deleteModel(java.lang.Integer modelId)
          Delete a Model (children and attributes).
 java.lang.Integer insertModel(Model model)
          Insert a model and return the new model.
 java.lang.Integer insertModel(Model model, java.lang.Integer modelTypeId)
          Insert a model and return the new model.
 java.util.List loadModelsRoot()
          Returns the List of Model Root.
 java.util.List loadModelsRoot(java.lang.String fieldOrder, java.lang.String typeOrder)
           
 Model loadModelWithChildrenById(java.lang.Integer id)
          Returns the Model wit its children of the referred id
 Model loadModelWithoutChildrenById(java.lang.Integer id)
          Returns the Model without its children of the referred id
 void modifyModel(Model value)
          Modify model.
protected static Model toModelWithoutChildren(SbiKpiModel value, org.hibernate.Session aSession)
           
 
Methods inherited from class it.eng.spagobi.commons.dao.AbstractHibernateDAO
commitIfActiveAndClose, disableTenantFilter, enableTenantFilter, getSession, getTenant, getUserProfile, logException, rollbackIfActiveAndClose, setTenant, 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, setTenant, setUserID, setUserProfile
 

Constructor Detail

ModelDAOImpl

public ModelDAOImpl()
Method Detail

loadModelWithoutChildrenById

public Model loadModelWithoutChildrenById(java.lang.Integer id)
                                   throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelDAO
Returns the Model without its children of the referred id

Specified by:
loadModelWithoutChildrenById in interface IModelDAO
Parameters:
id - of the Model
Returns:
Model of the referred id
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

loadModelWithChildrenById

public Model loadModelWithChildrenById(java.lang.Integer id)
                                throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelDAO
Returns the Model wit its children of the referred id

Specified by:
loadModelWithChildrenById in interface IModelDAO
Parameters:
id - of the Model
Returns:
Model of the referred id
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

modifyModel

public void modifyModel(Model value)
                 throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelDAO
Modify model.

Specified by:
modifyModel in interface IModelDAO
Parameters:
value - the a model
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

loadModelsRoot

public java.util.List loadModelsRoot()
                              throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelDAO
Returns the List of Model Root.

Specified by:
loadModelsRoot in interface IModelDAO
Returns:
List of Model Root.
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred.

toModelWithoutChildren

protected static Model toModelWithoutChildren(SbiKpiModel value,
                                              org.hibernate.Session aSession)

insertModel

public java.lang.Integer insertModel(Model model,
                                     java.lang.Integer modelTypeId)
                              throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelDAO
Insert a model and return the new model.

Specified by:
insertModel in interface IModelDAO
Parameters:
model - the model to create
modelTypeId - the id of the type of the model
Returns:
the id of the model created
Throws:
it.eng.spago.error.EMFUserError - the EMF user error

deleteModel

public boolean deleteModel(java.lang.Integer modelId)
                    throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelDAO
Delete a Model (children and attributes).

Specified by:
deleteModel in interface IModelDAO
Parameters:
modelId - id of the model to delete.
Returns:
Return true if the model is deleted.
Throws:
it.eng.spago.error.EMFUserError

loadModelsRoot

public java.util.List loadModelsRoot(java.lang.String fieldOrder,
                                     java.lang.String typeOrder)
                              throws it.eng.spago.error.EMFUserError
Specified by:
loadModelsRoot in interface IModelDAO
Throws:
it.eng.spago.error.EMFUserError

insertModel

public java.lang.Integer insertModel(Model model)
                              throws it.eng.spago.error.EMFUserError
Description copied from interface: IModelDAO
Insert a model and return the new model.

Specified by:
insertModel in interface IModelDAO
Parameters:
model - the model to create
Returns:
the id of the model created
Throws:
it.eng.spago.error.EMFUserError - the EMF user error