133134135136137138139140141142143
query.setOrdering("firstname asc"); result = (List<Patient>) query.execute(); result = Lists.newArrayList(pm.detachCopyAll(result)); } catch(Exception e) { throw new ServerException(e.toString()); } finally { pm.close(); } return result;
187188189190191192193194195196197
//patient.getEmail(), patient.getNotes()})); } } } catch(Exception e) { throw new ServerException(e.toString()); } finally { pm.close(); } return result;
248249250251252253254255256257258
pm.currentTransaction().begin(); pm.makePersistent(patient); pm.currentTransaction().commit(); } catch(Exception e) { pm.currentTransaction().rollback(); throw new ServerException(e.toString()); } finally { pm.close(); } return patient;