Refactored org.opennms.netmgt.poller.DefaultQueryManager and made some minor changes to avoid IncorrectResultSizeDataAccessException