public PersistenceSession createPersistenceSession() {
final PersistenceSession persistenceSession = super.createPersistenceSession();
if (persistedObjects != null) {
final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();
final IdentifierGeneratorDefault identifierGeneratorDefault = identifierGenerator.underlying(IdentifierGeneratorDefault.class);
if(identifierGeneratorDefault != null) {
identifierGeneratorDefault.resetTo(persistedObjects.getOidGeneratorMemento());
}
}