草庐IT

newHashMap

全部标签

java - Maps.newHashMap 与新 HashMap 返回的 HashMap

我第一次尝试Guava,我发现它真的很棒。我在Springjdbc模板上执行了几个参数化检索查询。DAO(AbstractDataAccessObject)中的方法是这样的。这里没问题。publicMapgetResultAsMap(Stringsql,Mapparameters){try{returnjdbcTemplate.queryForMap(sql,parameters);}catch(EmptyResultDataAccessExceptione){//Ignoreifnodatafoundforthisquerylogger.error(e.getMessage(),e)