final Serializable id = session.getEntityPersister( entityName, obj )
//TODO: cache the persister, this shows up in yourkit
.getIdentifier( obj, session.getEntityMode() );
if (id==null) {
throw new IdentifierGenerationException(
"ids for this class must be manually assigned before calling save(): " +
entityName
);
}
return id;