Author: bleny Date: 2012-03-14 10:56:55 +0100 (Wed, 14 Mar 2012) New Revision: 1564 Url: http://forge.codelutin.com/repositories/revision/wao/1564 Log: Anomalie #980 Temps d'ouverture de la page navires Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/BoatDAOImpl.java Modified: trunk/wao-business/src/main/java/fr/ifremer/wao/entity/BoatDAOImpl.java =================================================================== --- trunk/wao-business/src/main/java/fr/ifremer/wao/entity/BoatDAOImpl.java 2012-03-13 14:50:58 UTC (rev 1563) +++ trunk/wao-business/src/main/java/fr/ifremer/wao/entity/BoatDAOImpl.java 2012-03-14 09:56:55 UTC (rev 1564) @@ -108,7 +108,8 @@ sampleRowDAO.toTopiaQuery(filter.getSamplingFilter()); samplingFilterQuery.setSelect("SR.topiaId"); query.addDistinct() - .addLeftJoin(boatProperty.elligibleBoat(), "EB", true) + // On ne fetch pas ici car on fetch déjà quand nécessaire + .addLeftJoin(boatProperty.elligibleBoat(), "EB", false) .addSubQuery( "EB." + ElligibleBoat.PROPERTY_SAMPLE_ROW + "." + SampleRow.TOPIA_ID + " IN (?)", samplingFilterQuery); @@ -183,21 +184,25 @@ boatProperty.fleet(), boatProperty.district()); + WaoQueryHelper.ElligibleBoatProperty elligibleBoatProperty = WaoQueryHelper.newElligibleBoatProperty("ER"); + + query.addLeftJoin(boatProperty.elligibleBoat(), "ER", true); + query.addLeftJoin(elligibleBoatProperty.sampleRow(), "SR", true); + // load data for sample row: company, fishingZone, DCF5Code, profession - WaoQueryHelper.SampleRowProperty sampleRowProperty = - WaoQueryHelper.newSampleRowProperty(); -// query.addFetch( // XXX 20110524 bleny fetching those two data raise a - // 'cannot simultaneously fetch multiple bags' - // exception. Not fetching works but data will be lazily - // loaded and it costs performance in - // BoatFilterValues#fillBoats() - // - // sampleRowProperty.fishingZone(), - // sampleRowProperty.dCF5Code(), -// sampleRowProperty.company(), -// sampleRowProperty.profession()); + WaoQueryHelper.SampleRowProperty sampleRowProperty = elligibleBoatProperty.sampleRowProperty(); + query.addFetch( // XXX 20110524 bleny fetching those two data raise a + // 'cannot simultaneously fetch multiple bags' + // exception. Not fetching works but data will be lazily + // loaded and it costs performance in + // BoatFilterValues#fillBoats() + // elligibleBoatProperty.sampleRowProperty().fishingZone(), + // elligibleBoatProperty.sampleRowProperty().dCF5Code(), + sampleRowProperty.company(), + sampleRowProperty.profession()); + if (log.isDebugEnabled()) { log.debug("query to get boats by filter : " + query); }