Search in sources :

Example 1 with Note

use of com.example.domain.Note in project javaee7-samples by javaee-samples.

the class NoteResourceImpl method removeNote.

@Override
public void removeNote(Long noteId) {
    final Note note = entityManager.find(Note.class, noteId);
    if (null == note) {
        throw new NoResultException("No note with id " + noteId + " found");
    }
    entityManager.remove(note);
}
Also used : Note(com.example.domain.Note) NoResultException(javax.persistence.NoResultException)

Aggregations

Note (com.example.domain.Note)1 NoResultException (javax.persistence.NoResultException)1