it.eng.spagobi.kpi.config.dao
Class KpiDAOImpl

java.lang.Object
  extended by it.eng.spagobi.commons.dao.AbstractHibernateDAO
      extended by it.eng.spagobi.kpi.config.dao.KpiDAOImpl
All Implemented Interfaces:
ISpagoBIDao, IKpiDAO

public class KpiDAOImpl
extends AbstractHibernateDAO
implements IKpiDAO


Constructor Summary
KpiDAOImpl()
           
 
Method Summary
 java.lang.Integer countKpis()
           
 boolean deleteKpi(java.lang.Integer kpiId)
           
 boolean deleteKpiRel(java.lang.Integer kpiRelId)
           
 void deleteKpiValueFromInterval(java.lang.Integer kpiInstanceId, java.util.Date from, java.util.Date to, Resource r, OrganizationalUnitGrantNode grantNode)
          KpiValue valid for the the KpiInstance selected, ou selected for the resource selected, in the date selected
 KpiValue getDisplayKpiValue(java.lang.Integer kpiInstanceId, java.util.Date d, Resource r, OrganizationalUnitGrantNode grantNode)
          The last KpiValue for the the KpiInstance selected, for the resource selected, ou and hiererchy selected in the date selected or before
 it.eng.spagobi.tools.dataset.bo.IDataSet getDsFromKpiId(java.lang.Integer kpiId)
           
 java.lang.Integer getKpiTrend(java.lang.Integer resId, java.lang.Integer kpiInstId, java.util.Date endDate)
           
 org.json.JSONObject getKpiTrendJSONResult(java.lang.Integer kpiInstId, java.util.Date beginDate, java.util.Date endDate)
          Returns a JSONOBject with all the the trend values of the KpiInstance
 java.lang.String getKpiTrendXmlResult(java.lang.Integer resId, java.lang.Integer kpiInstId, java.util.Date endDate)
          Returns a List of all the the Threshols of the KpiInstance
 java.lang.String getKpiTrendXmlResult(java.lang.Integer resId, java.lang.Integer kpiInstId, java.util.Date beginDate, java.util.Date endDate)
          Returns a List of all the the Threshols of the KpiInstance
 KpiValue getKpiValue(java.lang.Integer kpiInstanceId, java.util.Date d, Resource r, OrganizationalUnitGrantNode grantNode)
          KpiValue valid for the the KpiInstance selected, for the resource selected, ant the selected grant node associated
 java.util.List getKpiValue(SbiKpiInstance kpi, java.util.Date d)
           
 KpiValue getKpiValueFromInterval(java.lang.Integer kpiInstanceId, java.util.Date from, java.util.Date to, Resource r, OrganizationalUnitGrantNode grantNode)
          KpiValue valid for the the KpiInstance selected, for the resource selected,ou selected in the date selected
 java.lang.Integer insertKpi(Kpi kpi)
           
 java.lang.Integer insertKpiValue(KpiValue value)
          Inserts a new KPI Value with its date, value period and thresholds
 Kpi loadKpiById(java.lang.Integer id)
          Returns the Kpi of the referred id
 Kpi loadKpiDefinitionById(java.lang.Integer id)
          Returns the Kpi Definition of the referred id
 KpiDocuments loadKpiDocByKpiIdAndDocId(java.lang.Integer kpiId, java.lang.Integer docId)
           
 java.util.List loadKpiList()
          Returns the list of Kpi.
 java.util.List loadKpiList(java.lang.String fieldOrder, java.lang.String typeOrder)
           
 java.util.List loadKpiListFiltered(java.lang.String hsql, java.lang.Integer offset, java.lang.Integer fetchSize)
          Returns the list of Kpi filtered by hsql query string.
 java.util.List loadKpiRelListByParentId(java.lang.Integer kpiParentId)
           
 java.lang.String loadKPIValueXml(java.lang.Integer kpiValueId)
           
 java.util.List loadPagedKpiList(java.lang.Integer offset, java.lang.Integer fetchSize)
           
 void modifyKpi(Kpi kpi)
           
 java.lang.Integer setKpiRel(java.lang.Integer kpiParentId, java.lang.Integer kpiChildId, java.lang.String parameter)
           
 Kpi toKpi(SbiKpi kpi)
           
 KpiRel toKpiRel(SbiKpiRel sbiKpiRel)
           
 
Methods inherited from class it.eng.spagobi.commons.dao.AbstractHibernateDAO
commitIfActiveAndClose, 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

