Transaction tx = null;
try {
aSession = getSession();
tx = aSession.beginTransaction();
// store the binary content
SbiBinContents hibBinContent = new SbiBinContents();
byte[] bytes = null;
try {
bytes = dossierPresentation.getContent();
} catch (EMFInternalError e) {
logger.error("Could not retrieve content of DossierPresentation object in input.");
throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
}
hibBinContent.setContent(bytes);
Integer idBin = (Integer)aSession.save(hibBinContent);
// recover the saved binary hibernate object
hibBinContent = (SbiBinContents) aSession.load(SbiBinContents.class, idBin);
// recover the associated biobject
SbiObjects obj = (SbiObjects) aSession.load(SbiObjects.class, dossierPresentation.getBiobjectId());