|
|
|
@ -78,7 +78,7 @@ public class PostgisIndex {
|
|
|
|
|
PreparedStatement ps = db.prepareInsertStatement(centroidsTable, true, true);
|
|
|
|
|
|
|
|
|
|
log.debug("Deleting centroid if present. ID is "+record.getId());
|
|
|
|
|
db.deleteByFieldValue(centroidsTable, new Field(DBConstants.Concessioni.PRODUCT_ID,FieldType.TEXT), record.getId()+"");
|
|
|
|
|
db.deleteByFieldValue(centroidsTable, new Field(DBConstants.Concessioni.PRODUCT_ID,FieldType.TEXT), record.getMongo_id());
|
|
|
|
|
|
|
|
|
|
centroidsTable.fillCSVPreparedStatament(centroidRow, ps, false);
|
|
|
|
|
ps.executeUpdate();
|
|
|
|
@ -103,7 +103,7 @@ public class PostgisIndex {
|
|
|
|
|
PostgisDBManagerI db=PostgisDBManager.get();
|
|
|
|
|
PostgisTable centroidsTable=getCentroidsTable();
|
|
|
|
|
log.debug("Deleting centroid if present. ID is "+record.getId());
|
|
|
|
|
db.deleteByFieldValue(centroidsTable, new Field(DBConstants.Concessioni.PRODUCT_ID,FieldType.TEXT), record.getId()+"");
|
|
|
|
|
db.deleteByFieldValue(centroidsTable, new Field(DBConstants.Concessioni.PRODUCT_ID,FieldType.TEXT), record.getMongo_id());
|
|
|
|
|
}catch(Exception e) {
|
|
|
|
|
log.warn("Unable to remove centroid ",e);
|
|
|
|
|
}
|
|
|
|
@ -115,7 +115,7 @@ public class PostgisIndex {
|
|
|
|
|
|
|
|
|
|
// CENTROID
|
|
|
|
|
Map<String,String> centroidsRow=new HashMap<String, String>();
|
|
|
|
|
centroidsRow.put(DBConstants.Concessioni.PRODUCT_ID, record.getId()+"");
|
|
|
|
|
centroidsRow.put(DBConstants.Concessioni.PRODUCT_ID, record.getMongo_id());
|
|
|
|
|
centroidsRow.put(DBConstants.Concessioni.ANNO, record.getDataInizioProgetto().getYear()+"");
|
|
|
|
|
centroidsRow.put(DBConstants.Concessioni.NOME, record.getNome());
|
|
|
|
|
centroidsRow.put(DBConstants.Concessioni.REGIONE, ""); //TODO
|
|
|
|
|