- Timestamp:
- 04/26/10 19:12:49 (14 years ago)
- Location:
- ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance
- Files:
-
- 59 edited
Legend:
- Unmodified
- Added
- Removed
-
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/GestionFichier.java
r68 r70 36 36 out.close(); 37 37 } catch (IOException e) { 38 //system.out.println(e.toString());38 e.printStackTrace(); 39 39 } 40 40 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/PropertiesDatabase.java
r68 r70 12 12 13 13 public PropertiesDatabase() { 14 LoggerPerso.log(PropertiesDatabase.class, LoggerPerso.DEBUG, "chargement fichier de properties");14 // LoggerPerso.log(PropertiesDatabase.class, LoggerPerso.DEBUG, "chargement fichier de properties"); 15 15 String fichierProp = Lanceur.class.getResource("").getPath() + "/../../../../../propriete/serveur.properties"; 16 16 fichierProp.replaceAll("%20", " "); 17 17 prop = new Properties(); 18 18 try { 19 LoggerPerso.log(PropertiesDatabase.class, LoggerPerso.DEBUG, "chargement de : " + fichierProp);19 // LoggerPerso.log(PropertiesDatabase.class, LoggerPerso.DEBUG, "chargement de : " + fichierProp); 20 20 prop.load(new FileInputStream(fichierProp)); 21 21 } catch (Exception e) { … … 36 36 info.setDb_passwd(prop.getProperty("password")); 37 37 38 LoggerPerso.log(PropertiesDatabase.class, LoggerPerso.DEBUG, "chargement :" + info);38 // LoggerPerso.log(PropertiesDatabase.class, LoggerPerso.DEBUG, "chargement :" + info); 39 39 return info; 40 40 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/SGBD_jdbc.java
r68 r70 17 17 import org.medias.eccad.modele.Parametre; 18 18 import org.medias.eccad.modele.Produit; 19 import org.medias.eccad.modele.Secteur; 19 20 import org.postgresql.ds.PGPoolingDataSource; 20 21 import org.postgresql.largeobject.LargeObject; … … 28 29 public SGBD_jdbc(InfoConnectBean info) { 29 30 con = null; 30 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "construction connection");31 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "construction connection"); 31 32 if (pooling == null) { 32 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "creation pooling :: " + info);33 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "creation pooling :: " + info); 33 34 pooling = new PGPoolingDataSource(); 34 35 pooling.setDatabaseName(info.getDb_name()); … … 188 189 } 189 190 190 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListParametre::taille::"+liste_param.size());191 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListParametre::taille::"+liste_param.size()); 191 192 return liste_param; 192 193 } … … 198 199 199 200 requete = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 200 sql = "select distinct id_produit, title_produit, begintime_produit, endtime_produit from produit join grille using (id_produit) where id_param = " + id_param + ";";201 sql = "select distinct id_produit, title_produit, begintime_produit, endtime_produit, order_produit from produit join grille using (id_produit) where id_param = " + id_param + " order by order_produit;"; 201 202 202 203 ResultSet resultat = requete.executeQuery(sql); … … 209 210 } 210 211 211 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListProduit::taille::"+liste_param.size());212 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListProduit::taille::"+liste_param.size()); 212 213 return liste_param; 213 214 … … 228 229 } 229 230 230 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom());231 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom()); 231 232 232 233 return param; … … 250 251 } 251 252 252 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getProduitById::nom::"+ produit.getNom() + "::date::" + produit.getBeginDate());253 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getProduitById::nom::"+ produit.getNom() + "::date::" + produit.getBeginDate()); 253 254 254 255 return produit; … … 263 264 requete = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 264 265 sql = "select distinct valeurs_grille, date_grille from grille where id_produit = " + id_produit + " and date_grille >= '" + date_debut + "' and date_grille <= '" + date_fin + "' order by date_grille;"; 265 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::requete :: " + sql);266 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::requete :: " + sql); 266 267 ResultSet resultat = requete.executeQuery(sql); 267 268 … … 270 271 } 271 272 272 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::taille::"+liste_param.size() + "id_produit::" + id_produit);273 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::taille::"+liste_param.size() + "id_produit::" + id_produit); 273 274 return liste_param; 274 275 } 275 276 276 277 public List<Secteur> getListSectorByParam(int id_param) throws SQLException { 278 Statement requete; 279 String sql; 280 List<Secteur> liste_secteur = new LinkedList<Secteur>(); 281 282 requete = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 283 sql = "select id_secteur, fullname_secteur, id_categorieparametre from secteur; "; 284 285 ResultSet resultat = requete.executeQuery(sql); 286 287 while (resultat.next()) { 288 liste_secteur.add(new Secteur(resultat.getInt("id_secteur"), resultat.getString("fullname_secteur"))); 289 } 290 291 //LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListSecteur::taille::"+liste_secteur.size()); 292 return liste_secteur; 293 294 } 277 295 278 296 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/ServicePersistance.java
r68 r70 1 1 package org.medias.eccad.persistance; 2 2 3 import java.util.ArrayList; 3 4 import java.util.List; 4 5 5 6 import org.medias.eccad.helpers.LoggerPerso;7 6 import org.medias.eccad.helpers.SpringBeanFactory; 8 7 import org.medias.eccad.modele.*; … … 10 9 import org.medias.eccad.persistance.dao.MappingDAO; 11 10 import org.medias.eccad.persistance.dao.ParametreDAO; 11 import org.medias.eccad.persistance.dao.RcpDAO; 12 import org.medias.eccad.persistance.dao.SecteurDAO; 12 13 import org.medias.eccad.persistance.dao.CatParametreDAO; 13 14 import org.medias.eccad.persistance.dao.ProduitDAO; 14 15 import org.medias.eccad.persistance.exception.PersistanceException; 15 import org.medias.eccad.persistance.jdbc.CatParametreDAOjdbc;16 16 import org.springframework.beans.factory.xml.XmlBeanFactory; 17 17 … … 21 21 22 22 public ServicePersistance() { 23 LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "création du service");23 // LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "création du service"); 24 24 xmlbean = SpringBeanFactory.getXmlFactory(); 25 25 } 26 26 27 27 public List<CatParametre> getListcatParametre() { 28 LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "load DAOCAT");28 // LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "load DAOCAT"); 29 29 List<CatParametre> liste_catParam; 30 30 CatParametreDAO catParamdao = (CatParametreDAO) xmlbean.getBean("catParametreDAO"); 31 31 try { 32 LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "try...!"); 33 liste_catParam = catParamdao.getListcatParametre(); 32 liste_catParam = catParamdao.getListcatParametre(); 34 33 35 34 } catch (PersistanceException e) { … … 67 66 } 68 67 68 public List<Secteur> getListSectorByParam(int id_param, int id_prod, int id_rcp) { 69 List<Secteur> liste_secteur; 70 SecteurDAO secteur = (SecteurDAO) xmlbean.getBean("secteurDAO"); 71 72 try { 73 liste_secteur = secteur.getListSectorByParam(id_param,id_prod,id_rcp); 74 } catch (PersistanceException e) { 75 e.printStackTrace(); 76 return null; 77 } 78 return liste_secteur; 79 } 80 81 public List<Secteur> getListSecteur() { 82 List<Secteur> liste_secteur; 83 SecteurDAO secteurdao = (SecteurDAO) xmlbean.getBean("secteurDAO"); 84 try { 85 liste_secteur = secteurdao.getListSecteur(); 86 } catch (PersistanceException e) { 87 e.printStackTrace(); 88 return null; 89 } 90 91 return liste_secteur; 92 } 93 94 public List<Rcp> getListRcpByParam(int id_param, int id_prod, int id_sector) { 95 List<Rcp> liste_rcp; 96 RcpDAO rcpdao = (RcpDAO) xmlbean.getBean("rcpDAO"); 97 98 try { 99 liste_rcp = rcpdao.getListRcpByParam(id_param,id_prod,id_sector); 100 } catch (PersistanceException e) { 101 e.printStackTrace(); 102 return null; 103 } 104 return liste_rcp; 105 } 106 69 107 public List<Produit> getListProductByParam(int id_param) { 70 108 List<Produit> liste_param; … … 91 129 } 92 130 93 LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "getProduitById::nom::"+ produit.getNom() + "::date::" + produit.getBeginDate());131 // LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "getProduitById::nom::"+ produit.getNom() + "::date::" + produit.getBeginDate()); 94 132 return produit; 95 133 } 96 134 97 public List<Grille> getListGrille(long id_produit, long id_parametre,String date_debut, String date_fin) { 135 public Secteur getSecteurByID(long id_secteur) { 136 Secteur secteur = null; 137 SecteurDAO secteurdao = (SecteurDAO) xmlbean.getBean("secteurDAO"); 138 139 try { 140 secteur = secteurdao.getSecteurById(id_secteur); 141 } catch (PersistanceException e) { 142 e.printStackTrace(); 143 return null; 144 } 145 146 // LoggerPerso.log(ServicePersistance.class, LoggerPerso.DEBUG, "getSecteurById::nom::"+ secteur.getNom()); 147 return secteur; 148 } 149 150 public Rcp getRcpByID(long id_rcp) { 151 Rcp rcp = null; 152 RcpDAO rcpdao = (RcpDAO) xmlbean.getBean("rcpDAO"); 153 154 try { 155 rcp = rcpdao.getRcpById(id_rcp); 156 } catch (PersistanceException e) { 157 e.printStackTrace(); 158 return null; 159 } 160 return rcp; 161 } 162 163 public List<Grille> getListGrille(long id_produit, long id_parametre, long id_secteur, long id_rcp, String date_debut, String date_fin, String nomProd, String legend, String typeProd) { 98 164 List<Grille> grille; 99 165 GrilleDAO grilledao = (GrilleDAO) xmlbean.getBean("grilleDAO"); 100 166 try { 101 grille = grilledao.getListGrille(id_produit, id_parametre, date_debut, date_fin);167 grille = grilledao.getListGrille(id_produit, id_parametre, id_secteur, id_rcp, date_debut, date_fin, nomProd, legend, typeProd); 102 168 } catch (PersistanceException e) { 103 169 e.printStackTrace(); … … 121 187 } 122 188 189 public List<String> getListAlt(long id_secteur, String date_debut) { 190 List<String> liste_alt; 191 GrilleDAO grilledao = (GrilleDAO) xmlbean.getBean("grilleDAO"); 192 try { 193 liste_alt = grilledao.getListAlt(id_secteur, date_debut); 194 } catch (PersistanceException e) { 195 e.printStackTrace(); 196 return null; 197 } 198 199 return liste_alt; 200 } 201 202 public List<Grille> getListMasques(String codifMasque) { 203 List<Grille> liste_reg; 204 GrilleDAO grilledao = (GrilleDAO) xmlbean.getBean("grilleDAO"); 205 try { 206 liste_reg = grilledao.getListMasques(codifMasque); 207 } catch (PersistanceException e) { 208 e.printStackTrace(); 209 return null; 210 } 211 212 return liste_reg; 213 } 214 123 215 public Parametre getParametreById(int id_param) { 124 216 Parametre param = null; … … 151 243 return mapping.getVisualisation(type_produit); 152 244 } 245 246 public String getTypeCodif(long idGrille) { 247 String typeCodif; 248 GrilleDAO grilledao = (GrilleDAO) xmlbean.getBean("grilleDAO"); 249 try { 250 typeCodif = grilledao.getTypeCodif(idGrille); 251 } catch (PersistanceException e) { 252 e.printStackTrace(); 253 return null; 254 } 255 return typeCodif; 256 } 257 258 public ArrayList<String> getDates(long idProduit, long idParametre, long idSecteur, long idRcp, String nomprod) { 259 ArrayList<String> dates; 260 GrilleDAO grilledao = (GrilleDAO) xmlbean.getBean("grilleDAO"); 261 try { 262 dates = grilledao.getDates(idProduit, idParametre, idSecteur, idRcp, nomprod); 263 } catch (PersistanceException e) { 264 e.printStackTrace(); 265 return null; 266 } 267 268 return dates; 269 } 153 270 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/dao/ColorTabDAO.java
r68 r70 8 8 9 9 public interface ColorTabDAO { 10 public abstract ColorTab getColorMapByID(long id ) throws PersistanceException;10 public abstract ColorTab getColorMapByID(long id, long idClass) throws PersistanceException; 11 11 public abstract ColorTab getColorMapByParam(int idparam) throws PersistanceException; 12 public abstract ColorTab getColorMapByGrille(long id_grille) throws PersistanceException; 13 public abstract List<ColorMap> getListColorTabByGrille(long id_grille) throws PersistanceException; 14 public abstract List<ColorMap> getListColorTab() throws PersistanceException; 15 public abstract List<ColorMap> getListColorMapDynamique() throws PersistanceException; 12 public abstract ColorTab getColorMapByGrille() throws PersistanceException; 13 public abstract List<ColorMap> getListColorTabByGrille() throws PersistanceException; 16 14 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/dao/FactoryDAO.java
r68 r70 4 4 public GrilleDAO getGrilleDAO(); 5 5 public ParametreDAO getParametreDAO(); 6 public SecteurDAO getSecteurDAO(); 6 7 public ProduitDAO getProduitDAO(); 7 8 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/dao/GrilleDAO.java
r68 r70 1 1 package org.medias.eccad.persistance.dao; 2 2 3 import java.util.ArrayList; 3 4 import java.util.List; 4 5 … … 7 8 8 9 public interface GrilleDAO { 9 public List<Grille> getListGrille(long id_produit,long id_parametre, String date_debut, String date_fin) throws PersistanceException;10 public List<Grille> getListGrille(long id_produit,long id_parametre, long id_secteur, long id_rcp, String date_debut, String date_fin, String nomProd, String legend, String typeProd) throws PersistanceException; 10 11 public List<Grille> getListGrille(long id_produit, String date_debut, String date_fin) throws PersistanceException; 12 public List<String> getListAlt(long id_secteur, String date_debut) throws PersistanceException; 13 public List<Grille> getListMasques(String codifMasque) throws PersistanceException; 11 14 public float[][] getGrilleValue(int oid) throws PersistanceException; 12 15 public String getCodification(long id_grille) throws PersistanceException; … … 16 19 public float getGrilleResolution(long id_grille) throws PersistanceException; 17 20 public float getProduitResolution(long id_produit) throws PersistanceException; 21 public String getTypeCodif(long idGrille) throws PersistanceException; 22 public ArrayList<String> getDates(long idProduit, long idParametre, long idSecteur, long idRcp, String nomProd) throws PersistanceException; 18 23 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/dummy/ColorTabDAOdummy.java
r68 r70 21 21 } 22 22 23 public ColorTab getColorMapByGrille( long oid) {23 public ColorTab getColorMapByGrille() { 24 24 ColorTab colortab = new ColorTab(); 25 25 colortab.setMin(min); … … 44 44 45 45 public ColorTab getColorMapByParam(int id_param) { 46 return getColorMapByGrille( 0);46 return getColorMapByGrille(); 47 47 } 48 48 49 public List<ColorMap> getListColorTabByGrille( long oid) throws PersistanceException {49 public List<ColorMap> getListColorTabByGrille() throws PersistanceException { 50 50 List<ColorMap> liste = new LinkedList<ColorMap>(); 51 51 … … 58 58 } 59 59 60 public List<ColorMap> getListColorTab() throws PersistanceException { 61 List<ColorMap> liste = new LinkedList<ColorMap>(); 62 63 return liste; 64 } 65 66 public ColorTab getColorMapByID(long id) throws PersistanceException { 60 public ColorTab getColorMapByID(long id, long idClass) throws PersistanceException { 67 61 // TODO Auto-generated method stub 68 62 return null; … … 73 67 return null; 74 68 } 75 76 77 69 78 70 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/dummy/GrilleDAOdummy.java
r68 r70 1 1 package org.medias.eccad.persistance.dummy; 2 2 3 import java.util.ArrayList; 3 4 import java.util.LinkedList; 4 5 import java.util.List; … … 20 21 return data; 21 22 } 22 public List<Grille> getListGrille(long id_produit,long id_parametre, String date_debut,23 String date_fin ) throws PersistanceException {23 public List<Grille> getListGrille(long id_produit,long id_parametre, long id_secteur, long id_rcp, String date_debut, 24 String date_fin, String nomProd, String legend, String typeProd) throws PersistanceException { 24 25 25 26 Grille grille; … … 104 105 return 0; 105 106 } 107 public String getTypeCodif(long idGrille) { 108 // TODO Auto-generated method stub 109 return null; 110 } 111 112 public ArrayList<String> getDates(long idProduit, long idParametre, 113 long idSecteur, long idRcp, String nomProd) 114 throws PersistanceException { 115 // TODO Auto-generated method stub 116 return null; 117 } 118 public List<String> getListAlt(long idSecteur, String dateDebut) 119 throws PersistanceException { 120 // TODO Auto-generated method stub 121 return null; 122 } 123 public List<Grille> getListMasques(String codifMasque) throws PersistanceException { 124 // TODO Auto-generated method stub 125 return null; 126 } 127 106 128 107 129 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/HibernateSGBD.java
r68 r70 5 5 6 6 /** 7 * Permet l'int éraction avec un système de gestion persistante de l'information7 * Permet l'intï¿œraction avec un systï¿œme de gestion persistante de l'information 8 8 * @author Jean PINAUD 9 9 * … … 14 14 15 15 /** 16 * D ébut de la transaction16 * Dï¿œbut de la transaction 17 17 * 18 18 */ 19 19 public void connexion() { 20 // //system.out.println("<<< Hibernate::Connexion >>>");21 20 session = HibernateUtil.currentSession(); 22 21 tx = session.beginTransaction(); … … 43 42 44 43 /** 45 * Constructeur par d éfaut44 * Constructeur par dï¿œfaut 46 45 * 47 46 */ -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/HibernateUtil.java
r68 r70 4 4 import org.hibernate.*; 5 5 import org.hibernate.cfg.*; 6 import org.medias.eccad.helpers.LoggerPerso;7 6 8 7 /** … … 24 23 public static Session currentSession() 25 24 throws HibernateException { 26 LoggerPerso.log(HibernateUtil.class, LoggerPerso.DEBUG, "-- connexion --");25 // LoggerPerso.log(HibernateUtil.class, LoggerPerso.DEBUG, "-- connexion --"); 27 26 try { 28 27 if (sessionFactory == null) { … … 30 29 } 31 30 } catch (HibernateException ex) { 32 throw new RuntimeException("Probl ème de configuration : "31 throw new RuntimeException("ProblÚme de configuration : " 33 32 + ex.getMessage(), ex); 34 33 } … … 50 49 public static void closeSession() 51 50 throws HibernateException { 52 LoggerPerso.log(HibernateUtil.class, LoggerPerso.DEBUG, "-- deconnexion --");51 // LoggerPerso.log(HibernateUtil.class, LoggerPerso.DEBUG, "-- deconnexion --"); 53 52 Session s = (Session) session.get(); 54 53 session.set(null); -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/XmlDAOhibernate.java
r68 r70 3 3 import java.util.List; 4 4 5 import org.medias.eccad.helpers.CharactereHelper;6 5 import org.medias.eccad.persistance.dao.XmlDAO; 7 6 import org.medias.eccad.persistance.hibernate.domaine.Produit; … … 10 9 11 10 public String getXmlByProduit(long id) { 12 List resultat;11 List<?> resultat; 13 12 Produit produitTO; 14 13 connexion(); -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Categorieparametre.java
r68 r70 14 14 15 15 // Fields 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 16 21 17 22 private int idCategorieparametre; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Code.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private int idCode; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Codification.java
r68 r70 12 12 13 13 // Fields 14 15 /** 16 * 17 */ 18 private static final long serialVersionUID = 1L; 14 19 15 20 private int idCodification; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Color.java
r68 r70 12 12 13 13 // Fields 14 15 /** 16 * 17 */ 18 private static final long serialVersionUID = 1L; 14 19 15 20 private int colId; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/ColorIndex.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private ColorIndexId id; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/ColorIndexId.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private int cmId; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Colormap.java
r68 r70 12 12 13 13 // Fields 14 15 /** 16 * 17 */ 18 private static final long serialVersionUID = 1L; 14 19 15 20 private int cmId; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Concerne.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private ConcerneId id; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/ConcerneId.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private int idProduit; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Contact.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private ContactId id; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/ContactId.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private int idProduit; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Domaine.java
r68 r70 14 14 15 15 // Fields 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 16 21 17 22 private int idDomaine; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Fichier.java
r68 r70 11 11 12 12 // Fields 13 14 /** 15 * 16 */ 17 private static final long serialVersionUID = 1L; 13 18 14 19 private int idFichier; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Fournit.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private FournitId id; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/FournitId.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private int idProduit; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Grille.java
r68 r70 2 2 3 3 // Generated 1 Juin 2007 15:03:29 by Hibernate Tools 3.2.0.beta7 4 5 import java.io.Serializable;6 import java.util.Date;7 4 8 5 /** … … 12 9 13 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 14 16 15 17 private int idGrille; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/LienpersonneId.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private int idMetadata; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Metadata.hbm.xml
r68 r70 24 24 <one-to-many class="org.medias.eccad.persistance.hibernate.domaine.Produit" /> 25 25 </set> 26 <set name="lienorganismes" inverse="true">27 <key>28 <column name="id_metadata" not-null="true" />29 </key>30 <one-to-many class="org.medias.eccad.persistance.hibernate.domaine.Lienorganisme" />31 </set>32 26 <set name="lienpersonnes" inverse="true"> 33 27 <key> -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Metadata.java
r68 r70 30 30 private Set<Produit> produits = new HashSet<Produit>(0); 31 31 32 private Set<Lienorganisme> lienorganismes = new HashSet<Lienorganisme>(0);33 34 32 private Set<Lienpersonne> lienpersonnes = new HashSet<Lienpersonne>(0); 35 33 … … 48 46 /** full constructor */ 49 47 public Metadata(int idMetadata, String nameMetadata, String dateMetadata, 50 String versionMetadata, Set<Produit> produits, 51 Set<Lienorganisme> lienorganismes, Set<Lienpersonne> lienpersonnes) { 48 String versionMetadata, Set<Produit> produits, Set<Lienpersonne> lienpersonnes) { 52 49 this.idMetadata = idMetadata; 53 50 this.nameMetadata = nameMetadata; … … 55 52 this.versionMetadata = versionMetadata; 56 53 this.produits = produits; 57 this.lienorganismes = lienorganismes;58 54 this.lienpersonnes = lienpersonnes; 59 55 } … … 70 66 valeur += "\n"; 71 67 valeur += XmlHelper.createNode("versionMetadata", versionMetadata); 72 valeur += "\n";73 valeur += XmlHelper.listToString("organismes", lienorganismes);74 68 valeur += "\n"; 75 69 valeur += XmlHelper.listToString("personnes", lienpersonnes); … … 124 118 } 125 119 126 public Set<Lienorganisme> getLienorganismes() {127 return this.lienorganismes;128 }129 130 public void setLienorganismes(Set<Lienorganisme> lienorganismes) {131 this.lienorganismes = lienorganismes;132 }133 134 120 public Set<Lienpersonne> getLienpersonnes() { 135 121 return this.lienpersonnes; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Organisme.hbm.xml
r68 r70 42 42 <one-to-many class="org.medias.eccad.persistance.hibernate.domaine.Fournit" /> 43 43 </set> 44 <set name="lienorganismes" inverse="true">45 <key>46 <column name="id_organisme" not-null="true" />47 </key>48 <one-to-many class="org.medias.eccad.persistance.hibernate.domaine.Lienorganisme" />49 </set>50 44 </class> 51 45 </hibernate-mapping> -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Organisme.java
r68 r70 14 14 15 15 // Fields 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 16 21 17 22 private int idOrganisme; … … 37 42 private Set<Fournit> fournits = new HashSet<Fournit>(0); 38 43 39 private Set<Lienorganisme> lienorganismes = new HashSet<Lienorganisme>(0);40 41 44 // Constructors 42 45 … … 55 58 String faxOrganisme, String urlOrganisme, String addressOrganisme, 56 59 String zipcodeOrganisme, String cityOrganisme, 57 String countryOrganisme, Set<Fournit> fournits, 58 Set<Lienorganisme> lienorganismes) { 60 String countryOrganisme, Set<Fournit> fournits) { 59 61 this.idOrganisme = idOrganisme; 60 62 this.fullnameOrganisme = fullnameOrganisme; … … 68 70 this.countryOrganisme = countryOrganisme; 69 71 this.fournits = fournits; 70 this.lienorganismes = lienorganismes;71 72 } 72 73 … … 194 195 } 195 196 196 public Set<Lienorganisme> getLienorganismes() {197 return this.lienorganismes;198 }199 200 public void setLienorganismes(Set<Lienorganisme> lienorganismes) {201 this.lienorganismes = lienorganismes;202 }203 204 197 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/ParamColor.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private ParamColorId id; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/ParamColorId.java
r68 r70 9 9 10 10 // Fields 11 12 /** 13 * 14 */ 15 private static final long serialVersionUID = 1L; 11 16 12 17 private int cmId; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Parametre.java
r68 r70 14 14 15 15 // Fields 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 16 21 17 22 private int idParam; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Personne.java
r68 r70 14 14 15 15 // Fields 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 16 21 17 22 private int idPersonne; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Produit.java
r68 r70 9 9 10 10 import org.medias.eccad.helpers.CharactereHelper; 11 import org.medias.eccad.helpers.LoggerPerso;12 11 import org.medias.eccad.helpers.XmlHelper; 13 12 … … 159 158 valeur += "<metadonnees>" + "\n"; 160 159 161 valeur += "<produit>" + "\n"; 162 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "produit");160 valeur += "<produit>" + "\n"; 161 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "produit"); 163 162 valeur += XmlHelper.createNode("idProduit", Integer.toString(idProduit)); 164 163 valeur += XmlHelper.createNode("titleProduit", titleProduit); … … 185 184 valeur += XmlHelper.createNode("headerProduit", headerProduit); 186 185 valeur += XmlHelper.createNode("versionProduit", versionProduit); 187 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "produit_origine");186 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "produit_origine"); 188 187 valeur += XmlHelper.objectToString(produitorig); 189 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "reference");188 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "reference"); 190 189 valeur += XmlHelper.listToString("referenceses", concernes); 191 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "fin produit");190 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "fin produit"); 192 191 valeur += "</produit>" + "\n"; 193 192 194 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "domaine");193 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "domaine"); 195 194 valeur += XmlHelper.objectToString(domaine); 196 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "typeproduit");195 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "typeproduit"); 197 196 valeur += XmlHelper.objectToString(typeproduit); 198 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "metadata_produit");197 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "metadata_produit"); 199 198 valeur += XmlHelper.objectToString(metadata); 200 199 201 200 //valeur += "<fichiers>" + listToString(fichiers) + "</fichiers>" + "\n"; 202 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "organismes");201 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "organismes"); 203 202 valeur += XmlHelper.listToString("organismes", fournits); 204 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "parametre");203 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "parametre"); 205 204 valeur += XmlHelper.listToString("parametre", grilles, 1) + "\n"; 206 205 //valeur += "<requetes>" + listToString(requetes) + "</requetes>" + "\n"; 207 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "contacts");206 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "contacts"); 208 207 valeur += XmlHelper.listToString("contacts", contacts); 209 208 valeur += "</metadonnees>" + "\n"; 210 209 211 210 valeur = CharactereHelper.getEncodage(valeur, "ISO-8859-1"); 212 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "replace all");211 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "replace all"); 213 212 valeur = valeur.replaceAll("&", "&"); 214 LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "fin retour valeur");213 // LoggerPerso.log(Produit.class, LoggerPerso.DEBUG, "fin retour valeur"); 215 214 return valeur; 216 215 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Produitorig.hbm.xml
r68 r70 15 15 <column name="title_produitorig" length="128" unique="true" /> 16 16 </property> 17 <property name="orgProduitorig" type="string"> 18 <column name="org_produitorig" length="128" /> 19 </property> 20 <property name="dateProduitorig" type="date"> 21 <column name="date_produitorig" length="4" /> 17 <property name="dateProduitorig" type="string"> 18 <column name="date_produitorig" length="128" /> 22 19 </property> 23 20 <property name="editionProduitorig" type="string"> 24 21 <column name="edition_produitorig" length="128" /> 25 22 </property> 26 <property name="begintimeProduitorig" type=" date">27 <column name="begintime_produitorig" length=" 4" />23 <property name="begintimeProduitorig" type="string"> 24 <column name="begintime_produitorig" length="128" /> 28 25 </property> 29 <property name="endtimeProduitorig" type=" date">30 <column name="endtime_produitorig" length=" 4" />26 <property name="endtimeProduitorig" type="string"> 27 <column name="endtime_produitorig" length="128" /> 31 28 </property> 32 29 <property name="earthellipsProduitorig" type="string"> … … 38 35 <property name="spatialresProduitorig" type="string"> 39 36 <column name="spatialres_produitorig" length="128" /> 40 </property>41 <property name="projectionProduitorig" type="string">42 <column name="projection_produitorig" length="128" />43 37 </property> 44 38 <property name="methodProduitorig" type="string"> -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Produitorig.java
r68 r70 3 3 // Generated 1 Juin 2007 15:03:29 by Hibernate Tools 3.2.0.beta7 4 4 5 import java.util.Date;6 5 import java.util.HashSet; 7 6 import java.util.Set; … … 16 15 // Fields 17 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 21 18 22 private int idProduitorig; 19 23 … … 22 26 private String titleProduitorig; 23 27 24 private String orgProduitorig; 25 26 private Date dateProduitorig; 28 private String dateProduitorig; 27 29 28 30 private String editionProduitorig; 29 31 30 private DatebegintimeProduitorig;31 32 private DateendtimeProduitorig;32 private String begintimeProduitorig; 33 34 private String endtimeProduitorig; 33 35 34 36 private String earthellipsProduitorig; … … 37 39 38 40 private String spatialresProduitorig; 39 40 private String projectionProduitorig;41 41 42 42 private String methodProduitorig; … … 61 61 /** full constructor */ 62 62 public Produitorig(int idProduitorig, Domaine domaine, 63 String titleProduitorig, String orgProduitorig,64 DatedateProduitorig, String editionProduitorig,65 Date begintimeProduitorig, DateendtimeProduitorig,63 String titleProduitorig, 64 String dateProduitorig, String editionProduitorig, 65 String begintimeProduitorig, String endtimeProduitorig, 66 66 String earthellipsProduitorig, String temporalresProduitorig, 67 String spatialresProduitorig, String projectionProduitorig,67 String spatialresProduitorig, 68 68 String methodProduitorig, String dataurlProduitorig, 69 69 String documentationProduitorig, Set<Produit> produits) { … … 71 71 this.domaine = domaine; 72 72 this.titleProduitorig = titleProduitorig; 73 this.orgProduitorig = orgProduitorig;74 73 this.dateProduitorig = dateProduitorig; 75 74 this.editionProduitorig = editionProduitorig; … … 79 78 this.temporalresProduitorig = temporalresProduitorig; 80 79 this.spatialresProduitorig = spatialresProduitorig; 81 this.projectionProduitorig = projectionProduitorig;82 80 this.methodProduitorig = methodProduitorig; 83 81 this.dataurlProduitorig = dataurlProduitorig; … … 95 93 valeur += XmlHelper.createNode("titleProduitorig", titleProduitorig); 96 94 valeur += XmlHelper.objectToString(domaine); 97 valeur += XmlHelper.createNode("orgProduitorig", orgProduitorig);98 95 valeur += XmlHelper.createNode("dateProduitorig", dateProduitorig); 99 96 valeur += XmlHelper.createNode("editionProduitorig", editionProduitorig); … … 103 100 valeur += XmlHelper.createNode("temporalresProduitorig", temporalresProduitorig); 104 101 valeur += XmlHelper.createNode("spatialresProduitorig", spatialresProduitorig); 105 valeur += XmlHelper.createNode("projectionProduitorig", projectionProduitorig);106 102 valeur += XmlHelper.createNode("methodProduitorig", methodProduitorig); 107 103 valeur += XmlHelper.createNode("dataurlProduitorig", dataurlProduitorig); … … 112 108 valeur += "<domaine>" + domaine + "</domaine>" + "\n"; 113 109 valeur += "<titleProduitorig>" + titleProduitorig + "</titleProduitorig>" + "\n"; 114 valeur += "<orgProduitorig>" + orgProduitorig + "</orgProduitorig>" + "\n";115 110 valeur += "<dateProduitorig>" + dateProduitorig + "</dateProduitorig>" + "\n"; 116 111 valeur += "<editionProduitorig>" + editionProduitorig + "</editionProduitorig>" + "\n"; … … 120 115 valeur += "<temporalresProduitorig>" + temporalresProduitorig + "</temporalresProduitorig>" + "\n"; 121 116 valeur += "<spatialresProduitorig>" + spatialresProduitorig + "</spatialresProduitorig>" + "\n"; 122 valeur += "<projectionProduitorig>" + projectionProduitorig + "</projectionProduitorig>" + "\n";123 117 valeur += "<methodProduitorig>" + methodProduitorig + "</methodProduitorig>" + "\n"; 124 118 valeur += "<dataurlProduitorig>" + dataurlProduitorig + "</dataurlProduitorig>" + "\n"; … … 155 149 } 156 150 157 public String getOrgProduitorig() { 158 return this.orgProduitorig; 159 } 160 161 public void setOrgProduitorig(String orgProduitorig) { 162 this.orgProduitorig = orgProduitorig; 163 } 164 165 public Date getDateProduitorig() { 151 public String getDateProduitorig() { 166 152 return this.dateProduitorig; 167 153 } 168 154 169 public void setDateProduitorig( DatedateProduitorig) {155 public void setDateProduitorig(String dateProduitorig) { 170 156 this.dateProduitorig = dateProduitorig; 171 157 } … … 179 165 } 180 166 181 public DategetBegintimeProduitorig() {167 public String getBegintimeProduitorig() { 182 168 return this.begintimeProduitorig; 183 169 } 184 170 185 public void setBegintimeProduitorig( DatebegintimeProduitorig) {171 public void setBegintimeProduitorig(String begintimeProduitorig) { 186 172 this.begintimeProduitorig = begintimeProduitorig; 187 173 } 188 174 189 public DategetEndtimeProduitorig() {175 public String getEndtimeProduitorig() { 190 176 return this.endtimeProduitorig; 191 177 } 192 178 193 public void setEndtimeProduitorig( DateendtimeProduitorig) {179 public void setEndtimeProduitorig(String endtimeProduitorig) { 194 180 this.endtimeProduitorig = endtimeProduitorig; 195 181 } … … 219 205 } 220 206 221 public String getProjectionProduitorig() {222 return this.projectionProduitorig;223 }224 225 public void setProjectionProduitorig(String projectionProduitorig) {226 this.projectionProduitorig = projectionProduitorig;227 }228 229 207 public String getMethodProduitorig() { 230 208 return this.methodProduitorig; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Requete.java
r68 r70 11 11 12 12 // Fields 13 14 /** 15 * 16 */ 17 private static final long serialVersionUID = 1L; 13 18 14 19 private int idRequete; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Typecodification.java
r68 r70 12 12 13 13 // Fields 14 15 /** 16 * 17 */ 18 private static final long serialVersionUID = 1L; 14 19 15 20 private int idTypecodification; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Typeproduit.java
r68 r70 14 14 15 15 // Fields 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 16 21 17 22 private int idTypeproduit; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/domaine/Unite.java
r68 r70 14 14 15 15 // Fields 16 17 /** 18 * 19 */ 20 private static final long serialVersionUID = 1L; 16 21 17 22 private int idUnite; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/CatParametreDAOjdbc.java
r68 r70 8 8 import java.util.List; 9 9 10 import org.medias.eccad.helpers.LoggerPerso;11 10 import org.medias.eccad.modele.CatParametre; 12 11 import org.medias.eccad.persistance.dao.CatParametreDAO; … … 33 32 conn = getConnection(); 34 33 35 try { LoggerPerso.log(CatParametreDAOjdbc.class, LoggerPerso.DEBUG, "DAOjdbc youhou!!");34 try { 36 35 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 37 sql = "select distinct id_categorieparametre, fullname_categorieparametre from categorieparametre join parametre using (id_categorieparametre) join grille using (id_param);"; 38 36 // sql = "select distinct id_categorieparametre, fullname_categorieparametre, order_categorieparametre" + 37 // " from categorieparametre join parametre using (id_categorieparametre)" + 38 // " join grille using (id_param) order by order_categorieparametre;"; 39 sql = "select distinct id_categorieparametre, fullname_categorieparametre" + 40 ", order_categorieparametre from categorieparametre" + 41 " where id_categorieparametre in (select id_categorieparametre from parametre" + 42 " where id_param in (select id_param from grille)) order by order_categorieparametre;"; 39 43 resultat = requete.executeQuery(sql); 40 44 … … 51 55 } 52 56 53 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListCatParametre::taille::"+liste_catParam.size());57 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListCatParametre::taille::"+liste_catParam.size()); 54 58 55 59 return liste_catParam; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/CodeDAOjdbc.java
r68 r70 21 21 try { 22 22 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 23 sql = " select legend_code" 24 + " from grille join codification using (id_codification)" 25 + " join code using (id_codification) where id_grille = " + id_grille + " order by id_code;"; 26 23 // sql = " select num_code,legend_code" 24 // + " from grille join codification using (id_codification)" 25 // + " join code using (id_codification) where id_grille = " + id_grille + " order by num_code;"; 26 sql = " select number_code,legend_code" 27 + " from grille left join code on id_grille = num_code" 28 + " where id_grille = " + id_grille + " order by number_code;"; 29 27 30 ResultSet resultat = requete.executeQuery(sql); 28 31 String legend = ""; 29 32 while (resultat.next()) { 30 code.add(resultat.getString("legend_code").toLowerCase()); 33 legend = resultat.getString("legend_code"); 34 code.add(resultat.getString("number_code")+"-"+legend); 35 } 36 if (code.size() == 1) { 37 code.set(0, "1-"+legend); 31 38 } 32 39 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/ColorTabDAOjdbc.java
r68 r70 9 9 import java.util.List; 10 10 11 12 import org.medias.eccad.helpers.LoggerPerso;13 11 import org.medias.eccad.modele.ColorMap; 14 12 import org.medias.eccad.modele.ColorTab; … … 17 15 18 16 public class ColorTabDAOjdbc extends GeneriqueDAOjdbc implements ColorTabDAO { 19 20 21 22 23 public ColorTab getColorMapByGrille(long id_grille) throws PersistanceException { 17 18 public ColorTab getColorMapByGrille() throws PersistanceException { 24 19 ColorTab colortab = new ColorTab(); 25 colortab = getTableDefault( id_grille,colortab);20 colortab = getTableDefault(colortab); 26 21 //colortab = getMinMax(oid, colortab); 27 22 … … 29 24 } 30 25 31 public List<ColorMap> getListColorTab() throws PersistanceException { 32 String sql = " select cm_name, " 33 + " from colormap " 34 + " order by cm_id;"; 35 //+ " join grille using (id_param) " 36 37 38 Statement requete = null; 39 ResultSet resultat = null; 40 Connection conn = getConnection(); 41 42 LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, " récupération liste de colortab " + sql); 26 public List<ColorMap> getListClassMap() throws PersistanceException { 27 String sql = " select clm_id, clm_name, num_order from class_map order by clm_id"; 28 29 Statement requete = null; 30 ResultSet resultat = null; 31 Connection conn = getConnection(); 32 33 // LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, " récupération liste de colortab " + sql); 43 34 44 35 try { … … 54 45 try { 55 46 while (resultat.next()) { 56 liste_colormap.add(new ColorMap(resultat.getLong("c m_id"), resultat.getString("cm_name"), resultat.getInt("pc_defaut")));47 liste_colormap.add(new ColorMap(resultat.getLong("clm_id"), resultat.getString("clm_name"), resultat.getInt("num_order"))); 57 48 } 58 49 } … … 67 58 } 68 59 69 public List<ColorMap> getListColorTabByGrille( long id_grille) throws PersistanceException {70 String sql = " select distinct cm_id, cm_name, pc_defaut"60 public List<ColorMap> getListColorTabByGrille() throws PersistanceException { 61 /*String sql = " select distinct cm_id, cm_name, pc_defaut" 71 62 + " from colormap join param_color using (cm_id) " 72 63 + " join grille using (id_param) " 73 + " where id_grille = " + id_grille + " order by pc_defaut desc;"; 74 75 Statement requete = null; 76 ResultSet resultat = null; 77 Connection conn = getConnection(); 78 79 LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, " récupération liste de colortab " + sql); 64 + " where id_grille = " + id_grille + " order by pc_defaut desc;";*/ 65 66 String sql = " select clm_id as cm_id, clm_name as cm_name, num_order as pc_defaut from class_map order by clm_id"; 67 68 Statement requete = null; 69 ResultSet resultat = null; 70 Connection conn = getConnection(); 71 72 // LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, " récupération liste de colortab " + sql); 80 73 81 74 try { … … 104 97 } 105 98 106 private ColorTab getTableDefault( long id_grille,ColorTab colortab) throws PersistanceException {107 Statement requete = null; 108 String sql = " select distinct col_r, col_g, col_b, ci_min, ci_max"99 private ColorTab getTableDefault(ColorTab colortab) throws PersistanceException { 100 Statement requete = null; 101 /*String sql = " select distinct col_r, col_g, col_b, ci_min, ci_max" 109 102 + " from color join color_index using (col_id)" 110 103 + " join param_color using (cm_id) " 111 104 + " join grille using (id_param) " 112 + " where id_grille = " + id_grille +" and pc_defaut = 1 order by ci_max;"; 113 Connection conn = getConnection(); 114 115 ResultSet resultat = null; 116 117 118 LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, "*************************************REQUETE = " + sql); 105 + " where id_grille = " + id_grille +" and pc_defaut = 1 order by ci_max;";*/ 106 107 String sql = " select distinct col_r, col_g, col_b, class_index.num_order" 108 + " from color join class_index using (col_id)" 109 + " join class_map using (clm_id) " 110 + " where class_map.num_order=1 order by class_index.num_order;"; 111 Connection conn = getConnection(); 112 113 ResultSet resultat = null; 114 115 // LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, "*************************************REQUETE = " + sql); 119 116 try { 120 117 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); … … 129 126 int i=0; 130 127 131 128 float ci_min=-1; 129 float ci_max=0; 132 130 133 131 try { 134 132 while (resultat.next()) { 135 133 liste_couleur.add(new Color(resultat.getInt("col_r"), resultat.getInt("col_g"), resultat.getInt("col_b"))); 136 liste_min.add(resultat.getFloat("ci_min")); 137 colortab.setMax(resultat.getFloat("ci_max")); 134 //liste_min.add(resultat.getFloat("ci_min")); 135 //colortab.setMax(resultat.getFloat("ci_max")); 136 137 liste_min.add(ci_min); 138 colortab.setMax(ci_max); 139 140 if (ci_min==-1) ci_min=0; 141 else ci_min=ci_min+10; 142 143 ci_max=ci_max+10; 138 144 i++; 139 145 } … … 164 170 } 165 171 166 public ColorTab getColorMapByID(long id ) throws PersistanceException {172 public ColorTab getColorMapByID(long id, long idClass) throws PersistanceException { 167 173 Statement requete = null; 168 174 ColorTab colortab = new ColorTab(); 169 175 170 String sql = " select distinct col_r, col_g, col_b, ci_min, ci_max, cm_name"176 /*String sql = " select distinct col_r, col_g, col_b, ci_min, ci_max, cm_name" 171 177 + " from color join color_index using (col_id) join colormap using (cm_id)" 172 + " where cm_id = " + id +" order by ci_min;"; 173 Connection conn = getConnection(); 174 175 ResultSet resultat = null; 176 177 178 LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, "REQUETE = " + sql); 178 + " where cm_id = " + id +" order by ci_min;";*/ 179 180 String sql="select distinct col_r, col_g, col_b, clm_name as cm_name, ci.num_order, val_min, val_max" 181 +" from color as co, class_index as ci, class_map as cm, class_distribution as cd" 182 +" where co.col_id=ci.col_id and ci.clm_id=cm.clm_id and cm.clm_id="+id+" and cd.scl_id="+idClass 183 +" and cd.num_order=ci.num_order order by ci.num_order;"; 184 Connection conn = getConnection(); 185 186 ResultSet resultat = null; 187 188 // LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, "REQUETE = " + sql); 179 189 try { 180 190 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); … … 189 199 int i=0; 190 200 191 192 193 try { 194 201 try { 195 202 while (resultat.next()) { 196 203 colortab.setName(resultat.getString("cm_name")); 197 204 liste_couleur.add(new Color(resultat.getInt("col_r"), resultat.getInt("col_g"), resultat.getInt("col_b"))); 198 liste_min.add(resultat.getFloat("ci_min")); 199 colortab.setMax(resultat.getFloat("ci_max")); 205 liste_min.add(resultat.getFloat("val_min")); 206 colortab.setMax(resultat.getFloat("val_max")); 207 // LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, "NAME="+resultat.getString("cm_name")+", RANGE = " +resultat.getFloat("val_min")+" - "+resultat.getFloat("val_max")); 200 208 i++; 201 209 } … … 221 229 } 222 230 223 public List<ColorMap> getListColorMapDynamique() throws PersistanceException {231 /* public List<ColorMap> getListColorMapDynamique() throws PersistanceException { 224 232 String sql = " select distinct clm_id, clm_name" 225 + " from class_map " 226 + " where clm_name ilike '%exponential%' or clm_name ilike '%linear%' or clm_name ilike '%logarithm%' order by clm_name;"; 227 228 229 230 Statement requete = null; 231 ResultSet resultat = null; 232 Connection conn = getConnection(); 233 234 LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, " récupération liste de colortab " + sql); 233 + " from class_map order by clm_id"; 234 //+ " where clm_name like '%exponential%' or clm_name like '%linear%' or clm_name like '%logarithm%' order by clm_name;"; 235 236 237 Statement requete = null; 238 ResultSet resultat = null; 239 Connection conn = getConnection(); 240 241 // LoggerPerso.log(ColorTabDAOjdbc.class, LoggerPerso.DEBUG, " récupération liste de colortab " + sql); 235 242 236 243 try { … … 246 253 try { 247 254 while (resultat.next()) { 248 liste_colormap.add(new ColorMap(resultat.getLong("c m_id"), resultat.getString("cm_name"), 0));255 liste_colormap.add(new ColorMap(resultat.getLong("clm_id"), resultat.getString("clm_name"), 0)); 249 256 } 250 257 } … … 257 264 258 265 return liste_colormap; 259 } 266 }*/ 260 267 261 268 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/FactoryDAOjdbc.java
r68 r70 4 4 import org.medias.eccad.persistance.dao.GrilleDAO; 5 5 import org.medias.eccad.persistance.dao.ParametreDAO; 6 import org.medias.eccad.persistance.dao.SecteurDAO; 6 7 import org.medias.eccad.persistance.dao.ProduitDAO; 7 8 … … 24 25 return new ParametreDAOjdbc(sgbd); 25 26 } 27 28 public SecteurDAO getSecteurDAO() { 29 return new SecteurDAOjdbc(sgbd); 30 } 26 31 27 32 public ProduitDAO getProduitDAO() { -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/GeneriqueDAOjdbc.java
r68 r70 4 4 import java.sql.SQLException; 5 5 6 7 import org.medias.eccad.helpers.LoggerPerso;8 6 import org.medias.eccad.persistance.exception.PersistanceException; 9 7 … … 40 38 throw new PersistanceException(sqle, "impossible de se connecter au sgbd :: ParametreDAOjdbc.getListParametre"); 41 39 } 42 LoggerPerso.log(GeneriqueDAOjdbc.class, LoggerPerso.DEBUG, "-- jdbc connexion -- ");43 40 return conn; 44 41 } 45 42 46 43 protected void closeConnection() { 47 LoggerPerso.log(GeneriqueDAOjdbc.class, LoggerPerso.DEBUG, "-- jdbc deconnexion -- ");48 44 sgbd.deconnexion(); 49 45 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/GrilleDAOjdbc.java
r68 r70 2 2 3 3 import java.sql.Connection; 4 import java.sql.Date; 4 5 import java.sql.ResultSet; 5 6 import java.sql.SQLException; 6 7 import java.sql.Statement; 8 import java.util.ArrayList; 9 import java.util.Collections; 7 10 import java.util.LinkedList; 8 11 import java.util.List; 9 12 10 11 13 import org.medias.eccad.helpers.Donnees; 12 import org.medias.eccad.helpers.LoggerPerso;13 14 import org.medias.eccad.modele.Grille; 14 15 import org.medias.eccad.persistance.jdbc.SGBD_jdbc; … … 28 29 } 29 30 30 public List<Grille> getListGrille(long id_produit,long id_parametre, String date_debut, String date_fin) throws PersistanceException{ 31 public List<Grille> getListGrille(long id_produit,long id_parametre, long id_secteur, long id_rcp, String date_debut, String date_fin, String nomProd, String legend, String typeProd) throws PersistanceException{ 32 Statement requete; 33 String sql; 34 List<Grille> liste_gril = new LinkedList<Grille>(); 35 Connection conn = getConnection(); 36 37 try { 38 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 39 sql = "select distinct date_grille, id_grille, legend_code, number_code" + 40 " from grille" + 41 " left join code on ((id_grille = num_code) and (grille.id_codification = code.id_codification))" + 42 " where id_produit = "+id_produit+" and id_param = "+id_parametre; 43 if (nomProd.equals("IPCC")) { 44 if (id_secteur > 0) { 45 sql+=" and id_secteur="+id_secteur; 46 } 47 if (id_rcp > 0 ) { 48 sql+=" and id_rcp="+id_rcp; 49 } else { 50 sql+=" and id_rcp is null"; 51 } 52 if (legend != null) { 53 sql+=" and legend_code = '"+legend+"'"; 54 } 55 } 56 if (date_debut != null) { 57 sql += " and date_grille >= '" + date_debut + "' and date_grille <= '" + date_fin + "'"; 58 if (typeProd.equals("monoplan")) { 59 sql += " order by id_grille, number_code"; 60 } else { 61 sql += " order by date_grille, number_code"; 62 } 63 } else { 64 sql += " order by id_grille"; 65 } 66 sql += ";"; 67 //LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::requete grille :: " + sql); 68 ResultSet resultat = requete.executeQuery(sql); 69 70 Date date; 71 long idGrille, idGrillePrec = 0; 72 String datePrec = ""; 73 int numberCode; 74 // NB: On ne stocke qu'une seule grille : 75 // - par plan (dans le cas d'un produit multiplan) 76 // - par date (dans le cas d'un produit temporel) 77 // - par masque (dans le cas d'un produit monoplan) 78 while (resultat.next()) { 79 date = resultat.getDate("date_grille"); 80 idGrille = resultat.getLong("id_grille"); 81 numberCode = resultat.getInt("number_code"); 82 if (typeProd.equals("multiplan") || 83 !date.toString().equals(datePrec) || 84 (typeProd.equals("monoplan") && idGrille != idGrillePrec)) { 85 // Cas monoplan: on place la grille contenant l'ensemble des masques en premiÚre position 86 // if (typeProd.equals("monoplan") && numberCode == 0) { 87 // liste_gril.add(0,new Grille(idGrille, date, resultat.getString("legend_code"),numberCode)); 88 // } else { 89 liste_gril.add(new Grille(idGrille, date, resultat.getString("legend_code"),numberCode)); 90 // } 91 } 92 datePrec = date.toString(); 93 idGrillePrec = idGrille; 94 } 95 // Pour un produit monoplan, on trie les grilles par numéro de code 96 if (typeProd.equals("monoplan")) { 97 Collections.sort(liste_gril,new Grille().new ComparatorNumberCode()); 98 } 99 } 100 catch (SQLException sqle) { 101 throw new PersistanceException(sqle, "erreur lors de l'execution de la requete :: GrilleDAOjdbc.getListGrille"); 102 } 103 finally { 104 closeConnection(); 105 } 106 //System.out.println("nbgrilles="+liste_gril.size()); 107 return liste_gril; 108 } 109 110 public List<Grille> getListGrille(long id_produit, String date_debut, String date_fin) throws PersistanceException{ 31 111 Statement requete; 32 112 String sql; … … 36 116 try { 37 117 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 38 sql = "select distinct id_grille, valeurs_grille, date_grille, legend_code from grille left join code on ((id_grille = num_code) and (grille.id_codification = code.id_codification)) where id_produit = " + id_produit+" and id_param = "+id_parametre; 118 sql = "select distinct id_grille, valeurs_grille, date_grille, legend_code, number_code from grille" + 119 // " inner join codification using (id_codification)" + 120 // " inner join type_codification using (id_typecodification)" + 121 " left join code on ((id_grille = num_code)" + 122 " and (grille.id_codification = code.id_codification)) where id_produit = " + id_produit; 123 // " inner join codification using (id_codification) left join code using (id_codification)" + 124 // " where id_produit = " + id_produit; 39 125 40 126 if (date_debut != null) 41 sql += " and date_grille >= '" + date_debut + "' and date_grille <= '" + date_fin + "' order by date_grille ";127 sql += " and date_grille >= '" + date_debut + "' and date_grille <= '" + date_fin + "' order by date_grille, number_code"; 42 128 else 43 sql += " order by id_grille";129 sql += " order by number_code, id_grille"; 44 130 45 131 sql += ";"; 46 132 47 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::requete :: " + sql);133 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille2::requete :: " + sql); 48 134 ResultSet resultat = requete.executeQuery(sql); 49 135 50 136 while (resultat.next()) { 51 liste_param.add(new Grille(resultat.getLong("id_grille"), resultat.getDate("date_grille"), resultat.getString("legend_code") ));137 liste_param.add(new Grille(resultat.getLong("id_grille"), resultat.getDate("date_grille"), resultat.getString("legend_code"), resultat.getInt("number_code"))); 52 138 } 53 139 } … … 58 144 closeConnection(); 59 145 } 60 61 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::taille::"+liste_param.size() + "id_produit::" + id_produit);146 147 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::taille::"+liste_param.size() + "id_produit::" + id_produit); 62 148 return liste_param; 63 149 } 64 150 65 66 67 public List<Grille> getListGrille(long id_produit, String date_debut, String date_fin) throws PersistanceException{ 68 Statement requete; 69 String sql; 70 List<Grille> liste_param = new LinkedList<Grille>(); 71 Connection conn = getConnection(); 72 73 try { 74 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 75 sql = "select distinct id_grille, valeurs_grille, date_grille, legend_code from grille left join code on ((id_grille = num_code) and (grille.id_codification = code.id_codification)) where id_produit = " + id_produit; 76 151 public List<String> getListAlt(long id_secteur, String date_debut) throws PersistanceException{ 152 Statement requete; 153 String sql; 154 List<String> liste_alt = new LinkedList<String>(); 155 Connection conn = getConnection(); 156 157 try { 158 // On récupÚre les altitudes 159 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 160 //sql = "select distinct cast(legend_code as decimal) as altitude from grille" + 161 sql = "select distinct legend_code, number_code from grille" + 162 " left join code on ((id_grille = num_code) and (grille.id_codification = code.id_codification))" + 163 " where id_secteur = "+id_secteur; 77 164 if (date_debut != null) 78 sql += " and date_grille >= '" + date_debut + "' and date_grille <= '" + date_fin + "' order by date_grille"; 79 else 80 sql += " order by id_grille"; 81 82 sql += ";"; 83 84 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::requete :: " + sql); 85 ResultSet resultat = requete.executeQuery(sql); 86 165 sql += " and date_grille = '" + date_debut+"'"; 166 sql += " order by number_code;"; 167 ResultSet resultat = requete.executeQuery(sql); 87 168 while (resultat.next()) { 88 liste_param.add(new Grille(resultat.getLong("id_grille"), resultat.getDate("date_grille"), resultat.getString("legend_code"))); 89 } 90 } 91 catch (SQLException sqle) { 92 throw new PersistanceException(sqle, "erreur lors de l'execution de la requete :: GrilleDAOjdbc.getListGrille"); 93 } 94 finally { 95 closeConnection(); 96 } 97 98 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListGrille::taille::"+liste_param.size() + "id_produit::" + id_produit); 99 return liste_param; 100 } 101 102 103 169 liste_alt.add(resultat.getString("legend_code")); 170 } 171 } 172 catch (SQLException sqle) { 173 throw new PersistanceException(sqle, "erreur lors de l'execution de la requete :: GrilleDAOjdbc.getListAlt"); 174 } 175 finally { 176 closeConnection(); 177 } 178 return liste_alt; 179 } 180 181 public List<Grille> getListMasques(String codifMasque) throws PersistanceException{ 182 Statement requete; 183 String sql; 184 List<Grille> liste_reg = new LinkedList<Grille>(); 185 Connection conn = getConnection(); 186 187 try { 188 // On récupÚre les régions 189 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 190 sql = "select distinct legend_code, number_code, id_grille from grille" + 191 " inner join codification using (id_codification) left join code on (id_grille = num_code)" + 192 " where nom_codification = '"+codifMasque+"' order by id_grille, number_code;"; 193 ResultSet resultat = requete.executeQuery(sql); 194 long idGrille, idGrillePrec = 0; 195 while (resultat.next()) { 196 idGrille = resultat.getLong("id_grille"); 197 if (idGrille != idGrillePrec) { 198 liste_reg.add(new Grille(idGrille, null, resultat.getString("legend_code"),resultat.getInt("number_code"))); 199 } 200 idGrillePrec = idGrille; 201 } 202 Collections.sort(liste_reg,new Grille().new ComparatorNumberCode()); 203 } 204 catch (SQLException sqle) { 205 throw new PersistanceException(sqle, "erreur lors de l'execution de la requete :: GrilleDAOjdbc.getListAlt"); 206 } 207 finally { 208 closeConnection(); 209 } 210 return liste_reg; 211 } 104 212 105 213 public float[][] getGrilleValue(int oid) throws PersistanceException { … … 184 292 try { 185 293 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 186 sql = " select name_type Codification" +""294 sql = " select name_typecodification" 187 295 + " from grille join codification using (id_codification)" 188 296 + " join typecodification using (id_typeCodification) where id_grille = " + id_grille + ";"; 189 297 190 298 ResultSet resultat = requete.executeQuery(sql); 191 LoggerPerso.log(GrilleDAOjdbc.class, LoggerPerso.DEBUG, "getCodification :: " + sql);299 // LoggerPerso.log(GrilleDAOjdbc.class, LoggerPerso.DEBUG, "getCodification :: " + sql); 192 300 if (resultat.next()) { 193 301 codification = resultat.getString("name_typeCodification").toLowerCase(); … … 216 324 217 325 ResultSet resultat = requete.executeQuery(sql); 218 LoggerPerso.log(GrilleDAOjdbc.class, LoggerPerso.DEBUG, "getCodification :: " + sql);326 // LoggerPerso.log(GrilleDAOjdbc.class, LoggerPerso.DEBUG, "getCodification :: " + sql); 219 327 if (resultat.next()) { 220 328 date = resultat.getString("date_grille").toLowerCase(); … … 237 345 238 346 public Grille getGrille(long id_grille) throws PersistanceException { 239 String sql = "select * from grille where id_grille = " + id_grille + ";"; 347 348 String sql = "select * from grille"; 349 sql += " left join code on id_grille = num_code"; 350 sql += " where id_grille = " + id_grille + ";"; 240 351 Statement requete; 241 352 Connection conn = getConnection(); … … 252 363 grille.setId_param(resultat.getLong("id_param")); 253 364 grille.setId_produit(resultat.getLong("id_produit")); 365 grille.setId_secteur(resultat.getLong("id_secteur")); 366 grille.setId_rcp(resultat.getLong("id_rcp")); 367 grille.setLegend(resultat.getString("legend_code")); 254 368 } 255 369 } … … 275 389 if (resultat.next()) { 276 390 resol = (float)360/resultat.getLong("ncol_grille"); 277 resultat.getLong("nlign_grille");391 // resultat.getLong("nlign_grille"); 278 392 } 279 393 } … … 299 413 if (resultat.next()) { 300 414 resol = (float)360/resultat.getLong("ncol_grille"); 301 resultat.getLong("nlign_grille");415 // resultat.getLong("nlign_grille"); 302 416 } 303 417 } … … 310 424 return resol; 311 425 } 312 313 426 427 public String getTypeCodif(long idGrille) throws PersistanceException { 428 String sql = "select name_typecodification from grille" + 429 " inner join codification using (id_codification)" + 430 " inner join typecodification using (id_typecodification)" + 431 " where id_grille = " + idGrille + ";"; 432 Statement requete; 433 Connection conn = getConnection(); 434 String typeCodif = null; 435 try { 436 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 437 438 439 ResultSet resultat = requete.executeQuery(sql); 440 441 if (resultat.next()) { 442 typeCodif = resultat.getString("name_typecodification"); 443 } 444 } 445 catch (SQLException sqle) { 446 throw new PersistanceException(sqle, "getTypeCodif " + sql); 447 } 448 finally { 449 closeConnection(); 450 } 451 return typeCodif; 452 } 453 454 public ArrayList<String> getDates(long idProduit, long idParametre, long idSecteur, long idRcp, String nomProd) throws PersistanceException { 455 Statement requete; 456 String sql; 457 ArrayList<String> dates = new ArrayList<String>(); 458 Connection conn = getConnection(); 459 460 try { 461 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 462 // sql = "select min(date_grille) as min, max(date_grille) as max from grille" + 463 sql = "select min(date_grille) as min, (cast(max(date_grille+deltadate_grille) as date)-1) as max, min(deltadate_grille) as delta from grille" + 464 " where id_produit = "+idProduit+" and id_param = "+idParametre; 465 if (nomProd.equals("IPCC")) { 466 if (idSecteur > 0) { 467 sql+=" and id_secteur="+idSecteur; 468 } 469 if (idRcp > 0 ) { 470 sql+=" and id_rcp="+idRcp; 471 } else { 472 sql+=" and id_rcp is null"; 473 } 474 } 475 sql += ";"; 476 ResultSet resultat = requete.executeQuery(sql); 477 if (resultat.next()) { 478 dates.add(resultat.getDate("min").toString()); 479 dates.add(resultat.getDate("max").toString()); 480 dates.add(resultat.getString("delta")); 481 } 482 } 483 catch (SQLException sqle) { 484 throw new PersistanceException(sqle, "erreur lors de l'execution de la requete :: GrilleDAOjdbc.getDates"); 485 } 486 finally { 487 closeConnection(); 488 } 489 return dates; 490 } 314 491 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/ParametreDAOjdbc.java
r68 r70 9 9 import java.util.List; 10 10 11 12 import org.medias.eccad.helpers.LoggerPerso;13 11 import org.medias.eccad.modele.Parametre; 14 12 import org.medias.eccad.persistance.jdbc.SGBD_jdbc; … … 62 60 } 63 61 64 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListParametre::taille::"+liste_param.size());62 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListParametre::taille::"+liste_param.size()); 65 63 66 64 return liste_param; … … 84 82 try { 85 83 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 86 sql = "select distinct id_param, fullname_param, shortname_param, order_param from parametre join grille using (id_param) join produit using (id_produit) join typeproduit using (id_typeproduit) where id_categorieparametre= "+id_CatParam+" and name_typeproduit not ilike 'array' order by order_param;"; 87 84 // sql = "select distinct id_param, fullname_param, shortname_param, order_param from parametre" + 85 // " join grille using (id_param) join produit using (id_produit)" + 86 // " join typeproduit using (id_typeproduit)" + 87 // " where id_categorieparametre= "+id_CatParam+ 88 // " and name_typeproduit not ilike 'array' order by order_param;"; 89 sql = "select distinct id_param, fullname_param, shortname_param, order_param from parametre" + 90 " where id_param in (select id_param from grille join produit using (id_produit)" + 91 " join typeproduit using (id_typeproduit)" + 92 " where name_typeproduit not ilike 'array')" + 93 " and id_categorieparametre="+id_CatParam+" order by order_param;"; 88 94 resultat = requete.executeQuery(sql); 89 95 90 96 91 97 while (resultat.next()) { 92 if (resultat.getString("shortname_param").equals("NULL") )98 if (resultat.getString("shortname_param").equals("NULL") || resultat.getString("shortname_param").equals("")) 93 99 liste_param.add(new Parametre(resultat.getInt("id_param"), resultat.getString("fullname_param"))); 94 100 else … … 103 109 } 104 110 105 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListParametre::taille::"+liste_param.size());111 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListParametre::taille::"+liste_param.size()); 106 112 107 113 return liste_param; … … 126 132 try { 127 133 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 128 sql = "select distinct id_param, fullname_param, shortname_param, order_param, shortName_unite from parametre join unite using (id_unite) where id_param = " + id_param + " order by order_param;"; 129 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "sql getParametreById="+sql); 134 sql = "select distinct id_param, fullname_param, shortname_param, order_param, shortName_unite, clm_default_id, scl_default_id" + 135 " from parametre p" + 136 " inner join unite using (id_unite)" + 137 " where id_param = " + id_param + " order by order_param;"; 130 138 131 139 ResultSet resultat = requete.executeQuery(sql); 132 140 133 141 if (resultat.next()) { 134 param = new Parametre(resultat.getInt("id_param"), resultat.getString("fullname_param"), resultat.getString("shortname_param"),resultat.getString("order_param")); 142 param = new Parametre(resultat.getInt("id_param"), resultat.getString("fullname_param") 143 , resultat.getString("shortname_param"),resultat.getString("order_param")); 135 144 param.setUnite(resultat.getString("shortName_unite")); 145 param.setColormapDefault(resultat.getInt("clm_default_id")); 146 param.setClassdisDefault(resultat.getInt("scl_default_id")); 136 147 } 137 148 } … … 142 153 closeConnection(); 143 154 } 144 145 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom());155 156 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom()); 146 157 147 158 return param; … … 159 170 try { 160 171 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 161 sql = "select distinct id_param, fullname_param, shortname_param, order_param, short Name_unite from parametre join grille using (id_param) join unite using (id_unite) where id_grille = " + id_grille + " order by order_param;";172 sql = "select distinct id_param, fullname_param, shortname_param, order_param, shortname_unite from parametre join grille using (id_param) join unite using (id_unite) where id_grille = " + id_grille + " order by order_param;"; 162 173 163 174 ResultSet resultat = requete.executeQuery(sql); … … 168 179 String unite = null; 169 180 try { 170 temp = resultat.getString("short Name_unite").getBytes("ISO-8859-1");171 } catch (UnsupportedEncodingException e) { 181 temp = resultat.getString("shortname_unite").getBytes("ISO-8859-1"); 182 } catch (UnsupportedEncodingException e) {e.printStackTrace();} 172 183 173 184 if (temp != null) … … 182 193 closeConnection(); 183 194 } 184 185 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom());195 196 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom()); 186 197 187 198 return param; … … 213 224 closeConnection(); 214 225 } 215 216 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom());226 227 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getParametreById::nom::"+ param.getNom()); 217 228 218 229 return param; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/ProduitDAOjdbc.java
r68 r70 10 10 11 11 import org.medias.eccad.helpers.CharactereHelper; 12 import org.medias.eccad.helpers.LoggerPerso;13 12 import org.medias.eccad.modele.Produit; 14 13 import org.medias.eccad.persistance.jdbc.SGBD_jdbc; … … 34 33 try { 35 34 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 36 sql = "select distinct id_produit, title_produit, begintime_produit, endtime_produit, header_produit from produit join grille using (id_produit) where id_param = " + id_param + ";"; 37 35 sql = "select distinct id_produit, title_produit, begintime_produit, endtime_produit, header_produit, order_produit from produit join grille using (id_produit) where id_param = " + id_param + " order by order_produit;"; 38 36 ResultSet resultat = requete.executeQuery(sql); 39 37 … … 55 53 } 56 54 57 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListProduit::taille::"+liste_param.size()+"\nSQL::" + sql);58 55 return liste_param; 59 56 } … … 89 86 try { 90 87 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 91 sql = "select distinct id_produit, title_produit, begintime_produit, endtime_produit, header_produit, temporalRes_produit, name_typeproduit from produit join typeproduit using (id_typeproduit) where id_produit = " + id_produit + ";"; 88 sql = "select distinct id_produit, title_produit, begintime_produit" + 89 ", endtime_produit, header_produit, temporalRes_produit, name_typeproduit" + 90 ", textcitation_produit, useconst_produit, informpub_produit" + 91 " from produit join typeproduit using (id_typeproduit)" + 92 " where id_produit = " + id_produit + ";"; 92 93 93 94 ResultSet resultat = requete.executeQuery(sql); … … 101 102 produit.setTemporalres(CharactereHelper.getEncodage(resultat.getString("temporalRes_produit"), "ISO-8859-1")); 102 103 produit.setType(CharactereHelper.getEncodage(resultat.getString("name_typeproduit"), "ISO-8859-1")); 104 produit.setCitation(CharactereHelper.getEncodage(resultat.getString("textcitation_produit"), "ISO-8859-1")); 105 produit.setUseconst(CharactereHelper.getEncodage(resultat.getString("useconst_produit"), "ISO-8859-1")); 106 produit.setInformpub(CharactereHelper.getEncodage(resultat.getString("informpub_produit"), "ISO-8859-1")); 103 107 } 104 108 } … … 109 113 closeConnection(); 110 114 } 111 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getProduitById::nom::"+ produit.getNom() + "::date::" + produit.getBeginDate());115 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getProduitById::nom::"+ produit.getNom() + "::date::" + produit.getBeginDate()); 112 116 113 117 return produit; … … 122 126 try { 123 127 requete = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); 124 sql = "select distinct id_produit, title_produit, begintime_produit, endtime_produit, header_produit from produit join lienproduit using (id_produit) 128 sql = "select distinct id_produit, title_produit, begintime_produit, endtime_produit, header_produit from produit join lienproduit using (id_produit)"; 125 129 126 130 if (id_produit != null) { … … 149 153 } 150 154 151 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListProductByLink::taille::"+liste_produit.size());155 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "getListProductByLink::taille::"+liste_produit.size()); 152 156 return liste_produit; 153 157 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/jdbc/SGBD_jdbc.java
r68 r70 16 16 public SGBD_jdbc(InfoConnectBean n_info) { 17 17 con = null; 18 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "construction connection");18 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "construction connection"); 19 19 if (pooling == null) { 20 20 info = n_info; 21 LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "creation pooling :: " + info);21 // LoggerPerso.log(SGBD_jdbc.class, LoggerPerso.DEBUG, "creation pooling :: " + info); 22 22 pooling = new PGPoolingDataSource(); 23 23 pooling.setDatabaseName(info.getDb_name()); -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/test/MainTest.java
r68 r70 1 1 package org.medias.eccad.persistance.test; 2 2 3 import java.util.List;4 3 5 4 import org.medias.eccad.helpers.SpringBeanFactory; 6 import org.medias.eccad.modele.Grille;7 5 import org.medias.eccad.persistance.exception.PersistanceException; 8 6 import org.medias.eccad.persistance.jdbc.GrilleTestjdbc; … … 17 15 //system.out.println(System.currentTimeMillis()); 18 16 GrilleTestjdbc grilletest = (GrilleTestjdbc) SpringBeanFactory.getXmlFactory("test").getBean("grilleDAO"); 19 List<Grille> liste = grilletest.getListGrille(27,3, "2003-11-01", "2008-01-01");17 // List<Grille> liste = grilletest.getListGrille(27,3, "2003-11-01", "2008-01-01"); 20 18 //system.out.println(System.currentTimeMillis()); 21 19 //system.out.println(liste.size()); 22 20 grilletest.connection(); 23 21 24 for (Grille grille : liste) {22 // for (Grille grille : liste) { 25 23 //grilletest.getGrilleValue(grille.getOid()); 26 }24 // } 27 25 //system.out.println(System.currentTimeMillis()); 28 26 grilletest.disconnect(); -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/test/TestColorTabDAO.java
r68 r70 1 1 package org.medias.eccad.persistance.test; 2 3 import java.util.List;4 5 import org.medias.eccad.helpers.SpringBeanFactory;6 import org.medias.eccad.modele.ColorMap;7 import org.medias.eccad.modele.ColorTab;8 import org.medias.eccad.persistance.dao.CodeDAO;9 import org.medias.eccad.persistance.dao.ColorTabDAO;10 import org.medias.eccad.persistance.exception.PersistanceException;11 2 12 3 import junit.framework.TestCase; … … 19 10 20 11 public void testGetColorMapByGrille() { 21 ColorTabDAO colortabDAO = (ColorTabDAO) SpringBeanFactory.getXmlFactory("test").getBean("colorTabDAO");22 ColorTab colortab = null;23 try {24 colortab = colortabDAO.getColorMapByGrille(845767287);25 } catch (PersistanceException e) {12 // ColorTabDAO colortabDAO = (ColorTabDAO) SpringBeanFactory.getXmlFactory("test").getBean("colorTabDAO"); 13 // ColorTab colortab = null; 14 // try { 15 // colortab = colortabDAO.getColorMapByGrille(845767287); 16 // } catch (PersistanceException e) { 26 17 // TODO Auto-generated catch block 27 e.printStackTrace();28 }18 // e.printStackTrace(); 19 // } 29 20 //system.out.println(colortab.toString()); 30 21 } 31 22 32 23 public void testGetListColorMapByGrille() { 33 ColorTabDAO colortabDAO = (ColorTabDAO) SpringBeanFactory.getXmlFactory("test").getBean("colorTabDAO");34 List<ColorMap> colortab = null;35 try {36 colortab = colortabDAO.getListColorTabByGrille(10);37 } catch (PersistanceException e) {24 // ColorTabDAO colortabDAO = (ColorTabDAO) SpringBeanFactory.getXmlFactory("test").getBean("colorTabDAO"); 25 // List<ColorMap> colortab = null; 26 // try { 27 // colortab = colortabDAO.getListColorTabByGrille(10); 28 // } catch (PersistanceException e) { 38 29 // TODO Auto-generated catch block 39 e.printStackTrace();40 }30 // e.printStackTrace(); 31 // } 41 32 42 33 //system.out.println(colortab.size()); … … 45 36 46 37 public void testGetCode() { 47 CodeDAO codedao = (CodeDAO) SpringBeanFactory.getXmlFactory("test").getBean("codeDAO");48 List<String> codes = null;38 // CodeDAO codedao = (CodeDAO) SpringBeanFactory.getXmlFactory("test").getBean("codeDAO"); 39 // List<String> codes = null; 49 40 50 try {51 codes = codedao.getListCodeByGrille(845767287);52 } catch (PersistanceException e) {41 // try { 42 // codes = codedao.getListCodeByGrille(845767287); 43 // } catch (PersistanceException e) { 53 44 // TODO Auto-generated catch block 54 e.printStackTrace();55 }45 // e.printStackTrace(); 46 // } 56 47 //system.out.println(codes.toString()); 57 48 } -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/test/TestMetierDessin.java
r68 r70 1 1 package org.medias.eccad.persistance.test; 2 2 3 4 import org.medias.eccad.helpers.LoggerPerso;5 import org.medias.eccad.metier.ServiceMetier;6 import org.medias.eccad.modele.Zone;7 3 8 4 import junit.framework.TestCase; -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/test/TestPerformance.java
r68 r70 1 1 package org.medias.eccad.persistance.test; 2 2 3 import java.sql.Date;4 import java.util.GregorianCalendar;5 import java.util.List;6 7 3 import org.medias.eccad.helpers.SpringBeanFactory; 8 import org.medias.eccad.modele.Grille;9 4 import org.medias.eccad.persistance.exception.PersistanceException; 10 5 import org.medias.eccad.persistance.jdbc.GrilleTestjdbc; … … 23 18 //system.out.println(System.currentTimeMillis()); 24 19 GrilleTestjdbc grilletest = (GrilleTestjdbc) SpringBeanFactory.getXmlFactory("test").getBean("grilleDAO"); 25 List<Grille> liste = grilletest.getListGrille(27,3, "2003-11-01", "2008-01-01");20 // List<Grille> liste = grilletest.getListGrille(27,3, "2003-11-01", "2008-01-01"); 26 21 //system.out.println(System.currentTimeMillis()); 27 22 //system.out.println(liste.size()); 28 23 grilletest.connection(); 29 24 30 for (Grille grille : liste) {25 // for (Grille grille : liste) { 31 26 //grilletest.getGrilleValue(grille.getId_grille()); 32 }27 // } 33 28 //system.out.println(System.currentTimeMillis()); 34 29 grilletest.disconnect(); -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/test/TestServiceMetadata.java
r68 r70 1 1 package org.medias.eccad.persistance.test; 2 3 import org.medias.eccad.metier.ServiceMetadata;4 2 5 3 import junit.framework.TestCase; … … 13 11 14 12 public void testGetXMLTransformResult() { 15 ServiceMetadata service_meta = new ServiceMetadata();16 String xml = service_meta.getXmlMetadata(4);13 // ServiceMetadata service_meta = new ServiceMetadata(); 14 // String xml = service_meta.getXmlMetadata(4); 17 15 //system.out.println(xml); 18 16 //system.out.println(service_meta.getXMLTransformResult(xml, "metadata.xslt")); -
ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/test/TestXmlDAOhibernate.java
r68 r70 1 1 package org.medias.eccad.persistance.test; 2 2 3 import org.medias.eccad.persistance.dao.XmlDAO;4 import org.medias.eccad.persistance.hibernate.XmlDAOhibernate;5 3 6 4 import junit.framework.TestCase; … … 13 11 14 12 public void testGetXmlByProduit() { 15 XmlDAO xmldao = new XmlDAOhibernate();13 // XmlDAO xmldao = new XmlDAOhibernate(); 16 14 //system.out.println(xmldao.getXmlByProduit(4)); 17 15 }
Note: See TracChangeset
for help on using the changeset viewer.