use of org.mifos.application.master.business.LookUpValueLocaleEntity 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;
}
}
}
}
use of org.mifos.application.master.business.LookUpValueLocaleEntity in project head by mifos.
the class ApplicationConfigurationDaoHibernate method findLookupValues.
@Override
@SuppressWarnings("unchecked")
public List<LookUpValueEntity> findLookupValues() {
List<LookUpValueEntity> values = null;
Session session = StaticHibernateUtil.getSessionTL();
values = session.getNamedQuery(NamedQueryConstants.GET_LOOKUPVALUES).list();
if (values != null) {
for (LookUpValueEntity value : values) {
Set<LookUpValueLocaleEntity> localeValues = value.getLookUpValueLocales();
value.getLookUpName();
if (localeValues != null) {
for (LookUpValueLocaleEntity locale : localeValues) {
locale.getLookUpValue();
locale.getLocaleId();
}
}
}
}
return values;
}
use of org.mifos.application.master.business.LookUpValueLocaleEntity in project head by mifos.
the class LegacyRolesPermissionsDao method changeActivityMessage.
public void changeActivityMessage(short activityId, short localeId, String newMessage) throws PersistenceException {
ActivityEntity activityEntity = getPersistentObject(ActivityEntity.class, Short.valueOf(activityId));
Integer lookUpId = activityEntity.getActivityNameLookupValues().getLookUpId();
LookUpValueLocaleEntity lookUpValueLocaleEntity = legacyMasterDao.retrieveOneLookUpValueLocaleEntity(localeId, lookUpId);
lookUpValueLocaleEntity.setLookUpValue(newMessage);
createOrUpdate(lookUpValueLocaleEntity);
}
use of org.mifos.application.master.business.LookUpValueLocaleEntity in project head by mifos.
the class LegacyRolesPermissionsDao method insertLookUpValueLocale.
private void insertLookUpValueLocale(int lookUpId, String lookUpDescription) throws PersistenceException {
LookUpValueLocaleEntity lookUpValueLocaleEntity = new LookUpValueLocaleEntity();
lookUpValueLocaleEntity.setLookUpId(new Integer(lookUpId));
lookUpValueLocaleEntity.setLocaleId(Localization.ENGLISH_LOCALE_ID);
lookUpValueLocaleEntity.setLookUpValue(lookUpDescription);
createOrUpdate(lookUpValueLocaleEntity);
}
Aggregations