Search in sources :

Example 41 with ActivityEntity

use of org.mifos.security.rolesandpermission.business.ActivityEntity in project head by mifos.

the class LegacyRolesPermissionsDao method getActivityById.

public ActivityEntity getActivityById(Short id) throws PersistenceException {
    try {
        Map<String, Object> queryParameters = new HashMap<String, Object>();
        queryParameters.put("ACTIVITY_ID", id);
        return (ActivityEntity) execUniqueResultNamedQuery(NamedQueryConstants.GET_ACTIVITY_BY_ID, queryParameters);
    } catch (Exception e) {
        throw new PersistenceException(e);
    }
}
Also used : ActivityEntity(org.mifos.security.rolesandpermission.business.ActivityEntity) HashMap(java.util.HashMap) PersistenceException(org.mifos.framework.exceptions.PersistenceException) SystemException(org.mifos.framework.exceptions.SystemException) ActivityGeneratorException(org.mifos.security.activity.ActivityGeneratorException) ServiceException(org.mifos.framework.exceptions.ServiceException) SecurityException(org.mifos.framework.exceptions.SecurityException) MifosRuntimeException(org.mifos.core.MifosRuntimeException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException)

Example 42 with ActivityEntity

use of org.mifos.security.rolesandpermission.business.ActivityEntity in project head by mifos.

the class ReportsPersistence method updateLookUpValue.

public void updateLookUpValue(Short activityId, String inputCategoryName) {
    ActivityEntity activityEntity = null;
    try {
        activityEntity = getPersistentObject(ActivityEntity.class, activityId);
    } catch (Exception ex) {
        throw new RuntimeException(ex.getMessage());
    }
    if (activityEntity != null) {
        LookUpValueEntity lookUpValueEntity = activityEntity.getDescriptionLookupValues();
        ApplicationContextProvider.getBean(MessageLookup.class).updateLookupValue(lookUpValueEntity, inputCategoryName);
    }
}
Also used : ActivityEntity(org.mifos.security.rolesandpermission.business.ActivityEntity) MessageLookup(org.mifos.application.master.MessageLookup) SystemException(org.mifos.framework.exceptions.SystemException) ReportException(org.mifos.reports.exceptions.ReportException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) LookUpValueEntity(org.mifos.application.master.business.LookUpValueEntity)

Aggregations

ActivityEntity (org.mifos.security.rolesandpermission.business.ActivityEntity)42 PersistenceException (org.mifos.framework.exceptions.PersistenceException)13 MifosRuntimeException (org.mifos.core.MifosRuntimeException)12 Test (org.junit.Test)10 LookUpValueEntity (org.mifos.application.master.business.LookUpValueEntity)9 RoleBO (org.mifos.security.rolesandpermission.business.RoleBO)9 ArrayList (java.util.ArrayList)8 UserContext (org.mifos.security.util.UserContext)8 HibernateException (org.hibernate.HibernateException)7 ActivityGeneratorException (org.mifos.security.activity.ActivityGeneratorException)7 ApplicationException (org.mifos.framework.exceptions.ApplicationException)6 ServiceException (org.mifos.framework.exceptions.ServiceException)6 RolesPermissionsBusinessService (org.mifos.security.rolesandpermission.business.service.RolesPermissionsBusinessService)6 HibernateProcessException (org.mifos.framework.exceptions.HibernateProcessException)5 SystemException (org.mifos.framework.exceptions.SystemException)5 IOException (java.io.IOException)4 MessageLookup (org.mifos.application.master.MessageLookup)4 SecurityException (org.mifos.framework.exceptions.SecurityException)4 List (java.util.List)3 UserContextFactory (org.mifos.accounts.servicefacade.UserContextFactory)3