コード例 #1
0
 @Override
 public Notes createNote(String subject, String body) {
   Notes newNote = new Notes();
   newNote.setSubject(subject);
   newNote.setBody(body);
   this.entityManager.persist(newNote);
   return newNote;
 }
コード例 #2
0
 @Override
 public Notes updateNotes(long id, String subject, String body) {
   Notes note = this.getNotesById(id);
   note.setBody(body);
   note.setSubject(subject);
   this.entityManager.merge(note);
   return getNotesById(id);
 }