Transaction tx = session.beginTransaction();
ISbiGeoMapsDAO mapsDAO = DAOFactory.getSbiGeoMapsDAO();
List allMaps = mapsDAO.loadAllMaps();
Iterator mapsIt = allMaps.iterator();
while (mapsIt.hasNext()) {
GeoMap map = (GeoMap) mapsIt.next();
SbiGeoMaps hibMap = new SbiGeoMaps(map.getMapId());
hibMap.setDescr(map.getDescr());
hibMap.setFormat(map.getFormat());
hibMap.setName(map.getName());
hibMap.setUrl(map.getUrl());
if (map.getBinId() == 0) {
logger.warn("Map with id = " + map.getMapId() + " and name = " + map.getName() +
" has not binary content!!");
hibMap.setBinContents(null);
} else {
SbiBinContents hibBinContent = new SbiBinContents();
hibBinContent.setId(map.getBinId());
byte[] content = DAOFactory.getBinContentDAO().getBinContent(map.getBinId());
hibBinContent.setContent(content);
hibMap.setBinContents(hibBinContent);
session.save(hibBinContent);
}