try {
tmpSession = getSession();
tx = tmpSession.beginTransaction();
//inserts the svg file into sbi_binary_contents
SbiBinContents hibBinContents = null;
Integer binId = Integer.valueOf(aMap.getBinId());
if (binId != null && binId > new Integer("0")){
hibBinContents = (SbiBinContents) tmpSession.load(SbiBinContents.class, binId);
hibBinContents.setContent(content);
updateSbiCommonInfo4Insert(hibBinContents);
tmpSession.save(hibBinContents);
} else {
hibBinContents = new SbiBinContents();
hibBinContents.setContent(content);
Integer idBin = (Integer)tmpSession.save(hibBinContents);
// recover the saved binary hibernate object
hibBinContents = (SbiBinContents) tmpSession.load(SbiBinContents.class, idBin);
}
SbiGeoMaps hibMap = (SbiGeoMaps) tmpSession.load(SbiGeoMaps.class, new Integer(aMap.getMapId()));