use of org.mifos.application.master.business.LookUpValueEntity in project head by mifos.
the class BirtAdminDocumentUploadActionStrutsTest method removeReport.
private void removeReport(Short reportId) throws PersistenceException {
legacyAdminDocumentDao.getSession().clear();
ReportsBO report = legacyAdminDocumentDao.getPersistentObject(ReportsBO.class, reportId);
ActivityEntity activityEntity = legacyRolesPermissionsDao.getPersistentObject(ActivityEntity.class, report.getActivityId());
legacyAdminDocumentDao.delete(report);
LookUpValueEntity anLookUp = activityEntity.getActivityNameLookupValues();
legacyRolesPermissionsDao.delete(activityEntity);
legacyRolesPermissionsDao.delete(anLookUp);
StaticHibernateUtil.flushSession();
}
use of org.mifos.application.master.business.LookUpValueEntity in project head by mifos.
the class ReportsCategoryActionStrutsTest method deleteActivityForTest.
private void deleteActivityForTest(ActivityEntity activityEntity) throws PersistenceException {
LookUpValueEntity anLookUp = activityEntity.getActivityNameLookupValues();
legacyRolesPermissionsDao.delete(activityEntity);
legacyRolesPermissionsDao.delete(anLookUp);
}
use of org.mifos.application.master.business.LookUpValueEntity in project head by mifos.
the class LegacyRolesPermissionsDaoIntegrationTest method insertActivityForTest.
private ActivityEntity insertActivityForTest(short activityId) throws PersistenceException {
LookUpValueEntity anLookUp = new LookUpValueEntity();
LookUpEntity lookUpEntity = legacyMasterDao.getPersistentObject(LookUpEntity.class, Short.valueOf((short) LookUpEntity.ACTIVITY));
anLookUp.setLookUpEntity(lookUpEntity);
ActivityEntity parent = legacyMasterDao.getPersistentObject(ActivityEntity.class, (short) 13);
ActivityEntity activityEntity = new ActivityEntity(activityId, parent, anLookUp);
legacyRolesPermissionsDao.createOrUpdate(anLookUp);
legacyRolesPermissionsDao.createOrUpdate(activityEntity);
return activityEntity;
}
use of org.mifos.application.master.business.LookUpValueEntity in project head by mifos.
the class LegacyMasterDao method addValueListElementForLocale.
/**
* Create a new list element for a single locale.
*
* It would be nicer for this to operate on objects rather than ids, but it
* is a first step that works.
*/
public LookUpValueEntity addValueListElementForLocale(final Short lookupEnityId, final String newElementText, final String lookUpName) throws PersistenceException {
LookUpEntity lookUpEntity = getPersistentObject(LookUpEntity.class, lookupEnityId);
LookUpValueEntity lookUpValueEntity = new LookUpValueEntity();
lookUpValueEntity.setLookUpEntity(lookUpEntity);
lookUpValueEntity.setLookUpName(lookUpName);
createOrUpdate(lookUpValueEntity);
LookUpValueLocaleEntity lookUpValueLocaleEntity = new LookUpValueLocaleEntity();
lookUpValueLocaleEntity.setLocaleId(Localization.ENGLISH_LOCALE_ID);
lookUpValueLocaleEntity.setLookUpValue(newElementText);
lookUpValueLocaleEntity.setLookUpId(lookUpValueEntity.getLookUpId());
createOrUpdate(lookUpValueLocaleEntity);
// MifosConfiguration.getInstance().updateKey(lookUpValueEntity,
// newElementText);
ApplicationContextProvider.getBean(MessageLookup.class).updateLookupValueInCache(lookUpValueEntity, newElementText);
return lookUpValueEntity;
}
use of org.mifos.application.master.business.LookUpValueEntity in project head by mifos.
the class LegacyMasterDao method updateValueListElementForLocale.
/**
* Update the String value of a LookUpValueLocaleEntity.
*
* @param lookupValueEntityId
* - the database id of the LookUpValueLocaleEntity object
* representing a ValueListElement
*/
public void updateValueListElementForLocale(final Integer lookupValueEntityId, final String newValue) throws PersistenceException {
LookUpValueEntity lookupValueEntity = getPersistentObject(LookUpValueEntity.class, lookupValueEntityId);
Set<LookUpValueLocaleEntity> lookUpValueLocales = lookupValueEntity.getLookUpValueLocales();
if (lookUpValueLocales != null) {
for (LookUpValueLocaleEntity entity : lookUpValueLocales) {
if (entity.getLookUpId().equals(lookupValueEntityId)) {
entity.setLookUpValue(newValue);
createOrUpdate(entity);
ApplicationContextProvider.getBean(MessageLookup.class).updateLookupValueInCache(lookupValueEntity.getLookUpName(), newValue);
StaticHibernateUtil.commitTransaction();
break;
}
}
}
}
Aggregations