Integer idBin = (Integer)aSession.save(hibBinContent);
// recover the saved binary hibernate object
hibBinContent = (SbiBinContents) aSession.load(SbiBinContents.class, idBin);
// store the subobject
Date now = new Date();
SbiSubObjects hibSub = new SbiSubObjects();
hibSub.setOwner(subObj.getOwner());
hibSub.setLastChangeDate(now);
hibSub.setIsPublic(subObj.getIsPublic());
hibSub.setCreationDate(now);
hibSub.setDescription(subObj.getDescription());
hibSub.setName(subObj.getName());
hibSub.setSbiBinContents(hibBinContent);
hibSub.setSbiObject(hibBIObject);
updateSbiCommonInfo4Insert(hibSub);
aSession.save(hibSub);
subObjId = hibSub.getSubObjId();
tx.commit();
} catch (HibernateException he) {
logger.error(he);
if (tx != null)
tx.rollback();