59606162636465666768
pm.deletePersistent(notesList); pm.currentTransaction().commit(); } catch (Exception ex) { pm.currentTransaction().rollback(); throw new DAOException(); } finally { pm.close(); } }
84858687888990919293
pm.makePersistent(notesList); pm.currentTransaction().commit(); } catch (Exception ex) { pm.currentTransaction().rollback(); throw new DAOException(); } finally { pm.close(); } }
110111112113114115116117118119
pm.currentTransaction().commit(); } catch (Exception ex) { pm.currentTransaction().rollback(); ex.printStackTrace(); throw new DAOException(); } finally { pm.close(); } }
131132133134135136137138139140
pm.makePersistent(notesList); pm.currentTransaction().commit(); }catch (Exception ex) { pm.currentTransaction().rollback(); throw new DAOException(); } finally { pm.close(); } }
152153154155156157158159160161
176177178179180181182183184185186
NoteList notesList = null; try { notesList = pm.getObjectById(NoteList.class, key); notesList.getNotes(); // lazyfetch } catch (Exception ex) { throw new DAOException(); } finally { pm.close(); } return notesList; }
191192193194195196197198199200201
Note note = null; try { note = pm.getObjectById(Note.class, key); } catch (Exception ex) { ex.printStackTrace(); throw new DAOException(); } finally { pm.close(); } return note; }
145146147148149150151152153154
notesList.getNotes().add(note); em.getTransaction().commit(); }catch (Exception ex) { em.getTransaction().rollback(); throw new DAOException(); } finally { em.close(); } }
172173174175176177178179180181182
notesList = em.find(NoteList.class, key); notesList.getNotes(); // lazy loading em.detach(notesList); } catch (Exception e) { e.printStackTrace(); throw new DAOException(); } finally { em.close(); } return notesList;
188189190191192193194195196197198
Note note = null; try{ note = em.find(Note.class, key); } catch (Exception e) { e.printStackTrace(); throw new DAOException(); } finally { em.close(); } return note; }