/** * Save words into database. This words should be loaded from database before (should contain id). */ public void updateWords(Word word1, Word word2) { if (word1.getId() != -1) { dataBaseManager.update(dao.setPersistable(word1)); } if (word2.getId() != -1) { dataBaseManager.update(dao.setPersistable(word2)); } }
private Word loadWord(Link link, Language language) { Word target = new Word(); target.setId(link.getWordId(language)); target.setLanguage(language); return dataBaseManager.retrieve(dao.setPersistable(target)); }