use of io.jawg.osmcontributor.model.events.NoteSavedEvent in project osm-contributor by jawg.
the class NoteManager method saveNoteNoTransactionMgmt.
/**
* Method saving a note and the associated foreign collection (comments) without transaction management.
* <p/>
* Do not call the DAO directly to save a note, use this method.
*
* @param note The note to save.
* @return The saved note.
* @see #saveNote(Note)
*/
private Note saveNoteNoTransactionMgmt(Note note) {
commentDao.deleteByNoteIdAndUpdated(note.getId(), false);
noteDao.createOrUpdate(note);
if (note.getComments() != null) {
for (Comment comment : note.getComments()) {
commentDao.createOrUpdate(comment);
}
}
bus.post(new NoteSavedEvent(note));
return note;
}
Aggregations