KpiDAOImpl

public KpiDAOImpl()
Method Detail

loadKPIValueXml

public java.lang.String loadKPIValueXml(java.lang.Integer kpiValueId)
                                 throws it.eng.spago.error.EMFUserError
Specified by:
loadKPIValueXml in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

loadKpiDocByKpiIdAndDocId

public KpiDocuments loadKpiDocByKpiIdAndDocId(java.lang.Integer kpiId,
                                              java.lang.Integer docId)
                                       throws it.eng.spago.error.EMFUserError
Specified by:
loadKpiDocByKpiIdAndDocId in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

loadKpiDefinitionById

public Kpi loadKpiDefinitionById(java.lang.Integer id)
                          throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
Returns the Kpi Definition of the referred id

Specified by:
loadKpiDefinitionById in interface IKpiDAO
Parameters:
id - of the Kpi
Returns:
Kpi of the referred id
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

loadKpiById

public Kpi loadKpiById(java.lang.Integer id)
                throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
Returns the Kpi of the referred id

Specified by:
loadKpiById in interface IKpiDAO
Parameters:
id - of the Kpi
Returns:
Kpi of the referred id
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

getKpiTrendXmlResult

public java.lang.String getKpiTrendXmlResult(java.lang.Integer resId,
                                             java.lang.Integer kpiInstId,
                                             java.util.Date endDate)
                                      throws it.eng.spago.base.SourceBeanException
Description copied from interface: IKpiDAO
Returns a List of all the the Threshols of the KpiInstance

Specified by:
getKpiTrendXmlResult in interface IKpiDAO
Returns:
List of all the the Threshols of the KpiInstance
Throws:
it.eng.spago.base.SourceBeanException

getKpiTrendXmlResult

public java.lang.String getKpiTrendXmlResult(java.lang.Integer resId,
                                             java.lang.Integer kpiInstId,
                                             java.util.Date beginDate,
                                             java.util.Date endDate)
                                      throws it.eng.spago.base.SourceBeanException
Description copied from interface: IKpiDAO
Returns a List of all the the Threshols of the KpiInstance

Specified by:
getKpiTrendXmlResult in interface IKpiDAO
Returns:
List of all the the Threshols of the KpiInstance
Throws:
it.eng.spago.base.SourceBeanException

getKpiTrendJSONResult

public org.json.JSONObject getKpiTrendJSONResult(java.lang.Integer kpiInstId,
                                                 java.util.Date beginDate,
                                                 java.util.Date endDate)
                                          throws it.eng.spago.base.SourceBeanException
Description copied from interface: IKpiDAO
Returns a JSONOBject with all the the trend values of the KpiInstance

Specified by:
getKpiTrendJSONResult in interface IKpiDAO
Returns:
List of all the the values of the KpiInstance in JSONObject form
Throws:
it.eng.spago.base.SourceBeanException

getKpiTrend

public java.lang.Integer getKpiTrend(java.lang.Integer resId,
                                     java.lang.Integer kpiInstId,
                                     java.util.Date endDate)
                              throws java.lang.Exception
Specified by:
getKpiTrend in interface IKpiDAO
Throws:
java.lang.Exception

getKpiValue

public java.util.List getKpiValue(SbiKpiInstance kpi,
                                  java.util.Date d)
                           throws it.eng.spago.error.EMFUserError
Throws:
it.eng.spago.error.EMFUserError

insertKpiValue

public java.lang.Integer insertKpiValue(KpiValue value)
                                 throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
Inserts a new KPI Value with its date, value period and thresholds

Specified by:
insertKpiValue in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

getKpiValue

public KpiValue getKpiValue(java.lang.Integer kpiInstanceId,
                            java.util.Date d,
                            Resource r,
                            OrganizationalUnitGrantNode grantNode)
                     throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
KpiValue valid for the the KpiInstance selected, for the resource selected, ant the selected grant node associated

Specified by:
getKpiValue in interface IKpiDAO
Returns:
KpiValue valid for the the KpiInstance selected, for the resource selected,ou selected in the date selected
Throws:
it.eng.spago.error.EMFUserError - if an Exception occurs

toKpi

public Kpi toKpi(SbiKpi kpi)
          throws it.eng.spago.error.EMFUserError
Throws:
it.eng.spago.error.EMFUserError

loadKpiList

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

loadKpiList

public java.util.List loadKpiList()
                           throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
