Ejemplo n.º 1
0
 private static Commande mapRes(ResultSet rs) {
   Commande commande = new Commande();
   try {
     commande.setId(rs.getInt("IDCOMMANDE"));
     commande.setClient(DaoClient.find(rs.getInt("IDCLIENT")));
     commande.setAdresse(rs.getString("ADRESSECOMMANDE"));
     commande.setDate(rs.getTimestamp("TIMECOMMANDE"));
     commande.setEtat(Commande.stringToEnum(rs.getString("ETATCOMMANDE")));
   } catch (Exception e) {
     e.printStackTrace();
   }
   return commande;
 }
Ejemplo n.º 2
0
 private static Commande mapRes(ResultSet rs, boolean withList) {
   if (!withList) {
     return mapRes(rs);
   } else {
     Commande commande = new Commande();
     try {
       commande.setId(rs.getInt("IDCOMMANDE"));
       commande.setClient(DaoClient.find(rs.getInt("IDCLIENT")));
       commande.setAdresse(rs.getString("ADRESSECOMMANDE"));
       commande.setDate(rs.getTimestamp("TIMECOMMANDE"));
       commande.setEtat(Commande.stringToEnum(rs.getString("ETATCOMMANDE")));
       commande.setPlacoms(DaoPlaCom.findByCommande(commande.getId()));
     } catch (Exception e) {
       e.printStackTrace();
     }
     return commande;
   }
 }