Transaction tx = null;
try {
aSession = getSession();
tx = aSession.beginTransaction();
SbiOrgUnitHierarchies hibHierarchy = new SbiOrgUnitHierarchies();
hibHierarchy.setLabel(h.getLabel());
hibHierarchy.setName(h.getName());
hibHierarchy.setDescription(h.getDescription());
hibHierarchy.setTarget(h.getTarget());
hibHierarchy.setCompany(h.getCompany());
updateSbiCommonInfo4Insert(hibHierarchy);
aSession.save(hibHierarchy);
tx.commit();
h.setId(hibHierarchy.getId());
} finally {
rollbackIfActiveAndClose(tx, aSession);
}
logger.debug("OUT: Hierarchy inserted successfully with id " + h.getId());