public List<QuestionarioAnamnese> getQARelationshipPaciente(Long idPaciente) throws Exception {
   OrmFormat orm = new OrmFormat(new Odontograma(idPaciente));
   IQuery query = CrudQuery.getSelectQuery(QuestionarioAnamnese.class, orm.formatNotNull(), "*");
   List<QuestionarioAnamnese> loads = getSqlExecutor().executarQuery(query);
   for (QuestionarioAnamnese o : loads) {
     afterLoad(o);
   }
   return loads;
 }
Esempio n. 2
0
 private String restorePwd() {
   DaoUsuario dao = new DaoUsuario();
   OrmFormat format = new OrmFormat(new Usuario(getUsuario().getCodigo()));
   IQuery query =
       CrudQuery.getSelectQuery(
           Usuario.class, OrmFormat.getCleanFormat(format.format("codigo")), "senha");
   try {
     List<Map<String, Object>> pwdList =
         dao.getSqlExecutor().executarUntypedQuery(query.getQuery(), query.getParams(), 1);
     if (pwdList.size() == 1) {
       Map<String, Object> formatedPwd = pwdList.get(0);
       OrmTranslator translator = new OrmTranslator(dao.getFields());
       return formatedPwd.get(translator.getColumn("senha")).toString();
     }
   } catch (SQLException e) {
     e.printStackTrace();
   }
   return null;
 }