@Override
public boolean delete(String id, AppDefinition appDef) {
boolean result = false;
try {
Message obj = loadById(id, appDef);
// detach from app
if (obj != null) {
Collection<Message> list = appDef.getMessageList();
for (Message object : list) {
if (obj.getId().equals(object.getId())) {
String key = getCacheKey(object.getMessageKey(), object.getLocale(), object.getAppId(), object.getAppVersion().toString());
if (cache.containsKey(key)) {
cache.remove(key);
}
list.remove(obj);
break;
}
}
obj.setAppDefinition(null);
// delete obj
super.delete(getEntityName(), obj);
result = true;
}