Search in sources :

Example 6 with NoteDAO

use of de.djuelg.neuronizer.storage.model.NoteDAO in project Neuronizer by djuelg.

the class NoteRepositoryImpl method update.

@Override
public void update(Note updatedNote) {
    Realm realm = Realm.getInstance(configuration);
    final NoteDAO noteDAO = RealmConverter.convert(updatedNote);
    realm.executeTransaction(new Realm.Transaction() {

        @Override
        public void execute(@NonNull Realm realm) {
            realm.copyToRealmOrUpdate(noteDAO);
        }
    });
    realm.close();
}
Also used : NoteDAO(de.djuelg.neuronizer.storage.model.NoteDAO) Realm(io.realm.Realm)

Aggregations

NoteDAO (de.djuelg.neuronizer.storage.model.NoteDAO)6 Realm (io.realm.Realm)6 Note (de.djuelg.neuronizer.domain.model.preview.Note)2 ArrayList (java.util.ArrayList)2 ItemsPerPreview (de.djuelg.neuronizer.domain.model.preview.ItemsPerPreview)1 NotePreview (de.djuelg.neuronizer.domain.model.preview.NotePreview)1 Preview (de.djuelg.neuronizer.domain.model.preview.Preview)1 TodoListPreview (de.djuelg.neuronizer.domain.model.preview.TodoListPreview)1 NoteDAOConverter (de.djuelg.neuronizer.storage.converter.NoteDAOConverter)1 TodoListDAO (de.djuelg.neuronizer.storage.model.TodoListDAO)1