Returns the list of Kpi.

Specified by:
loadKpiList in interface IKpiDAO
Returns:
the list of all Kpi.
Throws:
it.eng.spago.error.EMFUserError - if an Exception occurs

modifyKpi

public void modifyKpi(Kpi kpi)
               throws it.eng.spago.error.EMFUserError
Specified by:
modifyKpi in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

insertKpi

public java.lang.Integer insertKpi(Kpi kpi)
                            throws it.eng.spago.error.EMFUserError
Specified by:
insertKpi in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

deleteKpi

public boolean deleteKpi(java.lang.Integer kpiId)
                  throws it.eng.spago.error.EMFUserError
Specified by:
deleteKpi in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

getDsFromKpiId

public it.eng.spagobi.tools.dataset.bo.IDataSet getDsFromKpiId(java.lang.Integer kpiId)
                                                        throws it.eng.spago.error.EMFUserError
Specified by:
getDsFromKpiId in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

countKpis

public java.lang.Integer countKpis()
                            throws it.eng.spago.error.EMFUserError
Specified by:
countKpis in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

loadPagedKpiList

public java.util.List loadPagedKpiList(java.lang.Integer offset,
                                       java.lang.Integer fetchSize)
                                throws it.eng.spago.error.EMFUserError
Specified by:
loadPagedKpiList in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

setKpiRel

public java.lang.Integer setKpiRel(java.lang.Integer kpiParentId,
                                   java.lang.Integer kpiChildId,
                                   java.lang.String parameter)
                            throws it.eng.spago.error.EMFUserError
Specified by:
setKpiRel in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

loadKpiRelListByParentId

public java.util.List loadKpiRelListByParentId(java.lang.Integer kpiParentId)
                                        throws it.eng.spago.error.EMFUserError
Specified by:
loadKpiRelListByParentId in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

toKpiRel

public KpiRel toKpiRel(SbiKpiRel sbiKpiRel)
                throws it.eng.spago.error.EMFUserError
Throws:
it.eng.spago.error.EMFUserError

deleteKpiRel

public boolean deleteKpiRel(java.lang.Integer kpiRelId)
                     throws it.eng.spago.error.EMFUserError
Specified by:
deleteKpiRel in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError

getKpiValueFromInterval

public KpiValue getKpiValueFromInterval(java.lang.Integer kpiInstanceId,
                                        java.util.Date from,
                                        java.util.Date to,
                                        Resource r,
                                        OrganizationalUnitGrantNode grantNode)
                                 throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
KpiValue valid for the the KpiInstance selected, for the resource selected,ou selected in the date selected

Specified by:
getKpiValueFromInterval in interface IKpiDAO
Returns:
KpiValue valid for the the KpiInstance selected, ou/hierarchy company selected for the resource selected, in the date selected
Throws:
it.eng.spago.error.EMFUserError - if an Exception occurs

deleteKpiValueFromInterval

public void deleteKpiValueFromInterval(java.lang.Integer kpiInstanceId,
                                       java.util.Date from,
                                       java.util.Date to,
                                       Resource r,
                                       OrganizationalUnitGrantNode grantNode)
                                throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
KpiValue valid for the the KpiInstance selected, ou selected for the resource selected, in the date selected

Specified by:
deleteKpiValueFromInterval in interface IKpiDAO
Throws:
it.eng.spago.error.EMFUserError - if an Exception occurs

loadKpiListFiltered

public java.util.List loadKpiListFiltered(java.lang.String hsql,
                                          java.lang.Integer offset,
                                          java.lang.Integer fetchSize)
                                   throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
Returns the list of Kpi filtered by hsql query string.

Specified by:
loadKpiListFiltered in interface IKpiDAO
Parameters:
hsql - query string
Returns:
the list of filtered Kpi.
Throws:
it.eng.spago.error.EMFUserError - if an Exception occurs

getDisplayKpiValue

public KpiValue getDisplayKpiValue(java.lang.Integer kpiInstanceId,
                                   java.util.Date d,
                                   Resource r,
                                   OrganizationalUnitGrantNode grantNode)
                            throws it.eng.spago.error.EMFUserError
Description copied from interface: IKpiDAO
The last KpiValue for the the KpiInstance selected, for the resource selected, ou and hiererchy selected in the date selected or before

Specified by:
getDisplayKpiValue in interface IKpiDAO
Returns:
Throws:
it.eng.spago.error.EMFUserError