예제 #1
0
 @Override
 public void close() {
   final InMemoryPersistenceSessionFactory inMemoryPersistenceSessionFactory =
       getInMemoryPersistenceSessionFactory();
   // TODO: this is hacky, only here to keep tests running. Should sort out
   // using mocks
   if (inMemoryPersistenceSessionFactory != null) {
     inMemoryPersistenceSessionFactory.attach(getPersistenceSession(), persistedObjects);
     persistedObjects = null;
   }
 }
예제 #2
0
 @Override
 public void open() {
   // TODO: all a bit hacky, but is to keep tests running. Should really
   // sort out using mocks.
   final InMemoryPersistenceSessionFactory inMemoryPersistenceSessionFactory =
       getInMemoryPersistenceSessionFactory();
   persistedObjects =
       inMemoryPersistenceSessionFactory == null
           ? null
           : inMemoryPersistenceSessionFactory.getPersistedObjects();
   if (persistedObjects == null) {
     if (inMemoryPersistenceSessionFactory != null) {
       persistedObjects = inMemoryPersistenceSessionFactory.createPersistedObjects();
     } else {
       persistedObjects = new ObjectStorePersistedObjectsDefault();
     }
   } else {
     recreateAdapters();
   }
 }